class VectorStoreRetrieverInternal method that handles batching and configuration for a runnable
Placeholder method for retrieving relevant documents based on a query.
Default streaming implementation.
Assigns new fields to the dict output of this runnable. Returns a new runnable.
Convert a runnable to a tool. Return a new instance of RunnableToolLike
Default implementation of batch, which calls invoke N times.
Method to invoke the document transformation. This method calls the
Pick keys from the dict output of this runnable. Returns a new runnable.
Create a new runnable sequence that runs each individual runnable in series,
Stream output in chunks.
Generate a stream of events emitted by the internal steps of the runnable.
Stream all output from a runnable, as reported to the callback system.
Default implementation of transform, which buffers input and then calls stream.
Bind config to a Runnable, returning a new Runnable.
Create a new runnable from the current one that will try invoking
Bind lifecycle listeners to a Runnable, returning a new Runnable.
Add retry logic to an existing runnable.
The name of the serializable. Override to provide an alias or
A path to the module that contains the class, eg. ["langchain", "llms"]
A path to the module that contains the class, eg. ["langchain", "llms"]
Callbacks for this call and any sub-calls (eg. a Chain calling an LLM). Tags are passed to all callbacks, metadata is passed to handle*Start callbacks.
Specifies the number of documents to retrieve for each search query. Defaults to 4 if not specified, providing a basic result count for similarity or MMR searches.
Additional options specific to maximal marginal relevance (MMR) search, applicable
only if searchType is set to "mmr".
Includes:
fetchK: The initial number of documents fetched before applying the MMR algorithm,
allowing for a larger selection from which to choose the most diverse results.lambda: A parameter between 0 and 1 to adjust the relevance-diversity balance,
where 0 prioritizes diversity and 1 prioritizes relevance.Determines the type of search operation to perform on the vector store.
"similarity" (default): Conducts a similarity search based purely on vector similarity
to the query."mmr": Executes a maximal marginal relevance (MMR) search, balancing relevance and
diversity in the retrieved results.The instance of VectorStore used for storing and retrieving document embeddings.
This vector store must implement the VectorStoreInterface to be compatible
with the retriever’s operations.
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.
Class for retrieving documents from a VectorStore based on vector similarity
or maximal marginal relevance (MMR).
VectorStoreRetriever extends BaseRetriever, implementing methods for
adding documents to the underlying vector store and performing document
retrieval with optional configurations.
VectorStoreRetriever
Default streaming implementation.