RAG vs agentic retrieval in production
Use classic RAG when the evidence sits in one place; add an agent loop when it is spread across documents or needs tools. Most systems route between the two.
Use classic RAG when the evidence sits in one place; add an agent loop when it is spread across documents or needs tools. Most systems route between the two.
A chatbot answers; an agent plans steps and uses tools to do the work. Start read-only, add approvals for irreversible actions, enforce the user's permissions.
In-house generative search answers staff questions from your documents with citations, using RAG. How it works and how it differs from AI answer engines.
A recurring report. A slow review. A prototype that needs to work in the real world.
Use classic RAG when the evidence for a question sits in one place: search your documents once, hand the top passages to the model, and get a grounded answer back. Add an agent loop (where the model decides what to search for, reads what came back, and runs another search or tool call until it has enough to answer) when the evidence is scattered across documents, needs a calculation or lives in a second system.
Most production systems end up needing both. The trick is routing every question to the cheapest path that can actually answer it, and keeping tight guardrails on the loop so awkward questions don't burn through your latency and token budgets.
Key takeaways
The difference is control flow, not intelligence. Classic RAG is a fixed pipeline: embed the question, fetch the top passages, write the answer. Your code decides what happens, in what order, and it happens once: search followed by a summary.
Agentic retrieval hands some of those decisions to the model. Given a search tool (and often others: a SQL query, a document fetch, a calculator), the model chooses its next step from what it's seen so far. It can rewrite a query that came back thin, open the full document a passage came from, or cross-check a figure against a second source before committing to an answer.
Classic RAG is enough whenever one good search finds everything the answer needs. That covers a surprising share of real traffic: "what's our annual leave policy for part-time staff?", "which form do I use for a change of supplier bank details?", "what does clause 14 of the framework agreement say?". The evidence is a passage or two, the question points straight at it, and a wrong answer is easy to spot against the citation.
For those questions a loop adds cost and latency for very little accuracy. A single pass also has operational virtues that matter in production: latency stays predictable, cost per question is nearly fixed, and when something goes wrong the log shows the exact passages the model saw.
RAG rarely fails because the model is weak. It fails because the right evidence never made it into the prompt. Four patterns cover most of it:
The first two are retrieval problems you should fix in the pipeline before reaching for an agent. Hybrid search (keyword plus vector) with a reranker catches far more of the right passages, and prepending a line of document context to each chunk before embedding helps the retriever find passages that lost their heading. Anthropic reported that this "contextual retrieval", paired with reranking, cut failed top-20 retrievals by 67% on its test sets. The details are in our guide to embeddings and hybrid search. It's the last two causes that genuinely need a loop.
An agent loop gives the system three things a single pass can't do:
Current reasoning models handle this well. They plan across tool calls and decide when they've got enough, and most providers let you control how hard they think (an effort or reasoning effort setting). That dial is one of your cleanest cost levers: low effort for routine lookups, higher for genuine investigations.
From simplest to most tightly controlled:
Whichever route you pick, log it on every question. The split between paths, and how often an escalated question still fails, tells you where to invest next.
| Option | When to use | Trade-offs |
|---|---|---|
| Classic RAG | Questions are narrow, evidence sits in one place and latency is strict | Brittle when evidence is fragmented, cross-referenced or outside the documents |
| Agentic retrieval | Questions are multi-step, compare sources or need a system of record | Several times the tokens and latency; needs budgets, stop rules and logging |
| Routed hybrid | Most questions are simple but a meaningful minority need investigation | Routing logic to build, evaluate and monitor across both paths |
You pay for tokens, so count them. Here's a rough comparison in round numbers you can swap for your own:
| Classic RAG | Agent loop, four tool calls | |
|---|---|---|
| Model calls | 1 | 5 (one per step, plus the answer) |
| Input tokens | About 8,000: instructions, question and eight passages | About 50,000: each call re-sends the growing conversation |
| Output tokens | About 500 | About 2,000, plus any reasoning tokens |
| Latency | One model call plus one search | Five model calls plus four tool calls, in sequence |
Illustrative figures. Measure your own with the token counts each API returns.
A loop's cost grows faster than its step count because every call re-reads everything that came before it. Prompt caching takes the edge off: the instructions and earlier turns are a repeated prefix, so most providers bill them at a fraction of the normal input price from the second call onwards (see prompt caching explained). Even so, expect an agent path to cost several times a single pass, and judge it by cost per correct answer rather than cost per request.
Agent loop guardrails
Start with a well-built single pass: structure-aware chunking that keeps headings and tables intact, hybrid search with a reranker, citations on every claim and an evidence check before answering. Build a test set of real questions, including the awkward ones, and measure retrieval and answers separately.
Then look at the failures. If they cluster in questions that need a second document, a comparison or a figure from a system of record, add an agent path for those and route to it. Keep the budget tight, keep the logs, and re-run the test set whenever you change the model, the prompt or the index. If you're still weighing retrieval against training, read fine-tuning vs RAG first.
The Company Twin pairs permission-filtered document retrieval with live operational records, so assistants answer from current facts whether the evidence sits in one policy or across three systems. See how the Company Twin answers across systems →