Agentic RAG
Definition
Retrieval-augmented generation in which an agent decides when and how to search, often running several searches and refining queries.
In more detail
Instead of one retrieval step before generation, search is a tool the agent can call repeatedly. This helps with multi-part questions, at the cost of more calls and less predictable behaviour.
The agent can rewrite its query after a poor first result, search several sources, follow references from one document to another, and stop when it has enough. Coding agents searching a repository with grep and file reads are a form of agentic RAG. Evaluate the trajectory as well as the answer, cap the number of searches, and log every query, because the agent's search choices are now part of what can go wrong.
Related terms
Agent
A system where a model decides which actions or tools to use, in a loop, until a goal or stop condition is met, rather than following fixed steps.
Retrieval-augmented generation (RAG)
Retrieving relevant documents and adding them to the prompt before the model generates an answer from them.
GraphRAG
Retrieval-augmented generation that uses a knowledge graph of entities and relationships to connect related facts across many documents.
Query rewriting
Using a model to turn a user's question into one or more better search queries before retrieval, to find more relevant results.
Read more about Agentic RAG
- Retrieval-augmented generation
Fetching relevant documents and adding them to a prompt to ground answers.
- Query rewriting
Using a model to turn a user's question into one or more better search queries before retrieval, to find more relevant results.
- Trajectory evaluation
Evaluating the sequence of steps an agent took, its tool calls, arguments and order, rather than only its final answer.