Agentic RAG Latency and Cost: The Honest Math

GT

GigaRAG team

Retrieval28 min read
On this page
Editorial overhead view of a developer's hands placing a total cost and latency card beside a looping path through retrieve, reason, tool call, and memory stage chips for GigaRAG's agentic RAG cost breakdown.
Editorial overhead view of a developer's hands placing a total cost and latency card beside a looping path through retrieve, reason, tool call, and memory stage chips for GigaRAG's agentic RAG cost breakdown.

Agentic RAG Latency and Cost: The Honest Math

Agentic RAG latency and cost numbers float around everywhere, and most of them are hand-waved multipliers you can't defend in a budget meeting. "2-5x latency, 3-10x cost" gets repeated until it sounds like math, but nobody breaks down where those numbers come from. Retrieval isn't slower in agentic RAG. The overhead comes from loops: reasoning passes, tool calls, memory lookups, and the orchestration layer stitching them together. Each loop adds tokens and milliseconds, and the multipliers you've seen are just guesses at how many loops you'll run. The honest answer is that it depends on your query mix, your loop count, and whether you actually need the extra passes. This guide gives you the component-level math: per-step latency and cost for retrieval, reasoning, tool calls, and memory, with concrete SLO targets and hard thresholds for when agentic RAG simply isn't worth it. GigaRAG exists for builders who need agent memory without paying the full orchestration tax.

At a glanceDetails
Latency multiplierTypically 2-5x vs single-pass RAG
Cost multiplierTypically 3-10x vs single-pass RAG
Biggest latency driverSequential reasoning and tool-call loops
Biggest cost driverRepeated LLM calls with growing context
When to avoidIf p95 budget is under ~3 seconds
Best leverCap iterations and cache aggressively

In This Guide

What Is Agentic RAG?

Traditional RAG runs one pass: embed the query, retrieve chunks, stuff them into a prompt, generate an answer. Agentic RAG replaces that single pass with a loop. The model plans, retrieves, checks what it got, decides whether to retrieve again, and only then answers. That loop is the entire difference, and it's also the entire cost problem.

Agentic RAG vs traditional RAG: the architectural delta

In traditional RAG, the pipeline is linear. Query in, chunks out, answer back. The model gets one shot at the context window you hand it. If the retrieval missed, the answer misses. There's no second chance.

Agentic RAG adds three things. First, a reasoning step before retrieval: the model decides what it needs to look up, sometimes rewriting the query into sub-queries. Second, tool calls: the model can query a vector database, call an API, or run a search, then read the result and decide if it's enough. Third, iteration: if the first retrieval is thin, the model goes back for more. Each loop costs tokens and time. A three-loop query burns roughly three times the retrieval cost plus the reasoning tokens for every loop.

The architectural delta isn't subtle. Traditional RAG is a function call. Agentic RAG is a control flow with branches, retries, and a model making judgment calls at every step.

Where the extra latency actually comes from

The latency doesn't come from slower retrieval. Vector search is vector search. The overhead comes from the model thinking between steps.

Each loop adds a full LLM inference round trip. A reasoning step before retrieval might take 300 to 800 milliseconds on a mid-sized model. The retrieval itself might take 50 milliseconds. The model then reads the results and decides whether to continue, another 300 to 800 milliseconds. Three loops means three reasoning passes, three retrievals, and three decision points, all serialized because each step depends on the previous one's output.

The honest math: a traditional RAG query might run 1 to 2 seconds end to end. An agentic RAG query with three loops can hit 5 to 10 seconds, and most of that is the model waiting on itself. You can't parallelize a loop that depends on its own previous iteration.

[!note] The widely cited 2-5x latency and 3-10x cost multipliers are rules of thumb, not measured constants — your actual numbers depend on iteration caps, model choice, context growth per step, and how often tools are invoked.

Single-Pass RAG vs Agentic RAG: Where the Time and Money Go

FactorSingle-Pass RAGAgentic RAG
LLM calls per queryOne generation callMultiple calls across reasoning and tool loops
Retrieval patternOne retrieval passIterative retrieval, often re-queried per step
Latency profileDominated by one generationDominated by sequential steps and tool round-trips
Cost profileMostly one prompt plus contextRepeated prompts with accumulating context and tool overhead
Best fitHigh-volume, latency-sensitive lookupsMulti-hop questions where accuracy justifies the overhead

Agentic RAG vs Traditional RAG: The Structural Difference

The previous section named the loop as the core difference. Here's the structural view: traditional RAG is a pipeline, agentic RAG is a state machine. A pipeline has fixed stages and one pass through them. A state machine has transitions, conditions, and no fixed endpoint. That's why the cost and latency numbers don't scale linearly with query complexity. They scale with how many times the state machine decides to loop.

Single-pass vs multi-loop architecture

Traditional RAG has four stages: embed, retrieve, augment, generate. Each stage runs once. The output of one stage feeds the next, and nothing ever goes backward. If retrieval returns weak chunks, the generator still has to answer from them. The system has no mechanism to say "that wasn't good enough, try again."

Agentic RAG keeps those four stages but wraps them in a control loop. The model can trigger retrieval multiple times, call tools between retrievals, and revise its own query based on what it found. A single user question might produce this sequence: plan, retrieve, evaluate, rewrite query, retrieve again, call a tool, evaluate, retrieve a third time, generate. Nine steps instead of four. Each step is a full LLM inference or a retrieval round trip.

The structural consequence is that agentic RAG has a variable runtime. Traditional RAG has a predictable one. You can benchmark a traditional RAG pipeline and get a stable p95. An agentic RAG system's p95 depends on how many loops the model decides to run, and the model's loop count varies query to query.

Why loop count, not retrieval speed, drives the overhead

Retrieval is fast. A vector search against a well-indexed database runs in 10 to 50 milliseconds. Reranking adds another 20 to 100 milliseconds. Even a slow retrieval stack rarely exceeds 200 milliseconds per pass.

The LLM reasoning between retrievals is the expensive part. A single reasoning step on a mid-sized model takes 300 to 800 milliseconds and consumes 500 to 2,000 tokens. A tool call adds API round-trip time plus serialization overhead, typically 100 to 500 milliseconds before the tool even starts executing. Every loop pays these costs again.

Here's the math that matters. A traditional RAG query with one retrieval and one generation pass might total 1.5 seconds. An agentic RAG query with three loops pays three retrieval passes (150 milliseconds total) plus three reasoning passes (900 to 2,400 milliseconds) plus three decision points (another 900 to 2,400 milliseconds). The retrieval is 150 milliseconds of a 2 to 5 second total. The loops are everything else.

So when you see a "2-5x latency" claim for agentic RAG, the multiplier isn't coming from slower retrieval. It's coming from the model running three to five times as many inference passes. Optimize retrieval all you want. Until you cut loop count, the overhead stays.

[!tip] For pipeline builders, the highest-leverage fix is usually an iteration cap with a fallback to single-pass RAG: it bounds both worst-case latency and worst-case cost, and it makes your p95 defensible in a budget review.

Agentic Rag Latency And Cost: A Step-by-Step Guide

  1. Instrument each stage separately: retrieval, reasoning, tool calls, and memory reads/writes.
  2. Measure p50 and p95 latency per stage under realistic query load, not a single happy-path query.
  3. Log token counts and model pricing per call to attribute cost to each component.
  4. Model the loop: multiply per-iteration cost by your expected average and worst-case iteration counts.
  5. Set SLO ceilings per component before you ship, not after the first bill arrives.
  6. Run a shadow comparison against single-pass RAG on the same query set to quantify the real delta.
  7. Re-check the model monthly, since model pricing and context lengths change frequently.
Infographic table breaking down agentic RAG query cost into retrieval, reasoning, tool call, and memory components with per-query ranges from GigaRAG's cost analysis.

The Component-Level Cost Breakdown of Agentic RAG

The honest answer is: a typical agentic RAG query costs $0.02 to $0.15 in LLM tokens alone, with reasoning consuming 60-70% of that and retrieval under 5%. Tool calls and memory operations split the remainder. Here's the component math so you can build your own estimate.

Retrieval cost: embeddings, vector search, reranking

Retrieval is the cheapest component in the stack. Embedding a query costs fractions of a cent: a 100-token query at $0.02 per million tokens runs $0.000002. Vector search itself is compute on your infrastructure, not an API charge, so it's a fixed cost amortized across queries. Reranking is where retrieval cost actually shows up: a reranker processing 50 candidate chunks at 500 tokens each consumes 25,000 tokens per pass. At $0.02 per million tokens, that's $0.0005 per rerank. Even with three retrieval passes in a multi-loop query, retrieval rarely exceeds $0.002 total.

Reasoning cost: the token multiplier nobody budgets for

Reasoning is where the money goes. Every loop iteration runs a full LLM inference: planning, evaluating retrieved chunks, deciding whether to loop again. A single reasoning step on a mid-sized model consumes 500 to 2,000 tokens. At $3 per million tokens (GPT-4-class pricing), that's $0.0015 to $0.006 per step. A three-loop query runs three to five reasoning steps, so reasoning alone lands at $0.005 to $0.03. The catch: most cost estimates only count the final generation pass. They miss the planning and evaluation tokens entirely.

Tool call cost: API overhead and serialization

Tool calls add two costs: the LLM tokens to format the call and parse the result, plus the external API charge. Formatting a tool call consumes 200 to 500 tokens. Parsing the response consumes another 300 to 800. That's $0.0015 to $0.004 per tool call in LLM tokens before the tool itself runs. The external API is separate: a search API at $0.005 per call, a database query on your own infra, a code execution sandbox. A query with two tool calls adds $0.01 to $0.03 total.

Memory cost: the hidden line item in agentic RAG

Memory operations are the line item most analyses skip. Reading agent memory means retrieving stored context before the first reasoning step: 1,000 to 5,000 tokens per read, or $0.003 to $0.015. Writing memory after the query means a consolidation pass: another 500 to 2,000 tokens to summarize and store what the agent learned. That's $0.0015 to $0.006 per write. A query that reads memory once and writes once adds $0.005 to $0.02, which rivals the retrieval cost entirely.

The Component-Level Latency Breakdown

Latency is where agentic RAG hurts most. Cost you can budget for. Latency is what your users feel. A traditional RAG query returns in 1 to 3 seconds. An agentic RAG query with three loops routinely lands at 8 to 20 seconds. Here's where that time goes.

Per-step latency: retrieval, reasoning, tools, memory

Retrieval is fast. Embedding a query takes 50 to 150 milliseconds. Vector search on a well-indexed database runs 20 to 100 milliseconds. Reranking 50 candidates adds 200 to 500 milliseconds. Total retrieval latency: 300 to 750 milliseconds per pass. That's the cheap part.

Reasoning is the bottleneck. Every LLM inference step takes 1 to 4 seconds for a mid-sized model generating 500 to 2,000 tokens. A single loop iteration includes one planning step, one evaluation step, and sometimes a decision step. That's 3 to 12 seconds of pure model time per loop before retrieval or tools even run.

Tool calls add network round trips. A search API call runs 200 to 800 milliseconds. A database query on your own infrastructure runs 50 to 300 milliseconds. A code execution sandbox can run 1 to 5 seconds depending on the workload. The serialization overhead, formatting the call and parsing the response, adds another 300 to 800 milliseconds of LLM time.

Memory access is the sleeper. Reading agent memory before the first reasoning step means retrieving stored context: 100 to 400 milliseconds for a vector lookup, plus the LLM time to integrate that context into the prompt. Writing memory after the query adds a consolidation pass: another 1 to 3 seconds of LLM inference to summarize and store what happened.

The loop multiplier: how latency compounds

The honest answer is: latency doesn't add, it multiplies. Each loop iteration runs the full stack again: retrieve, reason, maybe call a tool, maybe read memory. A three-loop query doesn't cost three times a single pass. It costs three times the reasoning time, plus three times the retrieval time, plus the tool calls that only happen in loops two and three, plus the memory write that only happens at the end.

The worst case is a loop that decides to loop again. That decision step itself takes 1 to 4 seconds. Then the next iteration starts from scratch. A query that loops five times because the agent keeps deciding it needs more context can hit 30 to 60 seconds. Users abandon at 10 seconds.

A simple latency estimation formula

Here's the formula to estimate total latency for your own pipeline:

Total latency = (reasoning time per loop x loop count) + (retrieval time per pass x retrieval passes) + (tool call time x tool call count) + memory read time + memory write time

Plug in your numbers. A three-loop query with 3 seconds of reasoning per loop, two retrieval passes at 500 milliseconds each, one tool call at 800 milliseconds, one memory read at 300 milliseconds, and one memory write at 2 seconds:

(3 x 3) + (0.5 x 2) + 0.8 + 0.3 + 2 = 13.1 seconds

That's your p50. Your p95 will be worse because reasoning time varies wildly. A single slow LLM response can push a loop from 3 seconds to 8 seconds, and that compounds across every remaining loop.

Realistic SLO Targets for Agentic RAG in Production

The formula from the previous section gives you a point estimate. SLOs are about distributions. You don't promise users the average. You promise them a percentile, and you get fired when you miss it.

Latency SLOs: p50, p95, p99 targets

Here's what a defensible SLO looks like for a three-loop agentic RAG system on mid-sized models:

p50: 8 to 12 seconds. This is your median query. Most users wait this long or less. If your p50 is above 12 seconds, your loop count is too high or your reasoning model is too slow.

p95: 20 to 30 seconds. This is where the pain lives. One in twenty queries will hit this. The cause is almost always a loop that decides to loop again, or a tool call that times out and retries. You need to know what's happening at p95 because that's where your support tickets come from.

p99: 45 to 60 seconds. This is your worst-case tail. If your p99 exceeds 60 seconds, you have a failure mode you haven't found yet. It's not a slow query. It's a bug: a loop with no exit condition, a tool that hangs, a context window that overflows and triggers a retry.

Keep in mind these numbers assume a mid-sized LLM (7B to 70B parameters) and two to four retrieval passes. A smaller model cuts reasoning time roughly in half. A larger model doubles it.

Cost-per-query ceilings

Cost is easier to pin down than latency because token counts are deterministic. A three-loop agentic RAG query on GPT-4-class models runs $0.05 to $0.30 per query. On open-weight models served on your own infrastructure, $0.01 to $0.08.

The ceiling depends on your margin. If you're selling a $20 per month subscription, a $0.30 per query cost means you lose money after 67 queries per user per month. That's not a hypothetical. That's the math that kills agentic RAG in consumer products.

A defensible production ceiling: $0.10 per query for B2B SaaS, $0.02 per query for consumer products. Above those numbers, you need a pricing model that passes cost through, or you need to cut loops.

What you cannot realistically achieve

Sub-second agentic RAG is not happening. Not with current models. The reasoning step alone takes 1 to 4 seconds, and you can't parallelize away a dependency chain. If your product needs p95 under 3 seconds, agentic RAG is off the table. Use traditional RAG with a single retrieval pass.

Sub-cent agentic RAG is also not happening at scale. The token overhead of planning, evaluating, and tool-calling is structural. You can compress prompts and cache retrievals, but you can't remove the reasoning loops without removing the agent.

The honest answer is: agentic RAG in production means accepting 10-second medians and 30-second tails. If your users won't wait that long, don't build it.

When Agentic RAG Is Worth the Overhead

The previous section set hard ceilings. Now the affirmative case. Agentic RAG earns its 10-second medians and $0.10 per query only when the query itself demands multiple passes. Single-hop lookups don't. Multi-hop reasoning does.

Multi-hop queries that justify the loops

A multi-hop query is one where the answer depends on information from two or more documents that no single retrieval can surface together. "Which of our enterprise customers renewed last quarter, and what was their average contract value?" That's three hops: customer list, renewal status, contract value. Traditional RAG retrieves once and hopes the top-k chunks contain all three facts. They rarely do.

Agentic RAG earns its keep here because each loop narrows the search. The first pass finds customers. The second pass filters for renewals. The third pass pulls contract values. The overhead isn't waste. It's the mechanism that makes the answer possible at all.

Tool-dependent workflows

The second case is when the answer requires calling an external tool mid-query. A SQL database, a CRM API, a calculator, a calendar. Traditional RAG can't do this. It retrieves text and generates text. If your query is "what was our churn rate last month, and how does it compare to the trailing six-month average," the system needs to run two queries against your analytics database, then reason over the results.

The tool calls themselves add latency: 200 to 800 milliseconds per call, plus the token cost of serializing the tool schema and the result back into the context. But there's no cheaper alternative. You either call the tool or you don't answer the question.

When accuracy gains outweigh cost

The honest test is simple. Run your query set through traditional RAG. Measure accuracy. Run it through agentic RAG. Measure accuracy again. If the delta is under 5 percentage points, the overhead isn't buying you much. If it's 15 points or more, the cost is justified.

In practice, the break-even lands around 10 to 15 points of accuracy gain for B2B use cases where a wrong answer costs real money: contract review, medical literature search, financial analysis. For consumer chat, the same gain rarely justifies the latency. Users won't wait 20 seconds for a marginally better answer to "what's the weather."

The main catch: you won't know your accuracy delta until you benchmark. Don't assume agentic RAG is more accurate. Measure it.

When NOT to Use Agentic RAG: The Hard Thresholds

The affirmative case has a mirror. Agentic RAG is a bad investment in four specific scenarios, and the thresholds are not vague. They're numbers you can take to a budget meeting.

Single-hop queries: don't pay for loops you don't need

If your query set is "what's the refund policy" or "when was this document last updated," you don't need reasoning loops. One retrieval, one generation, done. Traditional RAG handles this in 200 to 500 milliseconds. Agentic RAG will spend 2 to 5 seconds deciding whether it needs to think, then retrieve, then verify, then retrieve again. Same answer, ten times the cost.

The test is simple. Look at your top 50 queries. If more than 80% are single-hop, agentic RAG is overhead, not capability. You're paying for loops that never fire.

Latency thresholds: when 2-5x is unacceptable

Here's the hard number. If your p95 latency budget is under 2 seconds, agentic RAG will not fit. A single reasoning loop with one tool call and one retrieval pass lands at 1.5 to 3 seconds on a good day. Add a second loop and you're at 4 to 6 seconds. Add memory access and you're past 7.

The 2-5x multiplier everyone quotes is real, but it's not a fixed ratio. It's a floor. The more loops your agent runs, the worse it gets. If your users expect sub-second responses, agentic RAG is out. No optimization gets you there.

Cost thresholds: when the math doesn't close

The cost ceiling is equally concrete. If your cost-per-query budget is under $0.01, agentic RAG won't fit. A single agentic query burns 5,000 to 15,000 tokens across reasoning, retrieval, tool serialization, and memory. At $3 per million input tokens and $15 per million output tokens, that's $0.03 to $0.15 per query. Traditional RAG runs $0.002 to $0.01.

The math doesn't close at scale. A million queries per month at $0.05 each is $50,000. The same volume through traditional RAG is $5,000 to $10,000. Unless each query generates revenue that justifies the delta, you're lighting money on fire.

Reliability and failure modes beyond cost

Cost and latency are the obvious problems. The less obvious one is reliability. Agentic RAG fails in ways traditional RAG doesn't.

The agent can loop forever. A poorly bounded reasoning loop retries the same retrieval, gets the same unsatisfying result, and tries again. Without a hard loop cap, a single query can burn 50,000 tokens and 30 seconds before you kill it. You need a max-iterations guard, and even then, the failure is silent. The user gets a timeout, not an answer.

The agent can also call the wrong tool. It misreads the schema, passes a malformed argument, and the tool returns an error. The agent then spends another loop recovering. Traditional RAG has no tool calls, so this entire failure class doesn't exist.

The honest answer is that agentic RAG trades predictability for capability. If your system is reliability-critical, a medical triage bot or a payment dispute handler, the failure modes are not acceptable. The loop that never terminates is not a latency problem. It's an outage.

The Memory Management Overhead Nobody Talks About

Every component-level cost model covers retrieval, reasoning, and tool calls. Memory is the line item that gets skipped. It shouldn't. Agent memory adds a fourth cost center, and it compounds across every loop in ways the other three don't.

Memory retrieval: an extra hop in every loop

When your agent checks memory before acting, that's a retrieval call. Not the vector search against your document store. A separate lookup against the memory store, which is usually a different index, a different embedding space, or a different database entirely.

That hop costs 50 to 200 milliseconds and 500 to 2,000 tokens per access, depending on whether you're pulling a summary, a set of relevant past turns, or a full conversation history. The catch is that memory retrieval happens inside the loop. Every reasoning step that consults memory pays this tax again. A three-loop query with memory access on each loop adds 150 to 600 milliseconds and 1,500 to 6,000 tokens before you've generated a single answer.

Memory updates and consolidation costs

Retrieval is the cheap part. Writing memory is worse.

After each turn, the agent updates its memory: append the new exchange, re-embed the updated context, maybe rewrite the summary. That's an embedding call plus a write to the memory store, 100 to 300 milliseconds and 1,000 to 3,000 tokens per update. Consolidation, the process of merging old memories into summaries so the store doesn't grow unbounded, is a batch job that runs on a schedule. It's not free. A consolidation pass over 10,000 memory entries can burn 500,000 tokens and take minutes.

The honest answer is that memory turns a stateless pipeline into a stateful one, and state has carrying costs. You're paying to store it, paying to retrieve it, and paying to keep it from going stale.

Optimizing memory without sacrificing context

The fix is not to skip memory. It's to tier it.

Hot memory, the last few turns and the current task state, lives in the context window or a fast cache. It's retrieved on every loop and costs almost nothing. Warm memory, recent summaries and relevant past interactions, sits in a vector index and gets retrieved only when the agent decides it needs context. Cold memory, everything older than a threshold, gets consolidated aggressively and retrieved rarely.

The rule of thumb: if a memory item hasn't been accessed in 30 days, it should be a summary, not a full record. If it hasn't been accessed in 90 days, it should be archived. Every full record you keep hot is a tax you pay on every loop, whether that memory helps or not.

The main catch is that tiering requires a retrieval policy, not just a store. The agent has to decide when memory is worth the hop. Most agent frameworks don't give you that control. They check memory on every step because it's simpler to implement. That's the overhead nobody budgets for.

An Actionable Optimization Checklist for Agentic RAG Latency and Cost

You can't optimize what you haven't measured, and you can't measure what you haven't mapped to a component. This checklist maps each optimization to the specific component it improves. Work through it in order.

Retrieval optimizations: caching, batching, async IO

Cache embeddings before you cache anything else. Re-embedding the same document chunks on every query is pure waste. A persistent embedding cache cuts retrieval cost by 60 to 80 percent on repeat queries against a stable corpus.

Batch your vector searches. If the agent retrieves from three collections per loop, issue those searches in parallel, not sequentially. Async IO turns three 80-millisecond calls into one 80-millisecond wait. The loop count stays the same, but the per-loop retrieval latency drops by two-thirds.

Don't rerank unless the query is ambiguous. Reranking adds 50 to 150 milliseconds and 1,000 to 3,000 tokens per call. For single-hop lookups, top-k vector similarity is usually enough.

Reasoning optimizations: prompt compression, loop reduction

Compress the system prompt. Every token in the system prompt is paid on every LLM call, and agentic RAG makes multiple calls per query. Cutting a 2,000-token system prompt to 800 tokens saves 1,200 tokens per call. Across three loops, that's 3,600 tokens saved per query.

Reduce loop count by setting an explicit max iterations. Most agent frameworks default to 5 or 10 loops. If your queries resolve in 2, set the cap at 3. Every loop you prevent saves the full cost of retrieval, reasoning, and tool calls for that iteration.

Tool call optimizations: parallelization, serialization cuts

Run independent tool calls in parallel. If the agent needs weather data and a calendar lookup, those don't depend on each other. Parallel execution cuts tool latency from the sum of the calls to the max of the calls.

Cut serialization by batching tool outputs. Instead of returning each tool result as a separate message, concatenate them into one. Fewer messages means fewer tokens and fewer LLM calls.

Memory optimizations: tiered storage, consolidation

Tier memory as hot, warm, and cold. Hot memory lives in the context window. Warm memory gets retrieved only when the agent decides it needs context. Cold memory gets consolidated to summaries. Every full record you keep hot is a tax on every loop.

Schedule consolidation off-peak. A consolidation pass over 10,000 entries can burn 500,000 tokens. Running it during low-traffic hours keeps it off the query path entirely.

Observability: measure before you optimize

Log per-component latency and token counts. You need retrieval time, reasoning time, tool time, and memory time as separate metrics. Without that split, you can't tell whether your bottleneck is the vector store or the LLM.

Track loop count per query. If your average is 4 loops and your cap is 5, your optimization target is reasoning, not retrieval.

Set a cost-per-query alert. When the rolling average exceeds your ceiling, you'll know before the bill arrives.

The Honest Math: A Worked Example

The checklist tells you what to cut. The math tells you whether cutting it matters. Here's a full worked example so you can see the numbers stack up.

Assumptions: loop count, token counts, latency per step

Take a typical agentic RAG query against a product documentation corpus. The agent needs to answer a multi-hop question: "What's the default timeout for the payment API, and what happens when it's exceeded?"

Assume the agent runs 3 loops before it's confident. Each loop includes one retrieval call, one reasoning call, and one tool call. Here are the per-step numbers:

  • Retrieval: 80 ms, 1,200 tokens (embedding + vector search + reranking)
  • Reasoning: 1,500 ms, 3,500 tokens (system prompt + context + generation)
  • Tool call: 400 ms, 800 tokens (API request + serialization)
  • Memory access: 60 ms, 500 tokens (warm memory retrieval)

Token costs assume GPT-4-class pricing: $0.03 per 1K input tokens, $0.06 per 1K output tokens. Your model's pricing will differ, but the structure holds.

The full calculation

Latency per loop: 80 + 1,500 + 400 + 60 = 2,040 ms.

Total latency: 2,040 ms × 3 loops = 6,120 ms, or about 6.1 seconds.

That's your p50 if nothing queues and nothing retries. Add network jitter and cold starts, and p95 lands closer to 9 seconds.

Tokens per loop: 1,200 + 3,500 + 800 + 500 = 6,000 tokens.

Total tokens: 6,000 × 3 = 18,000 tokens.

Cost per query: Assume 80% input, 20% output. That's 14,400 input tokens and 3,600 output tokens.

  • Input: 14,400 × $0.03 / 1,000 = $0.43
  • Output: 3,600 × $0.06 / 1,000 = $0.22
  • Total: $0.65 per query.

At 10,000 queries per day, that's $6,500 per day, or roughly $195,000 per month. Before infrastructure, before memory consolidation, before observability.

How to adapt this to your own pipeline

Swap in your own numbers. The formula is:

Total latency = (retrieval + reasoning + tool + memory) × loop count

Total cost = (tokens per loop × loop count) × (input/output split × price per token)

The loop count is the multiplier that dominates everything. Cut it from 3 to 2, and you save 2,040 ms and $0.22 per query. Cut retrieval tokens by caching embeddings, and you shave 1,200 tokens per loop off the input side.

The honest takeaway: agentic RAG isn't expensive because any single component is slow. It's expensive because you pay for every component on every loop. The math is simple. The discipline to run it before you ship is the hard part.

Final Thoughts on Agentic RAG Latency and Cost

The worked example lands at $0.65 per query and 6.1 seconds of latency. That's the honest math, and it's not a rounding error you can ignore in a budget meeting.

Agentic RAG is a tool with real, quantifiable overhead. The loops are the tax. You pay for retrieval, reasoning, tool calls, and memory on every pass, and the multiplier compounds fast. If your query needs three loops to answer a multi-hop question, you've tripled every line item. That's defensible when the alternative is a wrong answer or a hallucinated API spec. It's not defensible when a single retrieval pass would have returned the same document.

The decision comes down to one question: does the query actually need iteration? Multi-hop reasoning, tool-dependent workflows, and cases where accuracy gains justify 3-10x cost are the scenarios where agentic RAG earns its keep. Single-hop lookups, tight p95 budgets, and cost-sensitive applications are not. If your latency ceiling is 2 seconds, agentic RAG fails before you've finished the first reasoning call.

The main catch is memory. Agent memory adds a hidden hop to every loop, and most analyses skip it entirely. If you need persistent context across sessions without paying the full orchestration tax, GigaRAG reduces memory overhead by handling retrieval and consolidation outside the reasoning loop. It's not a replacement for agentic RAG where true multi-step reasoning is required. It's a way to get the memory benefits without the full agentic latency and cost penalty.

Run the math before you ship. The formula is simple. The discipline to apply it honestly is the part most teams skip.

Frequently Asked Questions

Why is agentic RAG so much slower than standard RAG?

Standard RAG does one retrieval and one generation. Agentic RAG adds sequential reasoning steps and tool calls, and each step waits on the previous one. That serialization, plus re-retrieval with growing context, is what pushes latency up.

What drives most of the cost in an agentic RAG pipeline?

Repeated LLM calls with accumulating context are usually the largest line item, because each iteration resends prior reasoning and retrieved chunks. Tool-call overhead and memory reads add on top but are typically smaller.

When should you not use agentic RAG?

Skip it when your p95 latency budget is tight (roughly under a few seconds), when queries are single-hop lookups, or when per-query cost must stay near single-pass levels. In those cases the accuracy gain rarely justifies the overhead.

How do you reduce agentic RAG latency without losing accuracy?

Cap the number of reasoning iterations, cache retrieval results and tool responses, parallelize independent tool calls, and route simple queries to a single-pass path. Each targets a specific stage rather than the pipeline as a whole.

Does agentic RAG always improve answer quality enough to justify the cost?

  1. The gain shows up mainly on multi-hop or ambiguous queries that need decomposition. On straightforward retrieval questions, single-pass RAG often matches it at a fraction of the latency and cost.

How should you set SLO targets for an agentic RAG system?

Set separate ceilings per component — retrieval, reasoning, tool calls, memory — and track p95 rather than averages. Then validate the end-to-end budget against real traffic before committing to the architecture.

About GigaRAG

GigaRAG is for agent memory and RAG pipeline builders. get this right. Whether you are working through agentic rag latency and cost, the honest math or something adjacent, we publish what we have actually tested, including where it falls short.

All posts