Retrieval
50%
Lesson 4 of 8

Retrieval

Retrieval selects the chunks most likely to contain evidence for the user’s question.

Active reading
Why this matters

Retrieval selects the chunks most likely to contain evidence for the user’s question.

Query

Represent what the user needs.

Candidates

Fetch several plausible chunks.

Context

Send only the best evidence onward.

Understand the working model

Good retrieval balances recall and precision. If you retrieve too little, you may miss the answer. If you retrieve too much, irrelevant text can distract the model and increase cost.

Inspect retrieval separately from answer generation. If the correct chunk never reaches the model, improving the final prompt cannot fix the real problem.

Example
Question → retrieve top 8 chunks → remove duplicates → keep the 4 strongest chunks → generate an answer with citations to those chunks.
Practice

Apply the pattern above to one real task you already do. Keep the first version small enough that you can inspect every input and output.

Common mistake

Do not judge a RAG system only by whether the final answer sounds good.

Key takeaway

Evaluate whether retrieval found the right evidence before evaluating the generated answer.

Next lesson

Reranking

Continue to the next lesson.

Continue →