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.
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.
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.
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
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
lc_Static
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.