Retriever
The retrieval component of a RAG system, responsible for recalling the text chunks most relevant to a user query from a vector store. Commonly used evaluation metrics include Recall@k and MRR.
Timeline (last 90 days)
LangChain's key abstractions include Model I/O (a unified input/output interface for different models), Retriever (retrieving context from data sources), Tool (external functions callable by the Agent) and Agent Executor (the control loop that decides when to call which tool).
In LangChain, Embeddings, VectorStore and Retriever form the standard abstraction: documents are split and embedded into the store, and at query time the question is first embedded and then the Top-K relevant chunks are retrieved and spliced into the prompt for the LLM.
`VectorStore` is responsible for vector storage and similarity retrieval (such as `similarity_search`) and is a relatively low-level storage interface; `Retriever` is a more general retrieval interface that only exposes `get_relevant_documents` (or `invoke` in newer versions), and any object that can return documents based on a query can be a Retriever, not necessarily a vector store.
`asRetriever()` merely adapts a VectorStore into a Retriever, and strategies such as MMR, similarity thresholds and multi-query rewriting can also be inserted in between.
The Retriever is responsible for quickly recalling candidate passages from a large-scale document library, and common implementations include dense retrieval, sparse retrieval, and hybrid retrieval.
Replacing the Retriever or Reranker directly changes the context fed into the model, which in turn affects the output quality of the entire RAG system, so any component change requires evaluating whether retrieval quality has degraded.
Through Retriever, Document Loader, and VectorStore integration, LangChain carries the retrieval-splicing-generation process of injecting external private data into the context in the form of prompts.
All Facts (7)
LangChain's key abstractions include Model I/O (a unified input/output interface for different models), Retriever (retrieving context from data sources), Tool (external functions callable by the Agent) and Agent Executor (the control loop that decides when to call which tool).
50%UnverifiedIn LangChain, Embeddings, VectorStore and Retriever form the standard abstraction: documents are split and embedded into the store, and at query time the question is first embedded and then the Top-K relevant chunks are retrieved and spliced into the prompt for the LLM.
50%Unverified`VectorStore` is responsible for vector storage and similarity retrieval (such as `similarity_search`) and is a relatively low-level storage interface; `Retriever` is a more general retrieval interface that only exposes `get_relevant_documents` (or `invoke` in newer versions), and any object that can return documents based on a query can be a Retriever, not necessarily a vector store.
50%Unverified`asRetriever()` merely adapts a VectorStore into a Retriever, and strategies such as MMR, similarity thresholds and multi-query rewriting can also be inserted in between.
50%UnverifiedThe Retriever is responsible for quickly recalling candidate passages from a large-scale document library, and common implementations include dense retrieval, sparse retrieval, and hybrid retrieval.
50%UnverifiedReplacing the Retriever or Reranker directly changes the context fed into the model, which in turn affects the output quality of the entire RAG system, so any component change requires evaluating whether retrieval quality has degraded.
50%UnverifiedThrough Retriever, Document Loader, and VectorStore integration, LangChain carries the retrieval-splicing-generation process of injecting external private data into the context in the form of prompts.
50%