RAG
A fixed pipeline: embed the question, fetch the nearest passages from one index, put them in the prompt, generate.
- One search per question
- One index, one search method
- Whatever comes back is used
- Cheap, fast, predictable
Classic RAG retrieves once for every question. Agentic RAG lets an agent choose whether to search, where, which way — and whether the result is good enough.
Retrieval augmented generation gives a language model passages from your documents so it answers from them instead of from memory. This guide shows how the classic pipeline works, the loop an agent adds on top, the five years of research between them, a worked trace of one question, and how to tell when the extra steps are worth their cost.
Updated · 7 sources
A fixed pipeline: embed the question, fetch the nearest passages from one index, put them in the prompt, generate.
An agent runs retrieval as a set of tools: it plans, picks a source and a method, grades what it found and searches again when the passages fall short.
In classic RAG, a fixed pipeline retrieves passages once for every question and hands them to the model. In agentic RAG, an AI agent runs retrieval as tools: it decides whether a question needs sources, which source and search method to use, checks whether the passages answer the question, and searches again or says so when they do not. Agentic RAG vs RAG is the difference between a single lookup and a research loop.
The 2020 paper that named retrieval augmented generation paired a language model’s built-in (parametric) memory with an external (non-parametric) memory: a dense vector index of Wikipedia, searched by a neural retriever. Production RAG still follows that shape.
Documents are cut into passages of a few hundred words.
Each passage becomes a vector with an embedding model.
Vectors go into an index built for nearest-neighbour search.
At question time, the same model embeds the user’s words.
The k nearest passages are returned — relevant or not.
Passages and question go into one prompt; the model answers.
Naive, advanced, modular. A widely cited 2023 survey sorts RAG systems into three paradigms: naive RAG (the six steps here), advanced RAG (adds query rewriting and re-ranking around retrieval) and modular RAG (swappable modules, including routing and iteration). Agentic RAG hands the control of those modules to an agent.
An agentic RAG system gives the model search tools and lets it reason between calls. The loop below runs until the agent has enough evidence or decides the sources do not cover the question.
Passages fall short: rewrite the query, try another source or method, and go round again.
plan → two sub-questions: (1) late EU deliveries, (2) penalty clauses
route (1) → deliveries table, not the document index
query (1) → region = EU AND delivered_after_due AND quarter = Q3
← 3 suppliers
route (2) → contracts library, filtered to those 3 suppliers
search(2) → by meaning: "late delivery penalty liquidated damages"
grade → 2 of 3 contracts answered; the third returned a
general terms page
retry (2) → by exact words: "late delivery" in supplier 3's contract
← clause 9.2 found
answer → 3 suppliers, each penalty clause cited to its pageWhat classic RAG would have done. Embedded the whole question once, fetched passages about deliveries and penalties from the contracts index, and never consulted the deliveries table — the only place “late last quarter” is recorded.
Agentic RAG is a convergence of ideas rather than one invention: retrieval as memory, reasoning interleaved with action, models that judge their own evidence, and graph-shaped knowledge.
The 2025 survey groups agentic RAG designs by four agentic patterns — reflection, planning, tool use and multi-agent collaboration. In a working system they show up as the parts below.
Every grading step and retry is another model call, so agentic RAG costs more and answers more slowly. It earns that back on questions that span sources or need more than one hop.
Botminds agents answer from your libraries, documents, records and the web. Each one decides per question whether to search, where and which way — and every search runs under the asking person’s permissions.
By meaning, by exact words, by label, by document or page, page and document summaries, records counted in the database, chat files and the web — often several for one answer.
A search whose passages probably do not answer the question comes back with a note, so the agent searches again or says so.
Choose to have the agent answer from its sources alone, and say plainly when they do not cover a question.
The workspace, the libraries the agent was given, its view and the asker’s read rules apply inside every search.
The agent marks the passages it relied on; those are the sources shown, each with its document and page.
A failed search says it failed, and a library still indexing says how much of it is ready.
Read the full design in agentic RAG, and build one in the Academy lesson the search pattern.
In agentic RAG vs RAG, classic RAG searches once and answers from whatever came back. Agentic RAG puts an agent in charge of the search: it can skip it, run several, pick different sources and methods, and check the results before answering.
For questions that span several sources or need more than one search, usually yes. For short factual lookups over one library, classic RAG is faster and cheaper and often just as accurate. Measure both on your own question set.
Naive RAG is the basic pipeline: chunk, embed and index documents, then for each question embed it, fetch the top-k nearest passages and generate an answer. Advanced RAG adds query rewriting and re-ranking; modular RAG makes each stage a swappable module.
They answer different questions. Graph RAG changes how knowledge is stored — an entity graph and community summaries — so whole-corpus questions can be answered. Agentic RAG changes who controls retrieval. An agent can use a graph as one of its tools.
Both add self-checking. Self-RAG (2023) trains a model to retrieve only when needed and to critique passages and its own output. Corrective RAG (2024) scores the retrieved documents with a small evaluator: documents it judges correct are refined to their key strips, incorrect ones are replaced by a web search, and when it is unsure it combines both.
Yes, per question. Planning, grading and retries each add a model call. The cost is worth it where an answer from the wrong source, or with no evidence behind it, costs more than a few seconds and a few cents.
Agentic RAG is one use of agentic AI: an agent whose tools are searches. Agentic AI in general also covers agents that take actions — updating records, sending messages, running workflows.
Yes. Botminds agents decide per question whether and where to search, pick from more than two dozen ways to search, check coverage, run every search under the asker’s permissions and cite the passages they used. See agentic RAG.
Bring one process and its documents. We’ll show you the agents, the controls and the record, running on your data.