A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.
Optional
_indexA map of aliases for constructor args. Keys are the attribute names, e.g. "foo". Values are the alias that will replace the key in serialization. This is used to eg. make argument names match Python.
A map of additional attributes to merge with constructor args. Keys are the attribute names, e.g. "foo". Values are the attribute values, which will be serialized. These attributes need to be accepted by the constructor as arguments.
The final serialized identifier for the module.
A map of secrets, which will be omitted from serialization. Keys are paths to the secret in constructor args, e.g. "foo.bar.baz". Values are the secret ids, which will be used when deserializing.
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
lc_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.