Abstract Class: BaseVectorStore
Defined in: src/batteries/vector/contract.ts:54
Abstract base shared by every bundled vector adapter. It implements the cross-cutting surface (query/schema/transaction/asCallable/encode) on top of the small set of backend-specific abstract methods each adapter fills in (connect, executeSearch, createCollection, …). Concrete adapters inherit the doc comments below unless they override them.
Extended by
VespaVectorStoreTypesenseVectorStoreWeaviateVectorStoreSurrealDBVectorStoreS3VectorsVectorStoreSolrVectorStoreRedisVectorStoreSqliteVecVectorStorePineconeVectorStorePgVectorStoreOramaVectorStoreQdrantVectorStoreNeo4jVectorStoreOracle23aiVectorStoreMongoDBVectorStoreMilvusVectorStoreOpenSearchVectorStoreMariaDBVectorStoreLanceDBVectorStoreInMemoryVectorStoreMeilisearchVectorStoreElasticsearchVectorStoreHnswlibVectorStoreDuckDBVectorStoreCouchbaseVectorStoreChromaVectorStoreArangoDBVectorStoreCloudflareVectorizeVectorStoreClickHouseVectorStore
Implements
Constructors
Constructor
new BaseVectorStore(options: BaseVectorStoreOptions): BaseVectorStore;Defined in: src/batteries/vector/contract.ts:60
Parameters
| Parameter | Type |
|---|---|
options | BaseVectorStoreOptions |
Returns
BaseVectorStore
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
capabilities | abstract | VectorStoreCapabilities | Static description of what this backend supports — see VectorStoreCapabilities. | src/batteries/vector/contract.ts:56 |
Accessors
schema
Get Signature
get schema(): VectorSchemaBuilder;Defined in: src/batteries/vector/contract.ts:109
Schema builder bound to this store, for creating/dropping/migrating collections.
Returns
Methods
asCallable()
asCallable(): CallableVectorStore;Defined in: src/batteries/vector/contract.ts:123
Wrap this store in a callable proxy so store('collection') is shorthand for store.query('collection'), while all other methods/properties pass through unchanged.
Returns
close()
abstract close(): Promise<void>;Defined in: src/batteries/vector/contract.ts:69
Release the backing connection and any held resources.
Returns
Promise<void>
connect()
abstract connect(): Promise<void>;Defined in: src/batteries/vector/contract.ts:67
Establish the backing connection (open clients, pools, sockets). Idempotent where the driver allows.
Returns
Promise<void>
createCollection()
abstract createCollection(spec: CollectionSpec, ifNotExists: boolean): Promise<void>;Defined in: src/batteries/vector/contract.ts:79
Create a collection from spec; a no-op when ifNotExists and it already exists.
Parameters
| Parameter | Type |
|---|---|
spec | CollectionSpec |
ifNotExists | boolean |
Returns
Promise<void>
Implementation of
SchemaExecutor.createCollection
dropCollection()
abstract dropCollection(collection: string, ifExists: boolean): Promise<void>;Defined in: src/batteries/vector/contract.ts:81
Drop a collection; a no-op when ifExists and it is absent.
Parameters
| Parameter | Type |
|---|---|
collection | string |
ifExists | boolean |
Returns
Promise<void>
Implementation of
executeDelete()
abstract executeDelete(plan: DeletePlan): Promise<void>;Defined in: src/batteries/vector/contract.ts:76
Execute a compiled delete plan.
Parameters
| Parameter | Type |
|---|---|
plan | DeletePlan |
Returns
Promise<void>
Implementation of
executeSearch()
abstract executeSearch(plan: SearchPlan): Promise<VectorMatch[]>;Defined in: src/batteries/vector/contract.ts:72
Execute a compiled search plan and return the matched records.
Parameters
| Parameter | Type |
|---|---|
plan | SearchPlan |
Returns
Promise<VectorMatch[]>
Implementation of
executeUpsert()
abstract executeUpsert(plan: UpsertPlan): Promise<void>;Defined in: src/batteries/vector/contract.ts:74
Execute a compiled upsert plan (insert-or-replace the given records).
Parameters
| Parameter | Type |
|---|---|
plan | UpsertPlan |
Returns
Promise<void>
Implementation of
hasCollection()
abstract hasCollection(collection: string): Promise<boolean>;Defined in: src/batteries/vector/contract.ts:83
Whether a collection currently exists in the backend.
Parameters
| Parameter | Type |
|---|---|
collection | string |
Returns
Promise<boolean>
Implementation of
isAvailable()
abstract isAvailable(): boolean;Defined in: src/batteries/vector/contract.ts:65
Whether the backend's optional peer dependency is installed and the store is usable.
Returns
boolean
query()
query(collection: string): VectorQueryBuilder;Defined in: src/batteries/vector/contract.ts:114
Open a VectorQueryBuilder scoped to collection (default top-K of 10).
Parameters
| Parameter | Type |
|---|---|
collection | string |
Returns
renameCollection()
abstract renameCollection(from: string, to: string): Promise<void>;Defined in: src/batteries/vector/contract.ts:85
Rename a collection from from to to.
Parameters
| Parameter | Type |
|---|---|
from | string |
to | string |
Returns
Promise<void>
Implementation of
SchemaExecutor.renameCollection
transaction()
transaction(_fn: (tx: CallableVectorStore) => Promise<void>): Promise<void>;Defined in: src/batteries/vector/contract.ts:104
Run fn inside a backend transaction. The base implementation rejects with E_VECTOR_STORE_TRANSACTIONS_UNSUPPORTED; adapters whose backend supports transactions override this.
Parameters
| Parameter | Type |
|---|---|
_fn | (tx: CallableVectorStore) => Promise<void> |
Returns
Promise<void>