Skip to content

Research · Retrieval · Agents

How agentic RAG works.

Updated

Agentic RAG puts an AI agent in charge of retrieval. Instead of one search and one answer, the agent plans the task, chooses which sources and tools to use, checks whether what it found is enough, and tries again if not. Colidal builds agentic RAG for questions that take several steps to answer.

plan = on · tools = chosen per task · check = before answering

Agentic RAG is retrieval-augmented generation in which an AI agent decides what to retrieve, from which source, and whether the results are good enough, repeating the search until they are.

How it works

A loop, not a line.

Ordinary RAG runs once: search, then answer. An agent treats retrieval as a tool it can use as many times, and in as many places, as the task needs.

  1. The task arrives at the planning agent, which may also read memory of earlier turns.
  2. The agent selects tools and sources: a vector database, documents, a knowledge graph, web search, APIs, or MCP tools.
  3. The tools return results.
  4. A result check asks whether the results are sufficient.
  5. If not, the agent refines the plan and retries.
  6. If so, the generative model synthesizes the answer, with sources.
How agentic RAG answers: a planning agent receives the task, chooses which tools and sources to use, and checks whether the results are sufficient. If not, it refines the plan and tries again. If so, the model writes the answer with its sources.

The loop

What the agent does

  1. 01

    Reads the task and plans.

    It breaks the task into steps and decides what it needs to know. It can also read memory of earlier turns.

  2. 02

    Selects tools and sources.

    A vector database, a knowledge graph, web search, one of your systems through an API, or an MCP tool.

  3. 03

    Reads the results.

    Each tool returns what it found, and the agent adds it to what it knows.

  4. 04

    Checks: is this sufficient?

    If something is missing or contradictory, it refines the plan and searches again.

  5. 05

    Synthesizes the answer.

    Once the results are sufficient, the model writes the answer with its sources.

Example

One task, start to finish

Task: "Compare this quarter's returns with our policy and draft a reply to the retailer." The agent needs a document and a live system, and notices on its own that the first search was not enough.

Example

The parts

What an agentic RAG system is made of.

The model is one part. The rest decides whether it can be trusted with real work.

agent

The planner

An LLM that reasons about the task, decides the next action, and reassesses after every result.

tools

The things it can use

Each tool has a description that tells the agent when to call it. Retrieval is one tool among several.

memory

What it remembers

Earlier turns and earlier results, so a follow-up question does not start from zero.

check

The result check

A step that asks whether the evidence answers the question, before anything is written.

Inside the loop

How an agent decides what to do next.

The loop is simple to draw and easy to get wrong. These are the details that decide whether it holds up.

reasoning

Thought, action, observation

The agent writes what it needs, names a tool and its input, then reads the result. That cycle repeats until it can give a final answer.

routing

Descriptions do the routing

Each tool carries a description of when to use it. The agent picks a tool by reading them, so a vague description means a wrong choice.

no retrieval

Knowing when not to search

A question the model can answer directly should skip retrieval. Searching for everything wastes time and adds noise.

structure

Actions as structured data

Tool calls are emitted in a strict format, not prose. A malformed call has to be caught and retried, never acted on.

determinism

Settings that reduce invention

Low randomness and clear stopping points keep the agent from writing a tool result it never received.

scratchpad

A working record

Every thought, call, and result so far is carried into the next step, alongside the question and the conversation.

knowledge

Only as good as its sources

An agent cannot retrieve what the knowledge base does not hold. Scope and freshness set the ceiling.

multi-agent

Several agents, one task

A large task can be split among agents that each have their own tools, with one coordinating the rest.

Fit

When agentic RAG fits, and when it doesn't.

Use it when

  • The task takes several steps, and later steps depend on earlier results.
  • The answer lives in more than one place: documents, a database, a live system.
  • Some questions need no retrieval at all, and the system should know which.
  • A wrong first search should be caught and corrected, not answered from.

Skip it when

  • One search answers the question. RAG is faster, cheaper, and easier to test.
  • Answers must arrive in under a second. Every loop adds model calls.
  • There is no way to check its work. An agent without tests and logs is a risk.
  • The agent would act on systems nobody has approved it to touch.

Compare

RAG, GraphRAG, or agentic RAG?

They are not rivals. Most systems start with RAG, and add a graph or an agent only where the questions need one.

RAGGraphRAGAgentic RAG
What it retrievesPassages that match the questionConnected facts, and summaries of whole topicsWhatever the agent decides the task needs
A question it suitsWhat does the returns policy say about opened items?Which suppliers are linked to the late orders this year?Compare this month's returns with the policy and draft a reply.
Built before any questionChunks, embeddings, a keyword indexAll of that, plus a knowledge graph and community summariesNothing new: it uses the other indexes as tools
Cost to set upLowestHighest: an LLM reads every chunkMedium: tools, checks, and tests
Cost per answerLowest: one search, one model callLow for specific questions, higher for broad onesHighest: several model calls per task
How it shows its workThe passage and page it usedThe path it followed through the graphEvery step, tool call, and source
Start here whenThe answer is written down in one placeThe answer is spread across many connected documentsThe answer takes several steps or several systems

How Colidal builds it

An agent inside a harness, at a level you set.

Colidal builds agentic RAG inside a custom AI harness: the tools the agent may call, the context it gets, the guardrails, the tests, and the logs. The agent is only as free as its measured results allow.

  • Tools designed for the agent. Each tool does one thing, with clear limits on what it can read and change.
  • Retrieval it can trust. The RAG engine and the knowledge graph are tools the agent calls, with sources on every result.
  • A level on every workflow. It starts by suggesting. It acts on its own only after measured results and your written approval.
  • Every step logged. Each plan, tool call, and check is recorded and can be replayed.
  • Sanitized both ways. Sensitive data is masked on the way in, and the output is checked on the way out.

Used in: Repeat questions · Approvals · Connect to AI · colidal/harness

FAQ

Common questions.

What is agentic RAG, in one sentence?

Agentic RAG is retrieval-augmented generation in which an AI agent decides what to look up, where, and whether it has found enough, before it answers.

How is agentic RAG different from ordinary RAG?

Ordinary RAG searches once and answers. Agentic RAG plans, can search several sources several times, and checks its results before answering.

Is agentic RAG slower and more expensive?

Yes, per answer. Each plan, tool call, and check is another model call. It earns that cost on tasks one search cannot answer.

Can an agent use GraphRAG?

Yes. A knowledge graph is one of the tools an agent can call, alongside passage search, web search, and your own systems.

Keep reading

More from Colidal Research.

All research →

Next step

Request a 30-minute call.

Tell us what you need. We reply within one business day with times for a call, and you'll get a short agenda before we talk.

  1. 01

    Request a call

    Thirty minutes, by video. No preparation needed.

  2. 02

    Get times and a short agenda

    Within one business day, so the call is spent on your problem.

  3. 03

    Leave with a next step

    Usually Colidal AI Assessment, or an honest "AI isn't the answer here".