Agentic RAG: Smarter Retrieval with Predictable Costs
agentic RAG is an AI assistant that decides how to look things up, instead of running one fixed search. It answers harder, multi-part questions. Built carelessly it is slow and expensive; built with limits it costs a predictable amount per answer.
The short answer: agentic RAG adds a planning loop on top of retrieval. The agent splits a question into parts, chooses a source for each (documents, a database, a tool), checks whether the evidence is enough, searches again if not, and stops. Use it only for questions that need it, route simple lookups down a fast path, cap the number of rounds and the spend per answer, and measure it on a golden set like any other agent.
Our guide to hybrid RAG covers the foundation: keyword and meaning search side by side, re-ranked and permission-checked. This post covers the next step, when the assistant must plan its own retrieval. It sits in our Agent Engineering work. If you are deciding between index types, see GraphRAG vs hybrid RAG instead.
What is the difference between RAG and agentic RAG?
| Standard RAG | Agentic RAG | |
|---|---|---|
| Searches | One, fixed | Several, chosen by the agent |
| Sources | One index | Documents, databases, tools |
| Multi-part questions | Often half-answered | Split and answered part by part |
| Self-check | Optional | Built into the loop |
| Cost per answer | Low and steady | Higher; must be capped |
When is plain hybrid RAG enough?
Most questions are single lookups: “What is our refund window?”, “Which plan includes phone support?” Hybrid RAG answers these fast and cheaply. Reach for agentic RAG only when questions:
- have several parts (“Which of our two warehouses ships faster to Berlin, and what does it cost?”);
- need numbers from a database as well as text from documents;
- depend on a chain (“Which suppliers are affected by the clause we changed last month?”);
- regularly come back half-answered in your test set.
How does the agentic RAG loop work?
- Route. A small, fast model decides: simple lookup or multi-step question?
- Plan. For complex questions, split into sub-questions and pick a source for each.
- Retrieve. Documents through hybrid search; numbers through a text-to-SQL agent on a semantic layer; live data through tools, often exposed with MCP.
- Check. Is there enough evidence for every part? If not, rewrite the search and try again, up to the round limit.
- Answer. Cite every claim. If a part can’t be answered, say so plainly rather than guess, as in our guide to preventing hallucinations.
How do you keep agentic RAG costs predictable?
- Route most questions to the fast path. The cheapest search is the one you never run.
- Cap the rounds. Two or three search rounds cover most real questions; beyond that, answer with what you have or hand over.
- Use the right model per step. A small model for routing and planning, the strongest model only for the final answer.
- Cap spend per answer. A gateway stops any answer that exceeds its budget.
- Cache repeated sub-questions. Many users ask the same parts in different words.
The result is a cost per answer you can forecast, which is what founders need before rollout.
Which guardrails matter most?
- Permissions travel with every search, across documents, databases and tools. The agent must never see more than the user could.
- Retrieved text is data, not instructions, so a document can’t redirect the agent.
- Every step is traced: the plan, each search, each source and the final citations.
How do you evaluate it?
On a fixed set of real questions, track:
- retrieval recall: did the right passages and records come back?
- answer completeness: were all parts of the question answered?
- groundedness: is every claim backed by a cited source?
- correct refusals: did it say “I don’t know” when it should?
- cost and time per answer, on the fast path and the loop separately.
Re-run the set on every change. Our guide to testing AI agents shows how.
Common mistakes
- Sending every question through the full loop.
- No round limit or spend cap.
- Using the strongest model for routing.
- Checking permissions in the documents but not in SQL or tools.
- Measuring with a demo instead of real questions.
How SHVX can help
Assistant giving half-answers to multi-part questions? Send 50 questions your users ask. We’ll show where your retrieval fails and what an agent loop would add, with the cost per answer.
Learn more about Agent Engineering.
FAQ
What is agentic RAG?
A retrieval set-up with a planning loop: the agent breaks a question into parts, looks each one up in the right source and searches again until the evidence covers every part, within a set number of rounds.
Is agentic RAG better than RAG?
For multi-part and chained questions, yes. For simple lookups, standard hybrid RAG is faster and cheaper, so route between them.
How do you control the cost of agentic RAG?
Route simple questions to a fast path, cap search rounds, use small models for routing, and set a spend cap per answer.
Do I need GraphRAG for agentic RAG?
No. An agent can plan over hybrid search, SQL and tools. Add a graph only when questions depend on connections between many entities.