Agentic RAG Patterns
Overview
Agentic RAG is a class of architectures where an agent (LLM with tools) dynamically manages the information retrieval process: selects sources, formulates queries, decides when to stop searching, and how to synthesize the response. Unlike classical RAG, the agent can perform multiple search iterations.
Key Patterns
| Pattern | Description |
|---|---|
| Routing | The agent selects the appropriate retriever or knowledge base |
| Query Planning | The agent breaks the query into sub-queries and executes them |
| Tool Use | The agent invokes external tools (API, SQL, search) |
| Self-Reflection | The agent evaluates the found documents and repeats the search if necessary |
Example Cycle
flowchart LR
Q[Request] --> A[Agent]
A -->|Plan| R[Retriever]
R --> D[Documents]
D --> E{Evaluation}
E -->|Insufficient| A
E -->|Sufficient| G[Generation]
G --> O[Response]