Initializes the vector store, loading necessary resources.
Promise that resolves to the initialized vector store instance.
Unloads the vector store, releasing any resources used.
Promise that resolves when the vector store is unloaded.
Adds a document to the vector store.
Object containing:
Optionaldocument?: stringRaw text content of the document.
Optionalembedding?: number[]Embedding for the document. If not provided, it will be generated based on the document.
Optionalid?: stringThe ID of the document. If not provided, it will be auto-generated.
Optionalmetadata?: Record<string, any>Metadata associated with the document.
Promise that resolves to the ID of the newly added document.
Deletes documents from the vector store by the provided predicate.
Promise that resolves once the documents are deleted.
Performs a similarity search against the stored vectors.
Object containing:
OptionalnResults?: numberThe number of top similar results to return.
Optionalpredicate?: (value: QueryResult) => booleanFunction to filter results after retrieval.
OptionalqueryEmbedding?: number[]Pre-computed embedding for the query.
OptionalqueryText?: stringThe raw query string to search for.
Promise that resolves to an array of QueryResult.
Updates a document in the vector store by its ID.
Object containing:
Optionaldocument?: stringNew content for the document.
Optionalembedding?: number[]New embedding for the document. If not provided, it will be generated based on the document.
The ID of the document to update.
Optionalmetadata?: Record<string, any>New metadata for the document.
Promise that resolves once the document is updated.
Defines the essential operations for a vector store. A vector store efficiently stores and retrieves high-dimensional vectors, facilitating similarity searches for AI applications like semantic search. It provides core functionalities for managing documents (add, update, delete) and performing similarity-based queries.