Vector runtime API
Reference for defineVector, getVector, handle methods, and the core Vector types.
Use this page when you need the Vector surface area. For a guided first run, start with Quickstart.
Definition API
defineVector(options)
Use defineVector() to register one named vector index from the discovery directory.
Common definition fields include:
dimensionsmetricfilterable- optional embedding generation
- provider-specific overrides under
providers
Runtime API
getVector(name)
Use getVector() to resolve the active vector handle by discovered name.
The returned handle exposes the common provider-agnostic methods:
| Method | Use it for |
|---|---|
embed() | Generate embeddings when the definition provides embedding generation. |
upsert() | Insert or replace vector records. |
fetch() | Read records by id. |
query() | Run similarity search. |
delete() | Remove records by id or filter. |
native | Access the raw provider handle when you need provider-specific features. |
Core types
| Type | Description |
|---|---|
VectorDefinitionOptions<TMetadata> | The shared index definition shape. |
VectorHandle<TMetadata> | The resolved runtime handle for one named index. |
VectorQuery | The common query shape. |
VectorQueryResult | The result returned from query(). |
VectorProvider | The active backend name. |