Defines the filter type used in search and delete operations. Can be an object for structured conditions or a string for simpler filtering.
Embeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.
Creates a VectorStoreRetriever
instance with flexible configuration options.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<SingleStoreVectorStore>>If a number is provided, it sets the k
parameter (number of items to retrieve).
Optional
filter: string | objectOptional 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.
Performs a similarity search on the texts stored in the SingleStoreDB
A string representing the query text.
Optional
k: numberThe number of nearest neighbors to return. By default, it is 4.
Optional
filter: MetadataOptional metadata to filter the texts by.
Optional
_callbacks: CallbacksCallbacks object, not used in this implementation.
Top matching documents
Performs a similarity search on the texts stored in the SingleStoreDB using the specified search strategy and distance metric.
A string representing the query text.
An array of numbers representing the query vector.
The number of nearest neighbors to return.
Optional
filter: MetadataOptional metadata to filter the texts by.
Top matching documents with score
Performs a similarity search on the vectors stored in the SingleStoreDB database.
An array of numbers representing the query vector.
The number of nearest neighbors to return.
Optional
filter: MetadataOptional metadata to filter the vectors by.
Top matching vectors with score
Performs a similarity search on the texts stored in the SingleStoreDB
A string representing the query text.
Optional
k: numberThe number of nearest neighbors to return. By default, it is 4.
Optional
filter: MetadataOptional metadata to filter the texts by.
Optional
_callbacks: CallbacksTop matching documents with score
Static
fromCreates a new instance of the SingleStoreVectorStore class from a list of Document objects.
An array of Document objects.
An Embeddings object.
A SingleStoreVectorStoreConfig object.
A new SingleStoreVectorStore instance
Static
fromCreates a new instance of the SingleStoreVectorStore class from a list of texts.
An array of strings.
An array of metadata objects.
An Embeddings object.
A SingleStoreVectorStoreConfig object.
A new SingleStoreVectorStore instance
Class for interacting with SingleStoreDB, a high-performance distributed SQL database. It provides vector storage and vector functions.