Embeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.
Optional
filterOptional
namespaceOptional
useThis method adds documents to Upstash database. Documents are first converted to vectors using the provided embeddings instance, and then upserted to the database.
Array of Document objects to be added to the database.
Optional
options: { Optional object containing array of ids for the documents.
Optional
ids?: string[]Optional
usePromise that resolves with the ids of the provided documents when the upsert operation is done.
This method adds the provided vectors to Upstash database.
Array of vectors to be added to the Upstash database.
Array of Document objects, each associated with a vector.
Optional
options: { Optional object containing the array of ids foor the vectors.
Optional
ids?: string[]Promise that resolves with the ids of the provided documents when the upsert operation is done.
Creates a VectorStoreRetriever
instance with flexible configuration options.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<UpstashVectorStore>>If a number is provided, it sets the k
parameter (number of items to retrieve).
Optional
filter: stringOptional 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.This method deletes documents from the Upstash database. You can either provide the target ids, or delete all vectors in the database.
Object containing either array of ids of the documents or boolean deleteAll.
Promise that resolves when the specified documents have been deleted from the database.
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: stringOptional filter based on FilterType
.
Optional
_callbacks: CallbacksOptional callbacks for monitoring search progress
A promise resolving to an array of DocumentInterface
instances representing similar documents.
This method performs a similarity search in the Upstash database over the existing vectors.
Query vector for the similarity search.
The number of similar vectors to return as result.
Optional
filter: stringPromise that resolves with an array of tuples, each containing Document object and similarity score. The length of the result will be maximum of 'k' and vectors in the index.
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: stringOptional 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
fromThis method creates a new UpstashVector instance from an array of Document instances.
The docs to be added to Upstash database.
Embedding interface of choice, to create the embeddings.
Object containing the Upstash database configs.
Promise that resolves with a new UpstashVector instance
Static
fromThis method creates a new UpstashVector instance from an existing index.
Embedding interface of the choice, to create the embeddings.
Object containing the Upstash database configs.
Static
fromThis method creates a new UpstashVector instance from an array of texts. The texts are initially converted to Document instances and added to Upstash database.
The texts to create the documents from.
The metadata values associated with the texts.
Embedding interface of choice, to create the text embeddings.
Object containing the Upstash database configs.
Promise that resolves with a new UpstashVector instance.
The main class that extends the 'VectorStore' class. It provides methods for interacting with Upstash index, such as adding documents, deleting documents, performing similarity search and more.