VectorItem
Represents a single vector with its associated data.Fields
| Field | Type | Description |
|---|---|---|
Id | string | Unique identifier for the vector (required) |
Vector | []float32 | The vector data as float32 slice |
Contents | NullableContents | Optional text content associated with the vector |
Metadata | map[string]interface{} | Optional key-value pairs for filtering and retrieval |
CreateIndexParams
Parameters for creating a new encrypted vector index.Fields
| Field | Type | Required | Description |
|---|---|---|---|
IndexName | string | Yes | Unique identifier for the index |
IndexKey | []byte | Yes | 32-byte encryption key (use GenerateKey() to create) |
IndexConfig | IndexModel | No | Index configuration (IVFFlat, IVFPQ, or IVFSQ) |
Metric | *string | No | Distance metric (“euclidean”, “squared_euclidean”, “cosine”) |
EmbeddingModel | *string | No | Name of embedding model to associate |
Index Configuration Types
IndexModel Interface
All index configuration types implement this interface.IVFSQ Configuration
Create an IVFSQ (Scalar Quantization) index configuration that compresses each dimension independently.Parameters
| Parameter | Type | Description |
|---|---|---|
dimension | int32 | The dimensionality of vectors that will be stored |
sqBits | int32 | Number of bits per dimension for scalar quantization (typically 16) |
IVFFlat Configuration
Create an IVFFlat (Inverted File Flat) index configuration for higher accuracy.Parameters
| Parameter | Type | Description |
|---|---|---|
dimension | int32 | The dimensionality of vectors that will be stored |
IVFPQ Configuration
Create an IVFPQ (Inverted File with Product Quantization) index configuration for memory efficiency.Parameters
| Parameter | Type | Description |
|---|---|---|
dimension | int32 | The dimensionality of vectors that will be stored |
pqDim | int32 | Product quantization dimension (typically dimension/8 or dimension/16) |
pqBits | int32 | Bits per PQ code (typically 8, higher = more accurate but larger) |
Response Types
QueryResponse
Response from similarity search operations.QueryResultItem
A single result from a similarity search query.GetResponse
Response from Get operations containing retrieved vectors.ListIDsResponse
Response from ListIDs operations.Fields
| Field | Type | Description |
|---|---|---|
Ids | []string | List of all vector ID strings in the index |
Count | int32 | Total number of IDs in the index |
TrainParams
Parameters for training an encrypted vector index.Fields
| Field | Type | Description |
|---|---|---|
BatchSize | *int32 | Number of vectors processed per training batch (default: 2048) |
MaxIters | *int32 | Maximum training iterations (default: 100) |
Tolerance | *float64 | Convergence tolerance for training (default: 1e-6) |
MaxMemory | *int32 | Maximum memory usage in MB, 0 = no limit (default: 0) |
NLists | *int32 | Number of IVF clusters, 0 = auto-determine (default: 0) |
UpsertInput Interface
Sealed interface implemented by types that can be passed toUpsert.
VectorItems, BinaryUpsertParams
QueryInput Interface
Sealed interface implemented by types that can be passed toQuery.
QueryParams, BinaryQueryParams
VectorItems
A slice ofVectorItem that implements UpsertInput for type-safe upsert operations.
BinaryUpsertParams
Parameters for binary format vector upserts. More efficient thanVectorItems for large batches.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
IDs | []string | Yes | Unique identifiers for each vector |
Vectors | [][]float32 | Yes | Vector data, shape [n_vectors][dimension] |
Metadata | []map[string]interface{} | No | Optional metadata for each vector (length must match IDs if provided) |
Contents | []string | No | Optional content strings for each vector (length must match IDs if provided) |
BinaryQueryParams
Parameters for binary format similarity search. More efficient thanQueryParams for large batch queries.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
QueryVectors | [][]float32 | Yes | Query vectors, shape [n_queries][dimension] |
TopK | int32 | No | Number of nearest neighbors to return (default: 100) |
NProbes | *int32 | No | Number of IVF lists to probe |
Greedy | *bool | No | Enable greedy search mode |
Filters | map[string]interface{} | No | Metadata filters to apply |
Include | []string | No | Fields to include in response |
QueryParams
Parameters for similarity search queries. Supports single vector, batch, and content-based queries.Fields
| Field | Type | Required | Description |
|---|---|---|---|
QueryVector | []float32 | No | Single query vector for similarity search |
BatchQueryVectors | [][]float32 | No | Multiple query vectors for batch search |
QueryContents | *string | No | Text content for semantic search |
TopK | int32 | No | Number of nearest neighbors to return |
NProbes | *int32 | No | Number of clusters to probe for search |
Greedy | *bool | No | Use greedy search algorithm |
Filters | map[string]interface{} | No | Metadata filters to apply |
Include | []string | Yes | Fields to include in results: "metadata", "distance", "vector", "contents" |