Lesson 05.08 · Phase 05 · Retrieval & Agentic RAG
Corrective RAG loops
Grade what retrieval returned before you generate from it. Refine it when it's good, search again when it's bad, try the next source when this one has nothing, and stop with "not found" when they all fail.
Learning objectives
- Implement a retrieval evaluator that grades retrieved chunks as correct, ambiguous or incorrect.
- Implement the corrective actions: knowledge refinement (drop superseded versions, keep relevant sentences), query rewriting, and falling back to another source.
- Build the loop with explicit budgets and a "not found" exit, and log every action.
- Set grading thresholds from cases, including a question the corpus can't answer.
Lesson 7 checked the answer. That catches a changed number, but if retrieval returned the wrong documents, the best a checked answer can be is "I couldn't verify that". The cheaper place to catch the problem is one step earlier: look at what came back before generating.
Loading the full lesson…