# Vectors

## List Vectors

`client.VectorStores.Vectors.List(ctx, vectorStoreName, query) (*CursorPageVectors[VectorDocument], error)`

**get** `/v5/vector-stores/{vector_store_name}/vectors`

List documents in a vector store with cursor-based pagination.

**Use Cases:** Browse documents, export content, audit stored data, or retrieve documents by metadata
without semantic search.

**Ordering:** Documents are returned in storage order (insertion order), not ranked by similarity.
For similarity-based retrieval, use the query endpoint.

**Filtering:** Apply metadata filters to narrow results to specific subsets (e.g., all documents
where `category: "research"`). Only indexed fields can be used for filtering.

**Pagination:** Uses cursor-based pagination for efficient traversal of large datasets. Pass the
`next_cursor` from each response as `starting_after` to retrieve the next page, or `prev_cursor`
as `ending_before` to retrieve the previous page. A null cursor indicates no further pages exist.

**Embedding Vectors:** Setting `include_vectors=true` includes the full embedding vector arrays in
the response. This significantly increases payload size and reduces the maximum page size from 1000 to
100 documents. Enable only when raw vectors are required for external processing.

### Parameters

- `vectorStoreName string`

  The name of the vector store

- `query VectorStoreVectorListParams`

  - `Cursor param.Field[string]`

    Alias for starting_after. Use starting_after instead.

  - `EndingBefore param.Field[string]`

  - `Filter param.Field[string]`

    Metadata filter expression (JSON)

  - `IncludeVectors param.Field[bool]`

    Include embedding vectors

  - `Limit param.Field[int64]`

  - `SortBy param.Field[string]`

  - `SortOrder param.Field[SortOrder]`

  - `StartingAfter param.Field[string]`

### Returns

- `type VectorDocument struct{…}`

  A document returned from direct lookups (get/list operations).

  - `ID string`

    Document ID

  - `Content TextContent`

    Text content for documents.

    - `Text string`

      Text content to be embedded

    - `Type TextContentType`

      Content type identifier

      - `const TextContentTypeText TextContentType = "text"`

  - `Metadata map[string, any]`

    Key-value metadata

  - `Vector []float64`

    Embedding vector (if requested)

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  page, err := client.VectorStores.Vectors.List(
    context.TODO(),
    "vector_store_name",
    sgpdev.VectorStoreVectorListParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "content": {
        "text": "text",
        "type": "text"
      },
      "metadata": {
        "foo": "bar"
      },
      "vector": [
        0
      ]
    }
  ],
  "total": 0,
  "vectors": [
    {
      "id": "id",
      "content": {
        "text": "text",
        "type": "text"
      },
      "metadata": {
        "foo": "bar"
      },
      "vector": [
        0
      ]
    }
  ],
  "limit": 0,
  "next_cursor": "next_cursor",
  "object": "list",
  "prev_cursor": "prev_cursor"
}
```

## Get Vector

`client.VectorStores.Vectors.Get(ctx, vectorID, params) (*VectorDocument, error)`

**get** `/v5/vector-stores/{vector_store_name}/vectors/{vector_id}`

Retrieve a single document by its unique ID.

Returns the document's full content, metadata, and optionally its embedding vector. Use this endpoint
for direct lookups when the exact document ID is known. For content similarity search,
use the query endpoint.

### Parameters

- `vectorID string`

  The ID of the vector to retrieve

- `params VectorStoreVectorGetParams`

  - `VectorStoreName param.Field[string]`

    Path param: The name of the vector store

  - `IncludeVectors param.Field[bool]`

    Query param: Include embedding vectors

### Returns

- `type VectorDocument struct{…}`

  A document returned from direct lookups (get/list operations).

  - `ID string`

    Document ID

  - `Content TextContent`

    Text content for documents.

    - `Text string`

      Text content to be embedded

    - `Type TextContentType`

      Content type identifier

      - `const TextContentTypeText TextContentType = "text"`

  - `Metadata map[string, any]`

    Key-value metadata

  - `Vector []float64`

    Embedding vector (if requested)

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  vectorDocument, err := client.VectorStores.Vectors.Get(
    context.TODO(),
    "vector_id",
    sgpdev.VectorStoreVectorGetParams{
      VectorStoreName: "vector_store_name",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", vectorDocument.ID)
}
```

#### Response

```json
{
  "id": "id",
  "content": {
    "text": "text",
    "type": "text"
  },
  "metadata": {
    "foo": "bar"
  },
  "vector": [
    0
  ]
}
```

## Domain Types

### Vector Document

- `type VectorDocument struct{…}`

  A document returned from direct lookups (get/list operations).

  - `ID string`

    Document ID

  - `Content TextContent`

    Text content for documents.

    - `Text string`

      Text content to be embedded

    - `Type TextContentType`

      Content type identifier

      - `const TextContentTypeText TextContentType = "text"`

  - `Metadata map[string, any]`

    Key-value metadata

  - `Vector []float64`

    Embedding vector (if requested)
