RAG is a technique for grounding a model in external knowledge: retrieve relevant documents, add them to the prompt, generate an answer. An agent is a control structure: a loop where the model decides the next action. They are not the same kind of thing, so “RAG or an agent?” is a category error. The senior answer names the layer each operates at, picks the simplest thing that solves the task, and reaches for agentic RAG, an agent that decides when and what to retrieve, only when a single fixed retrieval is not enough.
That paragraph is the answer to most “RAG vs agents” interview questions. The rest of this post is why the question is a trap, the four mistakes candidates make answering it, what agentic RAG actually is, and the template for talking about it under pressure.
This is one of the distinctions covered in the Interview Bootcamp chapter of Designing Enterprise Agentic AI Systems.
Why the question is a trap
When an interviewer asks “would you use RAG or an agent here?”, they are usually not asking you to pick a winner. They are checking whether you know the two words describe different layers of a system. A candidate who answers “agents, because they are more powerful” has walked into the trap: they have treated a retrieval technique and a control structure as interchangeable options on the same menu.
The cleanest way to see it is by analogy. Asking “RAG or an agent?” is like asking “a database or a microservice?” One is a way of getting data into your process. The other is a way of structuring the process. You can have a microservice with a database, a microservice without one, or a database queried by something that is not a microservice at all. RAG and agents stack the same way. For the underlying distinction between a workflow and an agent that this rests on, see What Counts as Agentic AI, and What Does Not.
What RAG actually is
RAG, retrieval-augmented generation, is three steps: take the user’s query, retrieve the most relevant documents from a store, and put those documents in the prompt so the model answers from them instead of from memory alone. It exists to solve a specific problem: models hallucinate and go stale, and grounding the answer in retrieved source text reduces both.
By default, RAG is a workflow. The path is fixed: retrieve, then generate, every time, in that order. The model never decides to skip retrieval, retrieve again, or do something other than answer. You wrote that path. That is not a criticism. A fixed retrieve-then-answer pipeline is the right design for a huge number of real systems, and it is cheaper and more predictable than anything with a loop in it.
QUERY: "What is our refund window for enterprise plans?"RETRIEVE: top 3 chunks from the policy storeAUGMENT: prepend those chunks to the promptGENERATE: "Enterprise plans have a 30-day refund window..."One pass. No decision about whether to retrieve. That is classic RAG, and for a policy-lookup bot it is exactly enough.
What an agent actually is
An agent is a loop in which the model chooses the next action, takes it through a tool, observes the result, and decides again, repeating until the goal is met or a stop condition fires. The defining trait is that the model picks the steps at runtime instead of following a path you hardcoded.
An agent can retrieve, but retrieval is now one option among several, chosen when the model decides it is needed:
THOUGHT: I need the current refund policy before I can answer.ACTION: search_policy_docs("enterprise refund window")OBSERVATION: "Enterprise plans: 30-day refund window, see clause 4.2."THOUGHT: The user also asked to process a refund. That needs a different tool.ACTION: create_refund(account="acme", reason="within policy window")The agent retrieved, then acted. The retrieval was a decision, not a fixed prefix, and it was followed by an action that plain RAG could never take because plain RAG only generates text. The mechanics of how the model “calls a tool” like search_policy_docs are covered in Tool Calling From First Principles.
The four mistakes candidates make
Most weak answers to this question are one of these four.
Mistake 1: framing it as either/or. The candidate hears “RAG vs agents” and picks a side, usually agents, because they sound more advanced. This is the headline error. The two are not alternatives, and a senior interviewer is specifically listening for whether you reframe before you answer. The strong move is to say “those operate at different layers” in the first sentence.
Mistake 2: calling a static RAG pipeline agentic. The candidate describes a fixed retrieve-then-generate system and calls it “an agent” because it uses an LLM and fetches data. It is not. If the model never decides to retrieve, never retrieves again based on what it found, and never chooses a different action, there is no agency in the system. Labeling a workflow an agent signals you do not know where the line is. The line is whether the model chooses the next step.
Mistake 3: reaching for an agent when plain RAG solves it. The candidate designs a multi-step agent loop for what is, in truth, a documentation Q and A bot. This is over-engineering, and it is expensive: a loop costs more tokens, adds latency, and introduces failure modes (runaway loops, wrong tool calls) that a single retrieval pass does not have. The senior instinct is to default to the simplest thing that works and add agency only when you can name the case that requires it.
Mistake 4: reaching for RAG when the task needs action, not knowledge. The mirror-image error. The candidate proposes RAG for a problem whose core is doing something (issuing a refund, opening a ticket, reconciling two systems), not knowing something. Retrieval grounds an answer; it does not take an action. If the task’s hard part is acting in the world, no amount of better retrieval addresses it, and you need tools and a loop.
The two failures interviewers weight most are Mistake 1 and Mistake 2, because both reveal a candidate who has memorized the buzzwords without understanding what they name.
Agentic RAG: the synthesis
Once you see that RAG is a technique and an agent is a structure, the combination is obvious: let the agent decide when and what to retrieve. That is agentic RAG, and it is what most serious production question-answering systems actually are.
In agentic RAG, retrieval is a tool inside the loop rather than a fixed first step. The agent can:
- decide whether retrieval is even needed for this query,
- choose the search query itself, and refine it,
- judge whether the retrieved chunks were good enough,
- retrieve again with a better query if they were not,
- and combine retrieval with other tools and actions.
THOUGHT: Vague question. Let me search broadly first.ACTION: search_docs("refund")OBSERVATION: 12 chunks, mostly about consumer plans.THOUGHT: Not specific enough. The user said "enterprise." Refine.ACTION: search_docs("enterprise plan refund window clause")OBSERVATION: clause 4.2, enterprise refund window 30 days.THOUGHT: Good. Now I can answer.That retry loop is the difference between static RAG and agentic RAG. Static RAG would have answered from the first, weaker set of chunks. The agent noticed they were off-target and retrieved again. That single behavior, deciding the first retrieval was not good enough, is the cleanest one-line example of what agency adds to retrieval.
The cost is real: each extra retrieval is another model turn and more tokens. So agentic RAG earns its keep when queries are varied, ambiguous, or multi-hop, and is overkill when they are uniform and a single retrieval reliably lands.
How to actually answer in the interview
When you hear “RAG or agents for this?”, run this template:
- Name the layer. “Those operate at different layers. RAG is how the system gets grounding knowledge; an agent is whether the model drives its own steps. So it is usually a question of how much agency the retrieval needs, not one or the other.”
- Name the task class. “If this is answering questions over a fixed corpus, I would start with plain RAG: retrieve, then generate. Cheaper, faster, easy to debug.”
- Pick the simplest thing that works. “I would only add an agent loop if the task needs to retrieve iteratively, act on what it finds, or use other tools. Adding a loop has a real cost in tokens, latency, and failure modes, so I want a reason.”
- Mention agentic RAG as the bridge. “If it does need that, the retrieval becomes one tool the agent calls inside the loop. That is agentic RAG, and it is what most production QA systems converge on.”
Naming the task before the technique is the move. It is the same instinct that separates strong answers across the whole interview, which is why the agentic AI interview questions that look like trivia are usually testing judgment about when to reach for complexity, not recall of definitions.
The takeaway
RAG and agents are not rivals. RAG is a retrieval technique; an agent is a control loop. You can have RAG without an agent (a fixed pipeline, often the right call), an agent without RAG (a system that acts but does not need external knowledge), or both together as agentic RAG, where the agent decides when and what to retrieve. The candidates who get this question wrong treat the two as a single either/or choice. The candidates who get it right name the layers, default to the simplest design, and add agency to retrieval only when the task genuinely needs it.
That judgment, knowing when complexity earns its cost, is the spine of the whole field. It is what the Interview Bootcamp chapter of Designing Enterprise Agentic AI Systems is built to train.
Frequently asked
Quick answers
- Is RAG or an agent better?
- Neither, because they are not the same kind of thing. RAG is a technique for grounding a model in external knowledge: retrieve relevant documents, add them to the prompt, generate an answer. An agent is a control structure: a loop where the model decides the next action. The question "RAG or an agent?" is a category error, like asking "a database or a microservice?" The senior answer names the layer each operates at and then picks the simplest thing that solves the task.
- What is agentic RAG?
- Agentic RAG is retrieval used as a tool the agent decides to call, rather than a fixed step that always runs. Instead of always retrieving once before answering, the agent decides whether to retrieve at all, what query to issue, whether the results were good enough, and whether to retrieve again with a refined query. The retrieval becomes one action inside the agent loop instead of a hardcoded prefix. It is the synthesis of the two ideas, not a third competing one.
- When should I use plain RAG instead of an agent?
- Use plain RAG when the task is "answer a question from a known body of documents" and a single retrieve-then-answer pass is reliably good enough. A support knowledge base, a documentation Q and A, an internal policy lookup. If you cannot name a case where the system needs to retrieve again based on what it found, or take an action beyond answering, you do not need an agent yet. Plain RAG is cheaper, faster, and easier to debug, and reaching for an agent over it is the most common over-engineering mistake.
- Is a RAG pipeline agentic?
- Not by itself. A fixed retrieve-then-generate sequence is a workflow: you wrote the path, and the model never chooses to do anything other than answer with what it was handed. It becomes agentic only when the model decides whether and what to retrieve, can retrieve again based on the result, or can choose a different action instead. Calling a static RAG pipeline "an agent" in an interview is one of the fastest ways to signal you do not understand the distinction.
- How do I answer "would you use RAG or agents for this?" in an interview?
- Reframe before you answer. Say that they operate at different layers, so it is usually both or a question of how much agency the retrieval needs. Then name the task class: if it is question answering over a fixed corpus, start with plain RAG; if the system needs to retrieve iteratively, act on what it finds, or use other tools, that is where the agent loop earns its cost, and the retrieval becomes one tool inside it. Naming the task before the technique is the move interviewers are listening for.
- Does an agent replace the need for RAG?
- No. An agent that needs external knowledge still retrieves it, usually through a retrieval tool. The agent adds the decision of when and how to retrieve; it does not remove the retrieval. Most production agents that answer questions are doing retrieval inside the loop, which is exactly agentic RAG. The two ideas stack; one does not cancel the other.