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:

  • dimensions
  • metric
  • filterable
  • 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:

MethodUse 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.
nativeAccess the raw provider handle when you need provider-specific features.

Core types

TypeDescription
VectorDefinitionOptions<TMetadata>The shared index definition shape.
VectorHandle<TMetadata>The resolved runtime handle for one named index.
VectorQueryThe common query shape.
VectorQueryResultThe result returned from query().
VectorProviderThe active backend name.