Adds an array of Document objects to the store.
An array of Document objects.
Optional
options: { Optional
ids?: 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.
Optional
options: { Optional
ids?: string[]A Promise that resolves with an array of document IDs when the vectors and documents have been added.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<FaissStore>>Optional
filter: string | objectOptional
callbacks: CallbacksOptional
tags: string[]Optional
metadata: Record<string, unknown>Optional
verbose: booleanMerges 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.
Optional
k: numberOptional
filter: string | objectOptional
_callbacks: CallbacksPerforms 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.
Optional
k: numberOptional
filter: string | objectOptional
_callbacks: CallbacksOptional
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
fromCreates a new FaissStore from an array of Document objects and an Embeddings object.
An array of Document objects.
An Embeddings object.
Optional
dbConfig: { An optional configuration object for the document store.
Optional
docstore?: SynchronousInMemoryDocstoreA Promise that resolves with a new FaissStore instance.
Static
fromCreates a new FaissStore from an existing FaissStore and an Embeddings object.
An existing FaissStore.
An Embeddings object.
Optional
dbConfig: { An optional configuration object for the document store.
Optional
docstore?: SynchronousInMemoryDocstoreA Promise that resolves with a new FaissStore instance.
Static
fromCreates 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.
Optional
dbConfig: { An optional configuration object for the document store.
Optional
docstore?: SynchronousInMemoryDocstoreA Promise that resolves with a new FaissStore instance.
Static
importStatic
importStatic
loadLoads 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.
Static
loadGenerated using TypeDoc
A class that wraps the FAISS (Facebook AI Similarity Search) vector database for efficient similarity search and clustering of dense vectors.