Retriever
Also known as: First-stage retriever, Recall model
The fast first-stage search in RAG: bi-encoder or BM25 fetching a shortlist for the reranker or LLM.
The fast first stage of a RAG pipeline. Uses precomputed embeddings (bi-encoder) or an inverted index (BM25) to scan millions of documents in milliseconds and hand a shortlist of tens or hundreds of candidates to a downstream reranker or directly to the LLM.
In practice
Every production RAG interview covers the two-stage pipeline. The retriever is where recall lives, and its choice (dense vs sparse vs hybrid) drives cost, freshness, and quality.
How it compares
The retriever fetches a shortlist fast; the reranker scores that shortlist more accurately per pair.
A bi-encoder is one way to build a retriever: independent embeddings of query and docs compared by vector similarity.
Comparisons that include Retriever
Related topics
Questions that mention this term
- What does RAG primarily help with in LLM-based applications?
- Put the steps of a basic RAG query pipeline in order.
- Match each vector index type to its primary characteristic.
- Which metric best measures whether a RAG answer is grounded in the retrieved context?
- Why combine BM25 with dense embeddings for retrieval?
- HNSW vs IVF, when do you pick each for a production vector index?
Related terms
AI System Design
End-to-end design of production LLM systems: ingestion, retrieval, serving, eval, monitoring.
BM25
Classical TF-IDF-style lexical scoring: a surprisingly strong baseline, still the first stage of many hybrid RAG pipelines.
Chunking
Cutting documents into retrievable pieces before embedding them.
Context Engineering
Deciding what makes it into the model's context window (prompt + RAG + history + memory), and why.
Context Window
The max number of tokens a model can attend to at once.
Cosine Similarity
Compare two vectors by the cosine of their angle; the default similarity metric for embedding search.