PromptisePromptise
PlatformSoonEnterprise
DocsGitHub
Talk to usGet started
Promptise - AI Framework LogoPromptise

The full-stack framework for agentic systems. Build with the framework. Run it on the platform. Launch it with our engineers.

pip install promptise

[01] Product

  • Framework
  • Platform (coming soon)
  • Enterprise
  • How it works
  • Contact

[02] Framework

  • The Agent
  • The Interface
  • The Harness

[03] Resources

  • Documentation
  • GitHub
  • Why Promptise
  • Use cases
  • Roadmap
  • Guides
  • Learning Paths
  • Questions

[04] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

hello@promptise.com
← Learning paths> Agentic Engineering with Promptise Foundry
Lesson 52 / 100
52%

What Is Agentic RAG? How It Differs from Classic RAG

What agentic RAG is: an agent decides when and what to search, searches again if needed and cites sources. How it works, an example, RAG vs agentic RAG.

Beginner7 minRAG (Retrieval-Augmented Generation)
All 100 lessons↓
  1. ✓What Is an AI Agent? Definition, How It Works, Examples
  2. ✓How to Build an AI Agent in Python (2026 Guide)
  3. ✓Build a Personal AI Agent: Memory, Reminders, Chat
  4. ✓What Is an Agent Harness? Parts and How to Build One
  5. ✓System Prompt Best Practices for AI Agents in Python
  6. ✓Best LLM for AI Agents (2026): Picks, Prices, How to Test
  7. ✓AI Agent YAML: Define and Run an Agent From a Config File
  8. ✓Streaming LLM Responses with FastAPI: Tokens and Tool Calls
  9. ✓Best Local LLM for AI Agents: Ollama Models by GPU (2026)
  10. ✓Claude AI Agent with MCP: Use Anthropic Models in Promptise
  11. ✓Gemini AI Agent with MCP: Use Google Models in Promptise
  12. ✓Azure OpenAI Agent with MCP: Use Deployments in Promptise
  13. ✓OpenRouter AI Agent with MCP: Many Models in Promptise
  14. ✓Ollama AI Agent with MCP: Run Local Models in Promptise
  15. ✓LLM Semantic Cache and Model Fallback in Python
  16. ✓What Is MCP (Model Context Protocol)? A Developer's Guide
  17. ✓What Is Tool Calling? LLM Function Calling Explained
  18. ✓MCP Tools vs Resources vs Prompts (With Python Examples)
  19. ✓How to Connect MCP Servers to Your AI Agent in Python
  20. ✓Build a Production MCP Server in Python (Step by Step)
  21. ✓MCP Transports: stdio vs Streamable HTTP vs SSE (Python)
  22. ✓MCP 2026-07-28 Migration: Make Your MCP Server Stateless
  23. ✓OpenAPI to MCP: Turn Any REST API into an MCP Server
  24. ✓MCP Authentication in Python: API Keys, JWT and OAuth
  25. ✓Build an Authenticated MCP Server for Your AI Agent (Python)
  26. ✓MCP Security Best Practices: A Checklist for MCP Servers
  27. ✓Testing MCP Servers in Python: pytest Without a Live Server
  28. ✓Too Many MCP Tools? How to Fix LLM Tool Selection in Python
  29. ✓Idempotent Tool Calls: Make AI Agent Retries Safe
  30. ✓AI Agent Tool Failures: Stop Unsafe Workarounds
  31. ✓MCP Server Caching, Timeouts and Circuit Breakers in Python
  32. ✓MCP Middleware for Servers: Auth, Logging, Rate Limits
  33. ✓MCP vs CLI for AI Agents: Tokens, Security, When to Use Each
  34. ✓LangChain vs MCP: Differences and How They Work Together
  35. ✓FastMCP Alternatives for Production MCP Servers (2026)
  36. ✓AI Agent Audit Logging: Tamper-Evident Logs in Python
  37. ✓AI Agent Human in the Loop: Approve Tool Calls in Python
  38. ✓AI Agent Prompt Injection: How to Defend Against It
  39. ✓Hidden Text Prompt Injection: Sanitize Pages for AI Agents
  40. ✓Build a Multi-Agent System in Python (and When Not To)
  41. ✓Context Engineering for AI Agents: Context Window Management
  42. ✓Context Compaction for AI Agents: Trim vs Summarize
  43. ✓How to Deploy an AI Agent with Docker (2026 Guide)
  44. ✓LLM Tool Rate Limiting: Per-Client Limits for MCP Servers
  45. ✓MCP Long-Running Tasks: Background Jobs in Python
  46. ✓MCP Server Monitoring: Prometheus, OpenTelemetry and Logs
  47. ✓Best AI Agent Frameworks (2026): Python Options Compared
  48. ✓Self-Improving AI Agent: Learn From Tool Failures in Python
  49. ✓AI Agent Identity: Authenticate Agents to MCP Servers
  50. ✓Code-Action Agents in Python: One Program vs 37 Tool Calls
  51. ✓Multi-Tenant AI Agents: Keep Each Customer's Data Apart
  52. 52What Is Agentic RAG? How It Differs from Classic RAG
  53. 53AI Agent Memory in Python: Short-Term and Long-Term
  54. 54Per-User Agent Memory Isolation: Stop Leaks Between Users
  55. 55Agentic RAG in Python: Give Your AI Agent a Search Tool
  56. 56AI Agent Reasoning Patterns in Python: From ReAct to Debate
  57. 57Plan-and-Execute Agents in Python: Beyond the ReAct Loop
  58. 58Self-Modifying AI Agent in Python: Open Mode & Limits
  59. 59CrewAI Alternatives: 7 Options and How to Migrate (2026)
  60. 60Migrate from AutoGen: Agent Framework, AG2 and More
  61. 61What Is an LLM Guardrail? Types, Examples and Limits
  62. 62Best LLM Guardrails Tools (2026): 9 Platforms Compared
  63. 63AI Agent Guardrails in Python: Block Injection, Redact PII
  64. 64NeMo Guardrails vs Guardrails AI: Which to Choose (2026)
  65. 65AI-Based PII Detection and Redaction Tools for LLM Apps
  66. 66Stop Secrets Leaking Into LLM Logs and Traces
  67. 67AI Agent Code Execution Sandbox: Run LLM Code Safely
  68. 68AI Agent Network Egress: Limit Where Agents Can Connect
  69. 69AutoGen Docker Task Isolation: Secure the Code Executor
  70. 70SPIFFE for AI Agents: Workload Identity Without API Keys
  71. 71On-Behalf-Of Auth for AI Agents: Act as Each User
  72. 72AI Agent Production Checklist: What to Check Before Launch
  73. 73Approval Fatigue: Auto-Approve Safe AI Agent Actions
  74. 74What Is Human in the Loop AI? Approvals for AI Agents
  75. 75AI Agent Notifications: Webhook and Slack Alerts in Python
  76. 76AI Agent Observability: Trace Tool Calls, Tokens and Cost
  77. 77Best AI Agent Observability Tools (2026), Compared
  78. 78AI Agent Stuck in a Loop? How to Detect and Stop It
  79. 79How to Run, Debug and Deploy an AI Agent in Python
  80. 80AI Agent Cost Tracking: Tokens and Cost per Run and User
  81. 81How to Evaluate AI Agents: Evals, LLM Judges and pass^k
  82. 82AI Agent Cost Control: Budgets That Stop Runaway Spend
  83. 83How to Test LLM Prompts and AI Agents in Python
  84. 84AI Agent Evals in CI: Run Them on Every Pull Request
  85. 85What Is an Agentic Runtime? AI Agent Runtimes Explained
  86. 86Autonomous AI Agent Runtime: Budgets, Crash Recovery, API
  87. 87Event-Driven AI Agents: Webhook, Cron and File Triggers
  88. 88AI Agent Cron Jobs: Run an Agent on a Schedule
  89. 89AI Agent Webhook Trigger: Run an Agent on HTTP Events
  90. 90AI Agent File Watcher: Process New Files Automatically
  91. 91Custom AI Agent Triggers: Wake an Agent From Any Source
  92. 92AI Agent Event Filters: Skip Runs Before the LLM
  93. 93AI Agent Retries and a Dead Letter Queue for Failed Runs
  94. 94Run Multiple AI Agents: One Runtime, Many Processes
  95. 95AI Agent Manifest: Declare a Long-Running Agent in YAML
  96. 96AI Agent CLI: Start, Stop and Inspect Running Agents
  97. 97AI Agent Monitoring Dashboard in the Terminal
  98. 98Multi-Agent Event Bus: Chain Agents With Events
  99. 99Distributed AI Agents: Run Agents Across Many Machines
  100. 100Pause and Resume an AI Agent: Lifecycle States Explained

Lessons in this path

  1. ✓What Is an AI Agent? Definition, How It Works, Examples
  2. ✓How to Build an AI Agent in Python (2026 Guide)
  3. ✓Build a Personal AI Agent: Memory, Reminders, Chat
  4. ✓What Is an Agent Harness? Parts and How to Build One
  5. ✓System Prompt Best Practices for AI Agents in Python
  6. ✓Best LLM for AI Agents (2026): Picks, Prices, How to Test
  7. ✓AI Agent YAML: Define and Run an Agent From a Config File
  8. ✓Streaming LLM Responses with FastAPI: Tokens and Tool Calls
  9. ✓Best Local LLM for AI Agents: Ollama Models by GPU (2026)
  10. ✓Claude AI Agent with MCP: Use Anthropic Models in Promptise
  11. ✓Gemini AI Agent with MCP: Use Google Models in Promptise
  12. ✓Azure OpenAI Agent with MCP: Use Deployments in Promptise
  13. ✓OpenRouter AI Agent with MCP: Many Models in Promptise
  14. ✓Ollama AI Agent with MCP: Run Local Models in Promptise
  15. ✓LLM Semantic Cache and Model Fallback in Python
  16. ✓What Is MCP (Model Context Protocol)? A Developer's Guide
  17. ✓What Is Tool Calling? LLM Function Calling Explained
  18. ✓MCP Tools vs Resources vs Prompts (With Python Examples)
  19. ✓How to Connect MCP Servers to Your AI Agent in Python
  20. ✓Build a Production MCP Server in Python (Step by Step)
  21. ✓MCP Transports: stdio vs Streamable HTTP vs SSE (Python)
  22. ✓MCP 2026-07-28 Migration: Make Your MCP Server Stateless
  23. ✓OpenAPI to MCP: Turn Any REST API into an MCP Server
  24. ✓MCP Authentication in Python: API Keys, JWT and OAuth
  25. ✓Build an Authenticated MCP Server for Your AI Agent (Python)
  26. ✓MCP Security Best Practices: A Checklist for MCP Servers
  27. ✓Testing MCP Servers in Python: pytest Without a Live Server
  28. ✓Too Many MCP Tools? How to Fix LLM Tool Selection in Python
  29. ✓Idempotent Tool Calls: Make AI Agent Retries Safe
  30. ✓AI Agent Tool Failures: Stop Unsafe Workarounds
  31. ✓MCP Server Caching, Timeouts and Circuit Breakers in Python
  32. ✓MCP Middleware for Servers: Auth, Logging, Rate Limits
  33. ✓MCP vs CLI for AI Agents: Tokens, Security, When to Use Each
  34. ✓LangChain vs MCP: Differences and How They Work Together
  35. ✓FastMCP Alternatives for Production MCP Servers (2026)
  36. ✓AI Agent Audit Logging: Tamper-Evident Logs in Python
  37. ✓AI Agent Human in the Loop: Approve Tool Calls in Python
  38. ✓AI Agent Prompt Injection: How to Defend Against It
  39. ✓Hidden Text Prompt Injection: Sanitize Pages for AI Agents
  40. ✓Build a Multi-Agent System in Python (and When Not To)
  41. ✓Context Engineering for AI Agents: Context Window Management
  42. ✓Context Compaction for AI Agents: Trim vs Summarize
  43. ✓How to Deploy an AI Agent with Docker (2026 Guide)
  44. ✓LLM Tool Rate Limiting: Per-Client Limits for MCP Servers
  45. ✓MCP Long-Running Tasks: Background Jobs in Python
  46. ✓MCP Server Monitoring: Prometheus, OpenTelemetry and Logs
  47. ✓Best AI Agent Frameworks (2026): Python Options Compared
  48. ✓Self-Improving AI Agent: Learn From Tool Failures in Python
  49. ✓AI Agent Identity: Authenticate Agents to MCP Servers
  50. ✓Code-Action Agents in Python: One Program vs 37 Tool Calls
  51. ✓Multi-Tenant AI Agents: Keep Each Customer's Data Apart
  52. 52What Is Agentic RAG? How It Differs from Classic RAG
  53. 53AI Agent Memory in Python: Short-Term and Long-Term
  54. 54Per-User Agent Memory Isolation: Stop Leaks Between Users
  55. 55Agentic RAG in Python: Give Your AI Agent a Search Tool
  56. 56AI Agent Reasoning Patterns in Python: From ReAct to Debate
  57. 57Plan-and-Execute Agents in Python: Beyond the ReAct Loop
  58. 58Self-Modifying AI Agent in Python: Open Mode & Limits
  59. 59CrewAI Alternatives: 7 Options and How to Migrate (2026)
  60. 60Migrate from AutoGen: Agent Framework, AG2 and More
  61. 61What Is an LLM Guardrail? Types, Examples and Limits
  62. 62Best LLM Guardrails Tools (2026): 9 Platforms Compared
  63. 63AI Agent Guardrails in Python: Block Injection, Redact PII
  64. 64NeMo Guardrails vs Guardrails AI: Which to Choose (2026)
  65. 65AI-Based PII Detection and Redaction Tools for LLM Apps
  66. 66Stop Secrets Leaking Into LLM Logs and Traces
  67. 67AI Agent Code Execution Sandbox: Run LLM Code Safely
  68. 68AI Agent Network Egress: Limit Where Agents Can Connect
  69. 69AutoGen Docker Task Isolation: Secure the Code Executor
  70. 70SPIFFE for AI Agents: Workload Identity Without API Keys
  71. 71On-Behalf-Of Auth for AI Agents: Act as Each User
  72. 72AI Agent Production Checklist: What to Check Before Launch
  73. 73Approval Fatigue: Auto-Approve Safe AI Agent Actions
  74. 74What Is Human in the Loop AI? Approvals for AI Agents
  75. 75AI Agent Notifications: Webhook and Slack Alerts in Python
  76. 76AI Agent Observability: Trace Tool Calls, Tokens and Cost
  77. 77Best AI Agent Observability Tools (2026), Compared
  78. 78AI Agent Stuck in a Loop? How to Detect and Stop It
  79. 79How to Run, Debug and Deploy an AI Agent in Python
  80. 80AI Agent Cost Tracking: Tokens and Cost per Run and User
  81. 81How to Evaluate AI Agents: Evals, LLM Judges and pass^k
  82. 82AI Agent Cost Control: Budgets That Stop Runaway Spend
  83. 83How to Test LLM Prompts and AI Agents in Python
  84. 84AI Agent Evals in CI: Run Them on Every Pull Request
  85. 85What Is an Agentic Runtime? AI Agent Runtimes Explained
  86. 86Autonomous AI Agent Runtime: Budgets, Crash Recovery, API
  87. 87Event-Driven AI Agents: Webhook, Cron and File Triggers
  88. 88AI Agent Cron Jobs: Run an Agent on a Schedule
  89. 89AI Agent Webhook Trigger: Run an Agent on HTTP Events
  90. 90AI Agent File Watcher: Process New Files Automatically
  91. 91Custom AI Agent Triggers: Wake an Agent From Any Source
  92. 92AI Agent Event Filters: Skip Runs Before the LLM
  93. 93AI Agent Retries and a Dead Letter Queue for Failed Runs
  94. 94Run Multiple AI Agents: One Runtime, Many Processes
  95. 95AI Agent Manifest: Declare a Long-Running Agent in YAML
  96. 96AI Agent CLI: Start, Stop and Inspect Running Agents
  97. 97AI Agent Monitoring Dashboard in the Terminal
  98. 98Multi-Agent Event Bus: Chain Agents With Events
  99. 99Distributed AI Agents: Run Agents Across Many Machines
  100. 100Pause and Resume an AI Agent: Lifecycle States Explained
← Path overview

Agentic RAG is retrieval-augmented generation in which an AI agent runs the search. It decides when to look something up, writes its own queries and searches again until it can answer with sources. Classic RAG searches your documents once and hands the results to the model. This page shows how the two differ step by step, walks through a real run where the agent writes its own query for a two-part question, and covers when the extra model calls are worth paying for.

[01]

What is agentic RAG?

Agentic RAG is retrieval-augmented generation in which an AI agent controls retrieval. Instead of one fixed search before the answer, the agent decides whether to search, writes its own queries, can search several times or several sources, checks what it found, and answers only when it has enough evidence, citing its sources.

Key takeaways:

  • Retrieval becomes a tool. In classic RAG your code always searches first. In agentic RAG the model calls a search tool when it decides it needs one.

  • The agent can try again. If the first results miss part of the question, it rewrites the query or searches another source.

  • It costs more per question. Every decision is a model call, so agentic RAG is slower and less predictable than one search and one answer.

  • Retrieved text is still untrusted. A document can contain instructions aimed at the model, and an agent with tools can act on them.

The term covers a range of designs. The survey *Agentic Retrieval-Augmented Generation* (Singh et al., 2025) describes it as embedding autonomous agents into the RAG pipeline, using reflection, planning, tool use and collaboration between agents. Research systems such as Self-RAG (Asai et al., 2023) trained models to decide when to retrieve and to critique their own output. Most production systems today use the simpler version shown here: a tool-calling agent with a search tool.


[02]

How does agentic RAG work?

Classic RAG, from the original paper by Lewis et al. (2020), is a fixed pipeline. Agentic RAG wraps the same retrieval step in an agent loop.

Classic RAG embeds and searches once, then gives the top-k passages and the question to the model. Agentic RAG lets the model write the search call, read the passages and search again until it has enough to answer with citations, or to say the documents don't say.
FigureClassic RAG searches once in a fixed pipeline; agentic RAG lets the model search until it can answer

The retrieval index itself doesn't change. You still load documents, split them into chunks, embed the chunks and store them in a vector store. What changes is who calls search. In classic RAG, your code runs it with the user's exact words as the query. In agentic RAG, the model writes the query, which helps with questions that use different words than the documents, combine several topics, or need a fact from one document to know what to look up in another.

An agent can also have more than one source: a vector search over docs, a SQL tool for numbers, a web search for recent events. Picking the right source per question is a large part of what makes the approach useful.


[03]

An agentic RAG example

The example indexes five short policy documents with Promptise Foundry's RAG pipeline and gives the agent a search tool that returns the two best passages. The question has two parts, and each search returns only two passages.

Pythonagentic_rag.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import asyncio

from promptise import (
    Document,
    DocumentLoader,
    Embedder,
    InMemoryVectorStore,
    OpenAIEmbeddingProvider,
    RAGPipeline,
    RecursiveTextChunker,
    build_agent,
    tool,
)

POLICIES = {
    "travel.md": "Travel. Hotels are reimbursed up to $180 per night in the US and "
                 "EUR 160 in the EU. Purchases made while traveling that are not travel "
                 "costs follow the policy for that kind of purchase.",
    "equipment.md": "Equipment. Laptops are ordered by IT, never expensed. Monitors "
                    "and keyboards can be expensed up to $300 per year.",
    "expenses.md": "Expense reports. Submit receipts within 30 days of purchase.",
    "leave.md": "Leave. Full-time staff get 25 days of paid leave per year.",
    "security.md": "Security. Report a lost device to IT within 24 hours.",
}


class DictLoader(DocumentLoader):
    async def load(self) -> list[Document]:
        return [Document(id=k, text=v, metadata={"source": k}) for k, v in POLICIES.items()]


class OpenAIEmbedder(Embedder):
    def __init__(self):
        self._provider = OpenAIEmbeddingProvider(
            model="text-embedding-3-small", api_key="${OPENAI_API_KEY}"
        )

    async def embed(self, texts: list[str]) -> list[list[float]]:
        return await self._provider.embed(texts)

    @property
    def dimension(self) -> int:
        return 1536


async def main():
    pipeline = RAGPipeline(
        loader=DictLoader(),
        chunker=RecursiveTextChunker(chunk_size=300, overlap=0),
        embedder=OpenAIEmbedder(),
        store=InMemoryVectorStore(dimension=1536),
    )
    await pipeline.index()

    @tool
    async def search_policies(query: str) -> str:
        """Search the company policy documents. Returns the 2 best passages."""
        hits = await pipeline.retrieve(query, limit=2)
        return "\n".join(f"[{h.chunk.metadata['source']}] {h.chunk.text}" for h in hits)

    agent = await build_agent(
        model="openai:gpt-5-mini",
        instructions="Answer from the company policies only. Search as many times as you "
                     "need, answer in two sentences, cite the source files, and say so if the "
                     "policies don't cover it.",
        extra_tools=[search_policies],
    )
    try:
        question = ("I bought a $250 monitor on my work trip to Berlin. Can I expense it, "
                    "and how long do I have to submit the receipt?")
        result = await agent.ainvoke({"messages": [{"role": "user", "content": question}]})
        for msg in result["messages"][1:]:
            for call in getattr(msg, "tool_calls", None) or []:
                print(f"search  {call['args']}")
            if msg.type == "ai" and msg.content:
                print(f"answer  {msg.content}")
    finally:
        await agent.shutdown()


asyncio.run(main())

Real output from one run with gpt-5-mini:

Output
search  {'query': 'monitor expense receipt submission timeframe monitor equipment purchase expense policy submit receipt timeframe'}
answer  Yes — monitors and keyboards can be expensed up to $300 per year, so your $250 monitor from the Berlin work trip qualifies (equipment.md). You must submit the receipt within 30 days of purchase (expenses.md).

The agent didn't search with the user's words. It wrote one query that names both parts, the monitor and the receipt deadline, and the two passages that came back, from equipment.md and expenses.md, covered both. Each claim in the answer names the document it came from. The instructions allow more searches, but the model decides whether to use them. In other runs, the same kind of single query returned travel.md instead of equipment.md, and the agent answered that the policies don't say whether a monitor can be expensed, without searching again.

Two things to notice. The query is a long, keyword-stuffed string: models often write queries this way, and with embeddings it usually works, but it is worth testing. And the failed runs still gave a cited, confident answer. That is why you should check retrieval and citations in your evals, not only whether the answer sounds right. Promptise also ships rag_to_tool(), which wraps a pipeline as a tool and marks retrieved text as data, not instructions. Agentic RAG in Python builds a full version with metadata filters, freshness and "I don't know" handling.


[04]

Agentic RAG vs classic RAG and related terms

Term

Who decides what to retrieve

Searches per question

Best for

Classic RAG

Your code, using the user's question

One

FAQ-style questions over one document set; low latency

Agentic RAG

The model, through a search tool

Zero to many

Multi-part questions, several sources, vague wording

Agent memory

The agent or the framework, from past conversations

Usually one, automatic

Remembering users and past facts

Long-context prompting

Nobody: everything goes in the prompt

None

Small, stable document sets that fit the context window

Fine-tuning

Nobody at run time: knowledge is in the weights

None

Style and format, not fresh facts

Agentic RAG is not always better. When the questions are simple and the corpus is clean, classic RAG gives the same answer with one model call instead of two or three. Start with the simple pipeline, as in RAG for beginners, and move to an agent when your evals show multi-part or badly worded questions failing. For memory, see AI agent memory.


[05]

Common misconceptions about agentic RAG

"Agentic RAG stops hallucinations." It reduces them when the documents contain the answer, and only if the instructions tell the agent to answer from the documents and to say when they don't cover the question. A model can still mix retrieved facts with its own guesses.

"More searches mean better answers." Each search adds tokens to the context, and long contexts make it harder for the model to use the right passage. Cap the number of searches and the passages per search. Context engineering for AI agents covers how to keep the context small.

"Retrieved documents are safe because they are ours." Anyone who can edit an indexed document, a support ticket or a wiki page can plant instructions for the model. That is indirect prompt injection. Scope what each user can retrieve and treat passages as data. See managing context and retrieval safely.

"You need a special framework for agentic RAG." Any agent that can call tools can do it. The search tool is an ordinary function that queries your index.


[06]

Frequently asked questions

What is the difference between RAG and agentic RAG?

Classic RAG runs one search with the user's question and passes the results to the model. Agentic RAG gives the model a search tool, so it decides whether to search, writes its own queries, can search several times or several sources, and answers when it has enough. Agentic RAG handles harder questions at a higher cost per answer.

When should I use agentic RAG?

Use it when questions often combine several topics, use different words than your documents, or need data from more than one source, such as docs plus a database. Stay with classic RAG when questions are simple, latency matters, and one search usually finds the answer.

Is agentic RAG more expensive than RAG?

Usually, yes. Each decision is a model call, so a question that needs two searches costs at least two or three model calls instead of one, and the retrieved passages add input tokens. Limit the number of searches and the passages per search to keep the cost predictable.

Does agentic RAG need a vector database?

No. The search tool can query a vector store, a keyword index, a SQL database or an API. Many agents use several. A vector store is the common choice for unstructured documents, and an in-memory store is enough for small corpora and tests.

How do you evaluate an agentic RAG system?

Test three things separately: whether retrieval returns the right passages for a set of known questions, whether the agent searches when it should and stops when it has enough, and whether each claim in the answer is supported by a cited passage. Evaluate AI agents shows how.


[07]

Next steps

  • Build it: Agentic RAG in Python.

  • Start simpler: RAG for beginners.

  • Keep the context lean: Context engineering for AI agents.

  • All guides on the topic: the memory, context and RAG hub.

  • Reference: RAG in the Promptise docs.

← PreviousMulti-Tenant AI Agents: Keep Each Customer's Data ApartNext lesson →AI Agent Memory in Python: Short-Term and Long-Term