Initializes a new instance of the LibSQLVectorStore.
The embeddings interface to use.
Configuration options for the vector store.
Embeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.
Adds documents to the vector store.
The documents to add.
The IDs of the added documents.
Adds vectors to the vector store.
The vectors to add.
The documents associated with the vectors.
The IDs of the added vectors.
Creates a VectorStoreRetriever
instance with flexible configuration options.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<LibSQLVectorStore<Metadata>>>If a number is provided, it sets the k
parameter (number of items to retrieve).
Optional
filter: InStatement | WhereCondition<Metadata>Optional filter criteria to limit the items retrieved based on the specified filter type.
Optional
callbacks: CallbacksOptional callbacks that may be triggered at specific stages of the retrieval process.
Optional
tags: string[]Tags to categorize or label the VectorStoreRetriever
. Defaults to an empty array if not provided.
Optional
metadata: Record<string, unknown>Additional metadata as key-value pairs to add contextual information for the retrieval process.
Optional
verbose: booleanIf true
, enables detailed logging for the retrieval process. Defaults to false
.
VectorStoreRetriever
instance based on the provided parameters.Optional
maxReturn documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.
Text to look up documents similar to.
Searches for documents similar to a text query by embedding the query and performing a similarity search on the resulting vector.
Text query for finding similar documents.
Optional
k: numberNumber of similar results to return. Defaults to 4.
Optional
filter: InStatement | WhereCondition<Metadata>Optional filter based on FilterType
.
Optional
_callbacks: CallbacksOptional callbacks for monitoring search progress
A promise resolving to an array of DocumentInterface
instances representing similar documents.
Performs a similarity search using a vector query and returns documents with their scores.
The query vector.
The number of results to return.
Optional
filter: InStatement | WhereCondition<Metadata>An array of tuples containing the similar documents and their scores.
Searches for documents similar to a text query by embedding the query, and returns results with similarity scores.
Text query for finding similar documents.
Optional
k: numberNumber of similar results to return. Defaults to 4.
Optional
filter: InStatement | WhereCondition<Metadata>Optional filter based on FilterType
.
Optional
_callbacks: CallbacksOptional callbacks for monitoring search progress
A promise resolving to an array of tuples, each containing a document and its similarity score.
Static
fromCreates a new LibSQLVectorStore instance from documents.
The documents to add to the store.
The embeddings interface to use.
Optional
options: LibSQLVectorStoreArgsConfiguration options for the vector store.
A new LibSQLVectorStore instance.
Static
fromCreates a new LibSQLVectorStore instance from texts.
The texts to add to the store.
The metadata for the texts.
The embeddings interface to use.
Optional
options: LibSQLVectorStoreArgsConfiguration options for the vector store.
A new LibSQLVectorStore instance.
A vector store using LibSQL/Turso for storage and retrieval.