- 01Classic RAG retrieves once and answers. Agentic RAG makes retrieval a decision the model owns and can repeat.
- 02The upgrade is a loop: search, judge the result, reformulate, choose a source, or stop.
- 03It helps when one retrieval reliably misses — multi-source questions, query-wording mismatches, judgement calls.
- 04It does not fix a weak index. Retrying against bad chunks amplifies the cost of failing.
- 05Failures compound instead of terminating, and cost multiplies. Bound the loop, or it runs until the budget does.
Note.The taxonomy here draws on the published survey of agentic RAG and on the workflow-versus-agent framing in Anthropic’s engineering writing. The analysis of when the loop pays and where it fails is ours, and the code is illustrative rather than a library.
What agentic RAG is
The name is doing a lot of work and it helps to unpack it. “RAG” is the base: retrieve some text, put it in the context, generate an answer grounded in it. “Agentic” changes one thing — who decides how the retrieval goes. In classic RAG that is a fixed pipeline you wrote. In agentic RAG it is the model, at runtime.
- Agentic RAG
- Retrieval where the number of searches, the queries used, and the sources consulted are chosen by the model during the task, rather than fixed in advance. It is the workflow-to-agent transition applied specifically to the retrieval step: the retrieval path is no longer enumerable before the run.
Versus classic RAG
| Classic RAG | Agentic RAG | |
|---|---|---|
| Retrieval count | One, fixed | As many as the model decides |
| Query | The user's question, embedded | Reformulated by the model, possibly several |
| Sources | One index | Chosen among several at runtime |
| Stops when | Always after one retrieval | The model judges it has enough |
| Cost | Bounded, known | Variable, grows with the loop |
| Testable | Yes — fixed path | Harder — path varies per question |
“Classic RAG asks one question and lives with the answer. Agentic RAG asks, checks, and asks again — which is exactly why it costs more and fails more interestingly.”
The retrieval loop
answer = null
rounds = 0
gathered = []
while answer is null and rounds < MAX_ROUNDS:
query = model.formulate_query(question, gathered) # what to search for now
results = retrieve(query) # possibly a chosen source
gathered += results
verdict = model.evaluate(question, gathered) # ← the agentic step
if verdict.sufficient:
answer = model.answer(question, gathered)
elif verdict.no_new_information:
break # stop; the well is dry
rounds += 1
# Always return SOMETHING, with a confidence signal — never loop forever.
return answer or model.best_effort(question, gathered, uncertain=True)The no_new_information exit is the one people forget, and it is what separates a loop that converges from one that thrashes. A model told only to stop when satisfied will, on a question the corpus cannot answer, keep reformulating forever — each round returning the same unhelpful chunks, each round costing a model call. Detecting that a round added nothing is the difference between graceful failure and an unbounded bill.
When the loop earns its cost
| Question | Classic RAG | Why agentic helps (or doesn't) |
|---|---|---|
| "What is our refund policy?" | Sufficient | One retrieval finds the policy. The loop adds nothing |
| "Compare our policy to what we told this customer" | Misses | Two sources — policy and the conversation. Agentic combines them |
| "Why was this order delayed?" | Misses | The right query is about the shipment, not the words asked |
| "Summarise everything about account X" | Partial | Needs several retrievals across record types; agentic iterates |
The honest test before adopting it: run classic RAG on a representative sample and measure how often one retrieval was enough. If the answer is “usually”, the loop is solving a problem you do not have, at a cost you will notice. Agentic RAG is an answer to a demonstrated single-retrieval failure rate, not a default upgrade.
Failures compound instead of terminating
This is the failure mode specific to putting a loop around retrieval, and it is worth understanding because it is counter-intuitive: the mechanism added to improve robustness introduces a way to get systematically worse.
Q: "Why did invoice 4021 bounce?"
Round 1: query "invoice 4021 bounce"
→ retrieves a doc about EMAIL bounces (wrong 'bounce')
Round 2: model now believes this is about email deliverability
→ query "invoice 4021 email delivery failure"
→ retrieves more email-infrastructure docs
Round 3: confidently answers about SPF records
→ the actual cause (a failed PAYMENT) was never searched for
Classic RAG would have retrieved the payment record in round 1's
top-k and, even if it also surfaced the email doc, generated once
from both. The loop's 'improvement' walked it away from the answer.The mitigations are specific. Keep the original question in context every round so the model can notice drift. Retrieve a fresh independent result set each round rather than only refining the last query. And have the evaluation step check results against the question, not against the previous results — otherwise it grades consistency, which a wrong path has plenty of.
The cost multiplier
The arithmetic compounds with the context-growth effect. Each round adds its retrieved chunks to the window, so the model calls get more expensive as the loop continues — the third evaluation reasons over everything the first two gathered.
| Classic RAG | Agentic RAG, 3 rounds | |
|---|---|---|
| Retrievals | 1 | 3 |
| Model calls | 1 (generate) | ~4 (formulate ×3, evaluate ×3, answer) |
| Context per call | Question + k chunks | Grows each round with accumulated chunks |
| Latency | One round trip | Serial rounds — the user waits for each |
Latency is the cost users feel. Retrieval rounds are serial by nature — you cannot formulate round two’s query until round one’s results are in — so a loop that helps accuracy can hurt the experience enough to matter. For a voice agent this is often disqualifying; for an asynchronous research task it is fine. The right choice depends on whether anyone is waiting.
It cannot fix bad chunking
This is the most important limitation to state because it is the most common misdiagnosis. A team sees poor answers, concludes the retrieval needs to be smarter, and reaches for agentic RAG — when the real problem is upstream, in how documents were split, and no amount of iteration recovers an answer from chunks that never represented it.
The diagnostic is the same one that applies to retrieval generally: take twenty real questions and read the retrieved chunks by hand. If the right passage is present but ranked low, agentic RAG’s reformulation might help. If the right passage is absent from the index entirely, the loop cannot conjure it, and your effort belongs upstream — see choosing the data layer for why recall is a chunking problem first.
Bounding the loop
| Bound | What it prevents |
|---|---|
| Max rounds (e.g. 4) | Runaway loops on questions the corpus cannot answer |
| Stop when a round adds nothing new | Thrashing — re-retrieving the same unhelpful chunks |
| Best-effort fallback with uncertainty | A confident wrong answer, or an infinite search |
| Per-question cost ceiling | One expensive question consuming a run's whole budget |
The fallback deserves emphasis because it changes what failure looks like. Without it, a loop that cannot find the answer either spins or invents one. With it, the loop terminates and says “here is what I found, and I am not confident” — which is a response a downstream system can route to a human. That is the difference between a research tool and a liability.
The through-line: agentic RAG is a real improvement for a real class of questions, and a costly ceremony for the rest. Adopt it because you measured a single-retrieval failure rate you cannot live with, bound it so its failure mode is graceful, and fix your chunking first — because the loop is an amplifier, and an amplifier on a weak signal just gives you louder noise. The broader question of when a loop belongs anywhere is workflow versus agent, and retrieval is one more place to ask it.
Frequently asked questions
What is agentic RAG?
Agentic RAG is retrieval-augmented generation where a language model controls the retrieval process rather than retrieving once at the start. The model decides what to search for, evaluates whether the results answer the question, reformulates the query if not, and can consult multiple sources — turning a single fixed retrieval into an adaptive loop.
How is agentic RAG different from traditional RAG?
Traditional RAG runs a fixed pipeline: embed the question, retrieve the nearest chunks, and generate an answer from them, once. Agentic RAG makes retrieval a decision the model owns — it can search again with a better query, choose among several sources, or decide it has enough. The difference is who controls the retrieval, and how many times it happens.
When should I use agentic RAG instead of classic RAG?
When a single retrieval reliably fails to get everything the answer needs: questions that require combining several sources, queries where the right search terms differ from the user's wording, or corpora where relevance needs a judgement the embedding cannot make. If one retrieval usually suffices, the loop only adds cost and latency.
Does agentic RAG improve retrieval quality?
It can, by letting the model retry and refine, but it does not fix the underlying retrieval. If the corpus is badly chunked or the embeddings are poor, agentic RAG retries against the same weak index and mostly amplifies the cost of failing. The loop improves recall when the information exists to be found, not when the index cannot surface it.
What are the downsides of agentic RAG?
Cost and latency multiply because retrieval runs several times with model calls between, and failures compound rather than terminating — a wrong early retrieval leads the model to reason toward a worse query rather than stopping. It also makes behaviour harder to test, since the same question can take different retrieval paths.
How do you stop an agentic RAG loop running forever?
Bound it explicitly: a maximum number of retrieval rounds, a rule that the loop stops when a round adds no new information, and a fallback that returns the best answer so far with a note about uncertainty rather than searching indefinitely. An unbounded retrieval loop is the most common way agentic RAG becomes expensive with nothing to show.
Sources
- 01Agentic Retrieval-Augmented Generation: a survey — Singh et al., 2025
- 02Building effective agents — Anthropic, 2024