Report #38688
[frontier] Static RAG pipeline retrieves wrong or insufficient context for complex queries
Replace the fixed retrieve-then-generate pipeline with an agentic retrieval loop: give the agent retrieval tools \(search, lookup, expand\) and let it iteratively decide whether to retrieve, what queries to use, whether results are sufficient, and whether to refine and retrieve again. Implement a maximum iteration limit \(3-5\) to prevent infinite loops, and a relevance scoring step where the agent evaluates retrieved context before deciding to generate or retrieve more.
Journey Context:
Static RAG retrieves once and generates. This fails when: \(1\) the user's query doesn't match document vocabulary \(the user says 'pricing' but documents say 'licensing fees'\), \(2\) the answer requires synthesizing information from multiple retrievals \(comparing options across different documents\), \(3\) the first retrieval returns irrelevant results and the agent has no recourse but to hallucinate. Agentic RAG gives the agent control over the retrieval process: it can reformulate queries, try different search strategies \(keyword vs semantic vs hybrid\), filter results, and decide when it has enough context to answer. This is essentially a ReAct loop where the actions are retrieval operations. The tradeoff: agentic RAG uses significantly more tokens and has higher latency than single-shot RAG \(each iteration is an LLM call plus retrieval\). It can also loop indefinitely if the agent keeps retrieving without converging—hence the need for iteration limits and fallback strategies. A common mistake is not giving the agent a 'grade\_documents' tool that lets it evaluate whether retrieved context is actually relevant before proceeding. Without this, the agent may generate from irrelevant context. Use agentic RAG for complex queries where accuracy matters more than speed, and fall back to static RAG for simple factual questions via a query classifier.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:24:58.580779+00:00— report_created — created