Definition

A retriever is the component that accepts a query and selects potentially relevant items from a corpus. It typically returns a limited set of candidates, often with identifiers, source metadata, and initial scores. Those items might be documents, passages, or records.

The retriever can use term matching, vector search, or both. It may also apply filters, such as a product version or the current user’s access scope. If the system uses an index, a separate indexing step makes data searchable. The retriever queries the available data.

Simple example

A support assistant receives the question, “How do we roll back a failed deployment?” The retriever searches the operations documentation and returns 20 passages, including rollback steps and several less useful deployment notes. A reranker reorders those 20 passages before the application selects what to send to the model.

Why it matters

If the assistant gives generic deployment advice, inspect the returned passages first. If the rollback procedure is absent from the candidates, reranking cannot recover it. Changing only the answer-generation prompt will not add it to the model’s context. Too few candidates may exclude the right passage. Too many increase downstream processing and may add redundant or less relevant material.

One important nuance

Selecting candidates often requires an initial relevance score or ordering. A retriever that returns the top 20 results is already making a ranking decision. In a staged pipeline, a reranker makes a later pass over those results, usually with a different scoring method. Keeping the stages distinct helps you tell whether a useful passage was missing from the candidate set or merely placed too low.