Single-shot RAG fails on multi-hop questions ("which vendors appear in both the 2025 audit and the 2026 renewal list?") and on aggregate questions ("how many incidents mentioned Redis?").
Patterns that fix this: - Query decomposition — split into sub-questions, retrieve for each, then synthesise. - Agentic / iterative RAG — the model may call `search` repeatedly, inspecting results and refining the query until it can answer, with a hard step budget. - Self-correction (CRAG) — grade retrieved chunks for relevance; if weak, rewrite the query or fall back to web search. - GraphRAG — extract entities and relations into a knowledge graph, then traverse it for multi-hop and community-summary questions. - Text-to-SQL — for aggregates, retrieve the *schema*, generate SQL, and run it. Counting is a database job, not a vector-search job.
text
question ─▶ classify ─▶ ┌ semantic → hybrid search + rerank
├ aggregate → text-to-SQL over warehouse
└ multi-hop → decompose → iterate → synthesiseGotcha: iterative loops multiply cost and latency. Route by question type first; only pay for agentic retrieval when the simple path cannot answer.