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.
Method 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.
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.
Class that extends
SaveableVectorStore
and provides methods for adding documents and vectors to ausearch
index, performing similarity searches, and saving the index.