Method that adds documents to the usearch
index. It generates
embeddings for the documents and adds them to the index.
An array of Document
instances to be added to the index.
A promise that resolves with an array of document IDs.
Method that adds vectors to the usearch
index. It also updates the
mapping between vector IDs and document IDs.
An array of vectors to be added to the index.
An array of Document
instances corresponding to the vectors.
A promise that resolves with an array of document IDs.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<USearch>>Optional
filter: string | objectOptional
callbacks: CallbacksOptional
tags: string[]Optional
metadata: Record<string, unknown>Optional
verbose: booleanMethod that performs a similarity search in the usearch
index. It
returns the k
most similar documents to a given query vector, along
with their similarity scores.
The query vector.
The number of most similar documents to return.
A promise that resolves with an array of tuples, each containing a Document
and its similarity score.
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.
Static
fromStatic method that creates a new USearch
instance from a list of
documents. It generates embeddings for the documents and adds them to
the usearch
index.
An array of Document
instances to be added to the index.
An instance of Embeddings
used to generate embeddings for the documents.
Optional
dbConfig: { Optional configuration for the document store.
Optional
docstore?: SynchronousInMemoryDocstoreA promise that resolves with a new USearch
instance.
Static
fromStatic method that creates a new USearch
instance from a list of
texts. It generates embeddings for the texts and adds them to the
usearch
index.
An array of texts to be added to the index.
Metadata associated with the texts.
An instance of Embeddings
used to generate embeddings for the texts.
Optional
dbConfig: { Optional configuration for the document store.
Optional
docstore?: SynchronousInMemoryDocstoreA promise that resolves with a new USearch
instance.
Static
loadGenerated using TypeDoc
Class that extends
SaveableVectorStore
and provides methods for adding documents and vectors to ausearch
index, performing similarity searches, and saving the index.