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:
Optional
document?: stringRaw text content of the document.
Optional
embedding?: number[]Embedding for the document. If not provided, it will be generated based on the document
.
Optional
id?: stringThe ID of the document. If not provided, it will be auto-generated.
Optional
metadata?: 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:
Optional
nResults?: numberThe number of top similar results to return.
Optional
predicate?: (value: QueryResult) => booleanFunction to filter results after retrieval.
Optional
queryEmbedding?: number[]Pre-computed embedding for the query.
Optional
queryText?: 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:
Optional
document?: stringNew content for the document.
Optional
embedding?: number[]New embedding for the document. If not provided, it will be generated based on the document
.
The ID of the document to update.
Optional
metadata?: 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.