"Should we build an agent for this?" is the question I get asked most often these days. And the honest answer, more often than teams want to hear, is: probably not yet.
There is a strong pull right now to reach for agents for everything. They are the exciting part of the field, and it feels like building anything less is falling behind. But in production, the boring choice is usually the right one — and reaching for an agent when a retrieval pipeline would do is one of the most common and expensive mistakes I see teams make.
This post is the decision framework I actually use. When is plain RAG enough? When do you genuinely need an agent? And what does the sensible middle ground look like?
The Core Distinction
Strip away the jargon and the difference is simple.
RAG (Retrieval-Augmented Generation) is a single, mostly linear path: take the user's question, retrieve relevant context, stuff it into the prompt, generate an answer. One retrieval, one generation. Fast, cheap, predictable.
Agentic systems add a loop. The model plans, takes an action (call a tool, run a query, retrieve something), observes the result, and decides what to do next — repeating until it judges the task done. Multiple steps, dynamic control flow, and crucially, the number and order of steps is decided at runtime by the model, not by you.
That last point is the whole game. RAG is a pipeline you designed. An agent is a pipeline the model designs on the fly, every single time. That flexibility is powerful and it is also exactly what makes agents slower, more expensive, and harder to make reliable.
When RAG Is Enough (Which Is More Often Than You Think)
Reach for plain RAG when the shape of the task is knowable in advance. The signs:
- The answer lives in one lookup. "What is our refund policy?" "Summarize this contract." "What did the Q3 report say about margins?" One retrieval gets you what you need.
- The workflow is fixed. You know the steps ahead of time and they do not change based on intermediate results.
- Latency matters. A user waiting on a chat response will tolerate two seconds, not twenty. RAG answers in a single round trip.
- You need predictable cost. One retrieval plus one generation has a cost you can forecast. Agents do not.
The trap here is underestimating how far good RAG gets you. Most of the "we need an agent" requests I have reviewed were actually retrieval-quality problems in disguise — the answer was in the documents, the retrieval just was not surfacing it. Better chunking, a reranker, and query rewriting fixed far more than an agent would have, at a fraction of the cost.
Before you conclude RAG is not enough, make sure your RAG is actually good:
- Rewrite the query before retrieving — expand acronyms, add synonyms, resolve pronouns from the conversation.
- Add a reranker on top of vector search. This single change moved more of our accuracy numbers than almost anything else.
- Tune your chunking. Too small and you lose context; too big and you dilute relevance.
If you have not done these and you are already talking about agents, you are optimizing the wrong layer.
When You Genuinely Need an Agent
Agents earn their complexity when the task cannot be expressed as a fixed pipeline. The signs:
- The next step depends on the last one. You cannot write the workflow down in advance because it branches based on what the model finds.
- Multiple tools, chosen dynamically. "Compare our top 5 clients' revenue, flag anomalies, and draft a summary" needs a database query, a calculation, and a writing step — and which ones, in what order, depends on the data.
- Self-correction is valuable. The task benefits from the model noticing an intermediate result is wrong and retrying, rather than confidently returning garbage.
- Genuinely open-ended tasks. Research, multi-step analysis, code that has to run and be debugged.
The honest test I apply: can I draw the workflow as a flowchart before seeing the input? If yes, build the flowchart — that is RAG or a fixed chain, and it will be more reliable. If the flowchart genuinely has to be drawn at runtime based on what comes back, that is where an agent pays for itself.
The Middle Ground: Agentic RAG
The framing of "RAG vs agents" is a bit of a false binary. The most useful pattern in production sits between them, and it is worth naming: agentic RAG.
Instead of a single retrieve-then-generate pass, you give a lightweight agent control over the retrieval step specifically. It can:
- Decompose a complex question into sub-queries.
- Retrieve for each, then judge whether the results are actually relevant.
- Reformulate and retrieve again if they are not.
- Synthesize once it has enough.
This keeps the loop tightly scoped — the agent is only deciding how to search, not orchestrating arbitrary tools — so you get much of the robustness of an agent without the unbounded cost and latency. For complex research-style questions where a single retrieval reliably misses, this has been the highest-leverage pattern I have used. It is the first step up from plain RAG, and often the last one you need.
The Tradeoffs, Side by Side
| Dimension | Plain RAG | Agentic RAG | Full Agent |
|---|---|---|---|
| Latency | Low (1 round trip) | Medium | High (many round trips) |
| Cost per query | Low, predictable | Medium | High, variable |
| Reliability | High (fixed path) | High | Needs careful guardrails |
| Handles multi-step tasks | No | Retrieval only | Yes |
| Self-correction | No | For retrieval | Yes |
| Effort to build well | Low | Medium | High |
The column that people forget is the last one. A demo agent takes an afternoon. A reliable agent — with iteration limits, timeouts, error handling, and evaluation — takes weeks. Factor that in honestly.
A Decision Checklist
When a new use case lands on my desk, I run through this in order:
- Can the answer come from one retrieval? If yes → RAG. Stop here.
- Is my RAG actually good yet (query rewriting, reranking, sensible chunking)? If not → fix that before anything else.
- Does the task need several retrievals that depend on each other? If yes → agentic RAG.
- Does it need multiple different tools chosen dynamically, or self-correction across steps? Only now → a full agent.
- Whatever you build, can you measure it? If you cannot evaluate quality, you cannot safely ship either one.
Notice how far down the list "full agent" is. That ordering is deliberate, and it reflects what actually holds up in production.
If You Do Build an Agent, Guard It
The moment you accept the runtime-decided control flow of an agent, you take on its failure modes. The non-negotiables:
- Hard iteration limits. A confused agent will loop forever, burning tokens. Cap it.
- Timeouts on every tool call. One hanging query should not hang the whole session.
- Constrained, well-described tools. Most misrouted tool calls are documentation failures, not model failures — the description was not clear enough about when to use it.
- Evaluation from day one. You cannot improve, or safely deploy, what you cannot measure.
Key Takeaways
- RAG and agents are not competitors — they are different points on a complexity curve. Start at the cheap end and move up only when the task forces you to.
- Most "we need an agent" problems are retrieval-quality problems. Fix query rewriting, reranking, and chunking before adding a loop.
- Agentic RAG is the underrated middle ground — the robustness of a loop, scoped tightly to retrieval, without the unbounded cost of a full agent.
- The test is the flowchart: if you can draw the workflow before seeing the input, you do not need an agent.
- Agents are a real cost, not just a technical one — reliability, latency, and build effort all go up. Pay that price only when the task genuinely requires it.
The exciting choice and the correct choice are often not the same. Build the simplest thing that solves the problem, measure it honestly, and let the task — not the hype — tell you when it is time to add a loop.
