Skip to content
3 min read · 524 words

Interface: VectorStore()

Defined in: src/batteries/vector/contract.ts:31

The public surface every vector store exposes: capability flags, lifecycle (connect/close), a callable form that opens a VectorQueryBuilder for a collection, schema access, and an optional transaction wrapper. Adapters extend BaseVectorStore, which implements this plus the low-level plan/schema executor contracts.

Extends

ts
VectorStore(collection: string): VectorQueryBuilder;

Defined in: src/batteries/vector/contract.ts:41

Callable form: store('collection') returns a query builder scoped to that collection.

Parameters

ParameterType
collectionstring

Returns

VectorQueryBuilder

Properties

PropertyModifierTypeDescriptionDefined in
capabilitiesreadonlyVectorStoreCapabilitiesStatic description of what this backend supports (built-in encoding, transactions, filters, etc.).src/batteries/vector/contract.ts:33
schemapublicVectorSchemaBuilderSchema builder for creating, dropping, and migrating collections.src/batteries/vector/contract.ts:43

Methods

close()

ts
close(): Promise<void>;

Defined in: src/batteries/vector/contract.ts:39

Release the backing connection and any held resources.

Returns

Promise<void>


connect()

ts
connect(): Promise<void>;

Defined in: src/batteries/vector/contract.ts:37

Open the backing connection (clients, pools, sockets).

Returns

Promise<void>


createCollection()

ts
createCollection(spec: CollectionSpec, ifNotExists: boolean): Promise<void>;

Defined in: src/batteries/vector/schema.ts:16

Create a collection from spec; ifNotExists suppresses the already-exists error.

Parameters

ParameterType
specCollectionSpec
ifNotExistsboolean

Returns

Promise<void>

Inherited from

SchemaExecutor.createCollection


dropCollection()

ts
dropCollection(collection: string, ifExists: boolean): Promise<void>;

Defined in: src/batteries/vector/schema.ts:18

Drop a collection; ifExists suppresses the not-found error.

Parameters

ParameterType
collectionstring
ifExistsboolean

Returns

Promise<void>

Inherited from

SchemaExecutor.dropCollection


executeDelete()

ts
executeDelete(plan: DeletePlan): Promise<void>;

Defined in: src/batteries/vector/builder.ts:57

Executes an assembled delete plan.

Parameters

ParameterType
planDeletePlan

Returns

Promise<void>

Inherited from

PlanSink.executeDelete


executeSearch()

ts
executeSearch(plan: SearchPlan): Promise<VectorMatch[]>;

Defined in: src/batteries/vector/builder.ts:53

Executes an assembled search plan and resolves the matching records.

Parameters

ParameterType
planSearchPlan

Returns

Promise<VectorMatch[]>

Inherited from

PlanSink.executeSearch


executeUpsert()

ts
executeUpsert(plan: UpsertPlan): Promise<void>;

Defined in: src/batteries/vector/builder.ts:55

Executes an assembled upsert plan.

Parameters

ParameterType
planUpsertPlan

Returns

Promise<void>

Inherited from

PlanSink.executeUpsert


hasCollection()

ts
hasCollection(collection: string): Promise<boolean>;

Defined in: src/batteries/vector/schema.ts:20

Resolve true if the collection exists.

Parameters

ParameterType
collectionstring

Returns

Promise<boolean>

Inherited from

SchemaExecutor.hasCollection


isAvailable()

ts
isAvailable(): boolean;

Defined in: src/batteries/vector/contract.ts:35

Whether the backend's optional peer dependency is installed and the store is usable.

Returns

boolean


renameCollection()

ts
renameCollection(from: string, to: string): Promise<void>;

Defined in: src/batteries/vector/schema.ts:22

Rename a collection from from to to.

Parameters

ParameterType
fromstring
tostring

Returns

Promise<void>

Inherited from

SchemaExecutor.renameCollection


transaction()

ts
transaction(fn: (tx: VectorStore) => Promise<void>): Promise<void>;

Defined in: src/batteries/vector/contract.ts:45

Run fn inside a backend transaction, where supported; rejects otherwise.

Parameters

ParameterType
fn(tx: VectorStore) => Promise<void>

Returns

Promise<void>