Retriever

System retrieval published

Also known as: Retrieval Component, Search Component

Definition

A component that takes a query and returns relevant documents or passages from a corpus. The retriever is the "search" part of RAG—it determines what context the LLM sees. Retrievers can use various strategies: sparse (keyword/BM25), dense (vector similarity), or hybrid (combining both).

What this is NOT

  • Not the same as a vector database (the DB stores vectors; the retriever queries it)
  • Not the embedding model (the model creates vectors; the retriever uses them)
  • Not the full RAG pipeline (retriever is one component)

Alternative Interpretations

Different communities use this term differently:

llm-practitioners

An abstraction over document retrieval, typically implemented as a class or function that accepts a query string and returns ranked documents. Frameworks like LangChain and LlamaIndex provide retriever interfaces.

Sources: LangChain BaseRetriever documentation, LlamaIndex retriever documentation

information-retrieval

The first stage of a retrieval pipeline that efficiently narrows a large corpus to a candidate set, which may then be reranked by a more expensive model.

Sources: Information retrieval literature, Two-stage retrieval patterns

Examples

  • LangChain VectorStoreRetriever querying Pinecone
  • A hybrid retriever combining Elasticsearch BM25 with vector search
  • A self-query retriever that parses 'papers from 2023' into a date filter
  • An ensemble retriever merging results from multiple indexes

Counterexamples

Things that might seem like Retriever but are not:

  • The vector database itself (that's storage, not the retrieval interface)
  • The embedding model (that creates vectors, doesn't retrieve)
  • The LLM that generates the final response

Relations

Implementations

Tools and frameworks that implement this concept: