Agentic RAG
Moving from static RAG pipelines to agent-driven retrieval. The agent decides what to retrieve, when, from which source, and evaluates retrieval quality with self-reflection.
Quick Reference
- →Agentic RAG: an LLM agent controls the retrieval process instead of a fixed pipeline
- →Agent decides: which retriever to use, what query to send, whether results are good enough
- →Multi-source routing: different tools for different query types (docs, API, database)
- →Self-reflection: agent checks retrieval quality and retries with a different strategy if needed
- →LangGraph is the natural framework — model retrieval decisions as graph state transitions
From Static Pipeline to Agent-Driven Retrieval
Standard RAG is a fixed pipeline: embed query → search vector store → generate answer. The pipeline makes the same decisions for every query. Agentic RAG replaces this fixed pipeline with an LLM agent that dynamically decides how to retrieve information. The agent can choose between multiple retrievers, reformulate queries, evaluate results, and retry with different strategies. This flexibility dramatically improves answer quality for complex or ambiguous queries.
| Aspect | Static RAG Pipeline | Agentic RAG |
|---|---|---|
| Retrieval strategy | Fixed (same for every query) | Dynamic (agent chooses per query) |
| Data sources | One vector store | Multiple sources (vector store, SQL, API, web) |
| Query handling | Direct embedding lookup | Agent reformulates, decomposes, or routes |
| Quality control | None — returns whatever the retriever finds | Agent evaluates results, retries if poor |
| Complexity | Simple, predictable | More complex, higher quality for hard queries |
| Latency | 200-500ms | 1-5s (multiple agent steps) |
Upgrade from static RAG when: (1) you have multiple data sources (docs, databases, APIs), (2) your queries vary widely in complexity, (3) retrieval failures are common and reformulation would help, (4) users expect the system to try different approaches when the first doesn't work. Keep static RAG for simple, homogeneous knowledge bases.