How it works · 11 of 37 Advanced
What is agentic RAG?
The model decides when to look again
Agentic RAG: The model plans: search, read, notice what's missing, search again or use a tool, then answer.
Loading the animation…
Say it like this Agentic RAG lets the model look, read and check in a loop, searching again or using a tool until its notes actually answer the question.
Under the hood — for builders
- What changes from plain RAG
- Plain RAG searches once, with the question as typed, then answers from whatever came back. Agentic RAG puts the model in charge of a loop: it chooses what to search for, checks its notes and decides whether to go round again (an agent: a model that picks its own next step). The same question both ways:
- The paper's own example
- IRCoT (Trivedi et al.) asks “In what country was Lost Gravity manufactured?” Searching with the question finds the page on the Lost Gravity roller coaster, which doesn't say where it was made. The model first works out that it was made by a company called Mack Rides, then searches again using that name:
- Real impact
- IRCoT searched again after every reasoning step. Against searching once with the question, on four question sets that need several facts joined, using the open Flan-T5-XXL model. Answer F1 = how closely the answer's words match the right answer, out of 100:
- Teaching it when to look
- Self-RAG (Asai et al.) trains a model to write small signal words as it goes, so the decisions in this card's loop are part of its output (the paper: “reflection tokens”). Its four kinds:
- Typical cost
- More rounds mean more model calls. IRCoT calls the model once per reasoning sentence, stops when it writes “answer is” or after 8 steps, and keeps at most 15 pages. Then a separate model call writes the answer:
- Tools
- Search is one tool the model calls (see Tool calling, C2); a calculator, a database query or web search plug in the same way.
- Measure it
- Test with questions that need two or more facts. Check the answer, the number of rounds, and whether it stopped too early or went round for nothing.
- Watch out
- Cap the rounds (IRCoT: 8), or a model that is never satisfied loops forever. Every page it reads can carry hidden instructions (Prompt injection, E2).
- Sources
- Trivedi, Balasubramanian, Khot & Sabharwal, Interleaving Retrieval with Chain-of-Thought Reasoning for Knowledge-Intensive Multi-Step Questions (ACL 2023, arXiv 2212.10509v2) · Asai, Wu, Wang, Sil & Hajishirzi, Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection (arXiv 2310.11511).
What happens in the agentic RAG animation, step by step?
- One question, two numbers: this year's Q3 refunds and last year's. A single lookup brings back one page.
- Round 1: search, read, and note what was found. Now the model checks its notes against the question.
- Your turn to be the model: are these notes enough to answer the question? Tap Yes or No.
- Last year's number is missing, so the check says not enough and the model goes round again.
- Round 2: it searches again with a sharper query, finds last year's number, and uses a tool, a calculator, for the maths.
- Now the notes answer the question, so it stops looking. Deciding when to stop is part of the job.
- The answer gives the result, and both pages and the tool it came from.
What everyday example explains agentic RAG?
A researcher who keeps checking sources until the story holds.
Why should a team care about agentic RAG?
Where RAG meets agents (C3).