Comparison11 min read

How Much Does RAG Cost in 2026? The Four-Layer Breakdown

Embedding, Storage, Retrieval, and Generation — every RAG pipeline has the same four cost layers. The same workload can cost $80/month or $8,000/month depending on how you stack them. Here's the honest breakdown with worked examples.

"How much does RAG cost?" is a question with a four-layer answer. Most blog posts only address one or two — usually the LLM line, sometimes the vector database — and quietly ignore re-indexing, query embeddings, reranking, and the cost compounding from corpus growth. The same RAG workload can land at $80/month or $8,000/month depending on how you stack the four layers. Here's the honest 2026 breakdown.

The Four Layers

Every RAG pipeline has the same four cost layers. Get any one wrong and your year-1 budget is off by a multiple, not a percentage.

  1. Embedding — converting documents and queries into vectors. One-time for the initial corpus, then ongoing for re-indexing, growth, and per-query embeddings.
  2. Storage — keeping those vectors in a vector database. Recurring, billed as GB-month, dim-month, pod-hour, or cluster-tier depending on the provider.
  3. Retrieval — per-query similarity search and (optionally) reranking. Free on cluster-based providers, metered on usage-based ones.
  4. Generation — the LLM call that produces the final answer using the retrieved context.

Use the RAG Cost Calculator to run this math interactively. The rest of this post explains why each layer behaves the way it does, and which knobs actually matter.

Layer 1: Embedding — the line nobody budgets for

The Embedding line is small for prototypes ("we embedded the docs once, what could it cost?") and grows fast in production. The drivers are:

  • Initial embedding — your entire corpus, embedded once, amortized over the project lifetime
  • Re-indexing — embedding the corpus again every time you change models, change chunk sizes, or just want to refresh
  • Corpus growth — embedding new documents as they arrive
  • Per-query embedding — embedding the user's question on every request

Concrete example: 100K documents at 2,000 tokens each = 200M tokens. On OpenAI text-embedding-3-small ($0.02/M), that's $4 one-time, $0.33/month amortized over a year. Sounds like nothing.

Now turn on weekly re-indexing. 4.34 re-indexes per month × 200M × $0.02/M = $17.36/month. Already 50× the amortized initial cost. Add 5%/month growth: another $0.20/month. Add 10K queries/day at 30 tokens each: another $0.18/month.

Total: ~$18/month for the embedding line alone, dominated by re-indexing. If you switch to text-embedding-3-large ($0.13/M, 6.5×), that becomes ~$117/month. If you switch to weekly re-indexing on a 1M-document corpus, multiply by 10.

Cost-cutting moves on the Embedding line:

  • Switch to monthly re-indexing with incremental upserts for the diff
  • Pick a cheaper model — Voyage-3 ($0.06/M) and text-embedding-3-small ($0.02/M) are both excellent
  • Self-host BGE/Nomic/GTE if you process >100M tokens/month and have GPU capacity already

Layer 2: Storage — the part vendors will calculate for you

This is the one area where every vendor has a public calculator. Pinecone Serverless charges per GB and per Read/Write Unit. Pinecone Pod-based charges per pod-hour. Weaviate charges per million stored dimensions per month. Qdrant Cloud charges per cluster-hour. Zilliz charges per Compute Unit. Chroma charges per GB plus per million queries and writes. MongoDB Atlas charges per cluster tier. Self-hosted is whatever your AWS bill says, plus the engineer's salary.

The deep treatment lives in the Vector Database Cost Comparison 2026 blog post and the Vector Database Cost Calculator. For RAG specifically, the only mental model you need:

  • Small workloads (under 1M vectors, under 10K queries/day) — Pinecone Serverless or Weaviate Cloud will be minimum-bound at $25–50/mo. The choice barely matters.
  • Medium workloads (1M–50M vectors, moderate QPS) — Qdrant Cloud is usually cheapest. Pinecone Pod-based becomes competitive at high steady-state QPS.
  • Large workloads (50M+ vectors) — Self-hosted Qdrant or Milvus on AWS r6g if you have a platform team; Pinecone Pod or Zilliz if you don't.

Storage rarely dominates the RAG bill. Generation does.

Layer 3: Retrieval — usually free, sometimes catastrophic

For Pinecone Pod-based, Qdrant Cloud, MongoDB Atlas, Zilliz, and self-hosted setups: the retrieval layer is effectively free. You already paid for the cluster; queries are bundled. There's no per-query meter.

For Pinecone Serverless and Chroma Cloud: there's an explicit per-query line. Pinecone charges $8.25 per million Read Units, with each query consuming ~2 RU (unfiltered) or 5–10 RU (filtered). At 10M queries/month with unfiltered search, that's $165/mo of reads. With heavy metadata filtering on a multi-tenant SaaS, the same workload can hit $500+/mo on reads alone.

The other thing that lives in this layer is the reranker. Cohere Rerank 3 is $2.00 per 1,000 search calls. At 100K queries/day, that's:

100,000 queries/day × 30.4 days × $2.00 / 1000 = $6,080/month

Six thousand dollars per month, just for reranking. This is often a bigger line than the entire vector DB bill. The cheaper alternatives — Voyage Rerank 2 at $0.05/1K, Jina at $0.20/1K — change this dramatically. Self-hosted cross-encoders are free to use but cost compute time and complexity.

Layer 4: Generation — almost always the dominant line

Here is the truth that surprises every team running their first RAG production deployment: generation is 70–95% of your bill. Not storage. Not retrieval. Generation.

The math is straightforward:

prompt_tokens = top_K × chunk_size + query_tokens + system_prompt
input_cost    = queries_per_month × prompt_tokens × $/M_input
output_cost   = queries_per_month × answer_tokens × $/M_output
generation    = input_cost + output_cost

For a typical configuration — top_K=5, chunk_size=512, query=30 tokens, system=200, answer=400 — every query injects 2,790 tokens of input and produces 400 tokens of output. At Claude Sonnet 4.6 ($3/$15 per M) and 100K queries/day, that's:

input  = 3.04M queries × 2,790 tokens × $3/M = $25,448/mo
output = 3.04M queries × 400 tokens × $15/M  = $18,240/mo
total  = $43,688/mo

Forty-four thousand dollars per month. The vector database is rounding error against this.

Switch to Claude Haiku 4.5 ($0.80/$4 per M) and the same workload becomes:

input  = 3.04M × 2,790 × $0.80/M = $6,786/mo
output = 3.04M × 400 × $4/M       = $4,864/mo
total  = $11,650/mo

A 73% cost reduction from one dropdown change. For most factual RAG workloads (extractive QA, summarization, knowledge-base search), the user-perceptible quality gap between Sonnet 4.6 and Haiku 4.5 is small. This is the highest-leverage cost-saving move in the entire RAG stack, and it lives in Layer 4.

A Worked Example — Customer Support Chatbot

Let's stack all four layers for a realistic scenario:

  • Workload: 50K support docs at 1,500 tokens each, 100K queries/day, weekly re-indexing, 30% cache hit rate
  • Stack: OpenAI text-embedding-3-small + Pinecone Serverless + GPT-5 mini + no reranker
Layer Cost / month % of total
Embedding $8 0.2%
Storage $50 (Pinecone minimum) 1.5%
Retrieval $35 1.1%
Generation $3,184 97.2%
Total ~$3,277/mo 100%

A few takeaways:

  • Generation isn't 80% — it's 97%. Three more nines and it would be the only line that mattered.
  • The Pinecone Serverless minimum binds at this scale. Storage compute is irrelevant.
  • The 30% cache hit rate already saved ~$1,400/mo on generation + retrieval. Without it, the bill would be ~$4,700/mo.
  • Switching the LLM from GPT-5 mini ($0.40/$1.60) to anything frontier (GPT-5, Sonnet 4.6, Opus 4.7) puts the bill into the tens of thousands.

A Second Worked Example — Internal Knowledge Base

  • Workload: 5K internal docs at 4K tokens each, 500 queries/day, monthly re-indexing
  • Stack: OpenAI text-embedding-3-small + Qdrant Cloud (smallest tier) + Claude Sonnet 4.6 + no cache
Layer Cost / month % of total
Embedding $1 0.3%
Storage $73 (Qdrant 1 vCPU × 2 replicas) 19.5%
Retrieval $0 (bundled into cluster) 0%
Generation $300 80.2%
Total ~$374/mo 100%

Smaller scale, smaller numbers, same pattern: generation dominates. At 500 queries/day on Sonnet 4.6, generation is ~$300/mo. Switch to Haiku 4.5 and that drops to ~$80/mo, making the storage line nearly equal.

For internal-use cases serving 10–100 employees with Sonnet 4.6, you're looking at roughly $5–10K/year all-in. Compare against $40K/year for a Glean license — and a 5-engineer team can build the RAG version in a quarter.

How to Cut RAG Costs by 50% or More

Ranked by impact:

1. Switch to a smaller LLM in the same family. Claude Opus 4.7 → Sonnet 4.6 cuts the LLM bill 5×. Sonnet → Haiku another 4×. The single biggest lever in the stack.

2. Add caching. Even 30% cache hit rate (typical for chatbots with FAQ-style traffic) cuts Retrieval + Generation 30%.

3. Reduce top-K. Each retrieved chunk multiplies prompt tokens. K=10 → K=3 cuts generation prompt tokens roughly 70% with little quality loss in most workloads.

4. Use int8 quantization on the vector DB. Cuts storage 75% with under 2% recall loss.

5. Pick a smaller-dimension embedding model. text-embedding-3-large (3072) → text-embedding-3-small (1536) cuts storage 50% for a 2-point MTEB drop.

6. Drop re-indexing to monthly with incremental upserts. Weekly re-indexing of a static-ish corpus is wasteful.

7. Negotiate. List prices are not what anyone pays at scale. Above $5K/mo of spend, every major provider offers 25–50% discounts.

Hidden Costs Most Calculators Skip

Including this one — these are real production costs that don't appear in any vendor pricing page:

  • Egress: $0.05–$0.09/GB pulling query results out to your application. Small per-query, real at scale.
  • Re-embedding when you change models: Switching from text-embedding-3-small to text-embedding-3-large requires re-embedding every doc. For a 10M-doc corpus, that's tens of thousands of dollars one-time.
  • Failed parses, retries, malformed inputs: Plan for ~5–10% overhead on the generation line for production garbage.
  • Evaluation runs: RAGAS / TruLens eval suites cost real LLM tokens on every CI run.
  • Observability tools: LangSmith / Helicone / Phoenix at $0.001/trace × 100K queries/day = $3K/mo just for traces.
  • PII redaction, audit logs, encryption-at-rest premium tiers — visible during your security review, not before.

Real-world bills typically run 10–25% higher than calculator estimates because of these. Budget the buffer.

Build Your Own Estimate

The RAG Cost Calculator runs the four-layer math for any combination of embedding model, vector database, LLM, and reranker. Six preset workloads (chatbot, knowledge base, e-commerce search, legal research, personal assistant, documentation Q&A) give you a starting point in one click. The "What If?" panel auto-generates the cost delta for swapping one input at a time, so you can see immediately whether to optimize the LLM, the vector DB, the chunking strategy, or caching.

Pair it with the LLM Cost Calculator for deeper LLM-only comparisons and the Vector Database Cost Calculator for deeper vector DB comparisons. All three share the same pricing source files, so when one updates, all three reflect the new numbers.

Try the tools