The distinction between agentic search vs RAG is not semantic sugar. Traditional RAG retrieves a fixed set of passages from a known corpus and feeds them into a single generation call. Agentic search pushes control flow to the model: it plans sub-queries, invokes tools, evaluates results, and iterates until it judges the task complete.
Capabilities
Traditional RAG in practice
RAG is a deterministic retrieve-then-generate pipeline. You embed the query, pull the top-k nearest vectors, and inject them into a prompt. It works when the answer lives inside an index you control.
from chromadb import Client
client = Client()
collection = client.get_collection("support_docs")
results = collection.query(query_texts=[user_question], n_results=5)
context = "\n---\n".join(results["documents"][0])
prompt = f"Context:\n{context}\n\nQuestion: {user_question}\nAnswer:"
# single LLM call with `prompt`
The model never decides to look elsewhere. If the index lacks the fact, the output degrades or hallucinates.
Agentic search in practice
Agentic search treats the LLM as a stateful controller. It emits tool calls, observes results, and loops. The same user question might trigger a web search, a SQL query, and a second refined vector search.
from openai import OpenAI
client = OpenAI() # any OpenAI-compatible endpoint
tools = [{"type":"function","function":{
"name":"web_search",
"parameters":{"type":"object","properties":{"query":{"type":"string"}}}
}}]
messages = [{"role":"user","content":user_question}]
for _ in range(10):
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=messages,
tools=tools
)
msg = resp.choices[0].message
if resp.choices[0].finish_reason != "tool_calls":
break
messages.append(msg)
for call in msg.tool_calls:
tool_result = call_tool(call.function.name, call.function.arguments)
messages.append({"role":"tool","tool_call_id":call.id,"content":tool_result})
The capability gap is control. RAG answers from a frozen snapshot; agentic search reasons about how to find the answer.
Price / cost model
RAG cost is a linear function of query embeddings plus one completion. A typical support bot call costs fractions of a cent.
Agentic search multiplies tokens by step count. Each loop iteration re-sends the growing message history. A 10-step research run with 4k tokens of context per step burns 40k input tokens plus tool output. Add web API fees and the bill scales fast.
Routing through an OpenAI-compatible endpoint like n4n.ai gives per-token metering and automatic fallback when a provider is rate-limited, so a degraded model doesn’t stall your agent or silently triple spend. You still need a step cap, but the accounting is external.
Latency / throughput
RAG adds one vector search (tens of milliseconds on an indexed store) and one generation. p95 under a second is realistic for small contexts.
Agentic search latency is the sum of all steps. Each tool call is a network round trip; each model call waits on prior output. Open-domain deep research can take 30–120 seconds. Throughput per worker drops because each session holds a large rolling context and blocks on slower tools.
If you serve real-time chat, RAG fits. If the product is “research report by email,” agentic latency is acceptable.
Ergonomics
RAG is a pure function: query -> docs -> response. Unit tests assert on retrieved IDs and prompt shape. Debugging is local.
Agentic search is a distributed system with an LLM in the critical path. You need:
- Message history persistence
- Tool dispatch tracing
- Loop termination guards
- Replay logs for stuck states
Frameworks like LangGraph or AutoGen standardize the loop, but you own the failure modes. A RAG regression shows as a bad chunk; an agent regression shows as an infinite tool spiral.
Ecosystem
RAG has a deep stack: pgvector, Pinecone, Chroma, Weaviate, LlamaIndex, plus hybrid BM25 extensions. The patterns are documented and stable.
Agentic search builds on the function-calling spec (OpenAI, Anthropic, Gemini all converge), browser automation (Playwright), and code-exec sandboxes. The tooling is younger, but the surface area is broader. When you need to expose internal APIs to a model, agentic wins on flexibility.
Limits
RAG is bounded by index recall. Bad chunking or missing docs equals silent failure. It cannot synthesize across live data unless you pipeline that data into the index first.
Agentic search suffers from:
- Loop instability – model repeats a tool call with same args
- Tool trust – a flaky API returns garbage the model trusts
- Cost spikes – a confused agent burns 200k tokens
- Partial observability – the model can’t know what it hasn’t queried
You mitigate with max-step caps, tool result schemas, and budget guards.
Comparison table
| Dimension | Traditional RAG | Agentic search |
|---|---|---|
| Capabilities | Single-shot retrieval from fixed index | Multi-step planning, tool use, iterative refinement |
| Cost model | Embedding + 1 completion, predictable | Many completions + tool costs, variable |
| Latency | Low (one round trip + gen) | High (loop of round trips) |
| Throughput | High per instance | Lower per session |
| Ergonomics | Stateless, easy to test | Stateful, needs tracing |
| Ecosystem | Vector DBs, mature | Tool specs, agents, emerging |
| Limits | Corpus-bound recall | Loop control, cost, tool reliability |
Which to choose
Closed corpus Q&A (internal wiki, support docs): Use RAG. Latency is low, cost is flat, and recall is tunable with chunking.
Open-domain research, competitive intel, multi-source synthesis: Use agentic search. The model must discover sources, not just rank known ones.
Hybrid (recommended for most production systems): Expose your RAG index as one tool inside an agentic loop. The agent decides when retrieval suffices and when to go external. This bounds cost while preserving reasoning.
High-throughput real-time assistant: RAG only. Agentic loops will saturate your concurrency.
Batch deep-research jobs: Agentic with hard step and token ceilings.
The decision reduces to a single question: does the bottleneck live in finding the document or in reasoning across sources? RAG solves the first; agentic search vs RAG is the difference between a lookup and an investigation.