FREE LESSON · LLMs & agents · 3 OF 4
How RAG Works: Retrieval, Reranking and Grounding
Ground language in evidence and tools — Retrieval, tool contracts, and untrusted content
RAG and tools move authority outside the model.
Retrieval finds candidate evidence; ranking and filtering decide which context enters the prompt; generation synthesizes an answer. Tool use lets the model propose structured calls to systems that can calculate, search, or change state. The application must validate arguments, authorize the user, separate instructions from untrusted content, and render provenance.
The model may propose an action; policy and code must decide whether that action is allowed.
Retrieval quality has two separate questions
Did the retriever return evidence that contains the answer? Did the generator use that evidence faithfully? Recall-oriented retrieval, reranking, chunk boundaries, metadata filters, and freshness affect the first. Citation entailment, abstention, and answer constraints affect the second. One end score can hide which half failed.
Instrument the pipeline at its boundaries so a wrong answer becomes a diagnosable failure.