Adds an array of Document objects to the store.
An array of Document objects.
Optionaloptions: { Optionalids?: string[]A Promise that resolves when the documents have been added.
Adds an array of vectors and their corresponding Document objects to the store.
An array of vectors.
An array of Document objects corresponding to the vectors.
Optionaloptions: { Optionalids?: string[]A Promise that resolves with an array of document IDs when the vectors and documents have been added.
Merges the current FaissStore with another FaissStore.
The FaissStore to merge with.
A Promise that resolves with an array of document IDs when the merge is complete.
Performs a similarity search in the vector store using a query vector and returns the top k results along with their scores.
A query vector.
The number of top results to return.
A Promise that resolves with an array of tuples, each containing a Document and its corresponding score.
StaticfromCreates a new FaissStore from an array of Document objects and an Embeddings object.
An array of Document objects.
An Embeddings object.
OptionaldbConfig: { An optional configuration object for the document store.
Optionaldocstore?: SynchronousInMemoryDocstoreA Promise that resolves with a new FaissStore instance.
StaticfromCreates a new FaissStore from an existing FaissStore and an Embeddings object.
An existing FaissStore.
An Embeddings object.
OptionaldbConfig: { An optional configuration object for the document store.
Optionaldocstore?: SynchronousInMemoryDocstoreA Promise that resolves with a new FaissStore instance.
StaticfromCreates a new FaissStore from an array of texts, their corresponding metadata, and an Embeddings object.
An array of texts.
An array of metadata corresponding to the texts, or a single metadata object to be used for all texts.
An Embeddings object.
OptionaldbConfig: { An optional configuration object for the document store.
Optionaldocstore?: SynchronousInMemoryDocstoreA Promise that resolves with a new FaissStore instance.
StaticimportStaticimportStaticloadLoads a FaissStore from a specified directory.
The directory to load the FaissStore from.
An Embeddings object.
A Promise that resolves with a new FaissStore instance.
Staticload
A class that wraps the FAISS (Facebook AI Similarity Search) vector database for efficient similarity search and clustering of dense vectors.