Posts

Showing posts from October, 2026

Day 5: Agentic RAG: Query Routing, Self-Reflection, and Corrective RAG (CRAG)

Image
Production RAG Masterclass · Day 5 of 7 A linear pipeline assumes the first retrieval was good enough. Production questions often need a second look, a different tool, or an honest “we do not have evidence.” Figure 1. Plan, retrieve, critique, then answer — or try again. Thesis Static, single-shot retrieval fails when a system must verify sources or gather multi-step evidence. Move from a pipeline to a bounded loop. From pipeline to loop Classic RAG: query → retrieve → generate → done . Agentic RAG: plan → route → retrieve → critique → (retry | answer) with a hard stop on iterations. Figure 2. Cap loops so latency stays predictable. Query routing Not every question belongs in the vector DB: Vector index — policies, runbooks, wiki. SQL / warehouse — metrics, counts, “how many…”. External API — live status, tickets, prices. Graph — multi-hop entity questions (Day 4). route = llm_json(f"""Choose tools for this question. Options: ...