- Embedded
- Python SDK
- JS/TS
Parameters
| Parameter | Type | Description |
|---|---|---|
index_name | str | Name of the index (must be unique) |
index_key | bytes | list[int] | tuple[int, ...] | np.ndarray | 32-byte encryption key for securing index data |
api_key | str | API key for CyborgDB authentication |
embedding | Embeddings | LangChain Embeddings instance |
index_location | DBConfig | Configuration for index data storage location |
config_location | DBConfig | Configuration for index config storage location |
items_location | Optional[DBConfig] | (Optional) Location for item data storage (default: memory) |
index_type | str | Type of index: "ivfflat", "ivfpq", or "ivfsq" (default: "ivfsq") |
index_config_params | Optional[Dict[str, Any]] | (Optional) Additional index configuration parameters |
dimension | Optional[int] | (Optional) Embedding dimension (auto-inferred if not provided) |
metric | str | Distance metric: "cosine", "euclidean", or "squared_euclidean" (default: "cosine") |
gpu_config | Optional[GPUConfig] | (Optional) GPU configuration for accelerated operations |
Returns
CyborgVectorStore: Initialized vector store instanceExample Usage
Exceptions
ValueError
ValueError
- Throws if index_type is invalid
RuntimeError
RuntimeError
- Throws if no embedding model provided and dimension not specified