Skip to content
1 min read · 97 words

Function: createVectorStore()

ts
function createVectorStore<O>(
  config: CreateVectorStoreConfig<O>,
): Promise<CallableVectorStore>;

Defined in: batteries/vector/factory.ts:41

Build a callable store. Validate config; resolve the client (class | sync resolver | async resolver) to a BaseVectorStore subclass ctor; optional availability gate; construct; return asCallable(). Async so that client: () => import('…') can lazily load the adapter (and its driver) only when the store is actually created.

Type Parameters

Type ParameterDefault type
O extends BaseVectorStoreOptionsBaseVectorStoreOptions

Parameters

ParameterType
configCreateVectorStoreConfig<O>

Returns

Promise<CallableVectorStore>