world

OpenRouter Benchmarks RAG vs. CAG on Cost and Accuracy at Scale

OpenRouter tested RAG against Cache-Augmented Generation on catalogs up to 330K tokens, showing where prompt caching beats retrieval and where both fail.

OpenRouter Benchmarks RAG vs. CAG on Cost and Accuracy at Scale

OpenRouter published an empirical benchmark comparing Retrieval-Augmented Generation (RAG) against Cache-Augmented Generation (CAG) across product catalogs of 9K, 66K, and 330K tokens, according to the OpenRouter Insights report. Testing GPT-6 Luna and DeepSeek V4.1 Flash across 40 catalog questions, the study quantifies a core architectural trade-off for AI engineers: stuffing an entire dataset into prompt cache delivers sharply higher accuracy, but unit economics and multi-provider routing quickly erode the advantage at scale.

Why Prompt Caching vs. Retrieval Matters Now

As 1-million-token context windows and discounted prompt caching became standard in 2026, many teams questioned whether vector databases, chunking pipelines, and rerankers were still worth maintaining. OpenRouter's test puts numbers behind that debate by evaluating plain embedding RAG (mongodb/voyage-4-lite), hybrid RAG (embeddings plus BM25 keyword search and mongodb/rerank-3-lite), and CAG (placing the entire catalog in the system prompt).

On the largest 3,000-product catalog (330K tokens), GPT-6 Luna with CAG answered 31 of 40 questions correctly, compared with 17 for hybrid RAG and just 9 for plain embedding RAG. Plain RAG failed almost completely on exact SKU lookups in large catalogs, whereas adding BM25 keyword matching recovered single-fact retrieval—though it still trailed CAG by 14 to 18 questions on multi-hop queries linking two separate pages.

The Cost Curve and Routing Trap

Accuracy gains come with a steep price cliff. While RAG held nearly flat at $0.13 to $0.22 per 1,000 queries across all three catalog sizes, CAG on GPT-6 Luna climbed from $0.13 on the 9K catalog to $8.70 per 1,000 queries at 330K tokens. Part of that jump stems from long-context pricing tiers: above 272K tokens, GPT-6 Luna doubles both standard input and cached input rates.

More importantly for production developers, OpenRouter uncovered a subtle routing penalty on open-weight models. By default, DeepSeek V4.1 Flash requests were load-balanced across multiple inference providers, causing repeated prompt-cache misses. Passing a consistent session_id pinned traffic to a single provider and cut DeepSeek CAG costs roughly threefold on targeted product queries.

Where Both RAG and CAG Still Break

The study's sharpest engineering takeaway is what neither architecture solves. On whole-catalog aggregation questions—such as counting how many products met a release-year criterion—CAG accuracy collapsed from 12 of 12 on the small catalog to just 4 or 5 of 12 at 330K tokens, despite having every page in context. RAG fared no better because it only retrieves top-k chunks.

When OpenRouter gave the exact same models two deterministic tools—one for SKU/name lookup and one for structured filtering and sorting—both GPT-6 Luna and DeepSeek V4.1 Flash scored 40 out of 40 on the 330K catalog. For product teams, the implication is clear: context caching does not replace structured databases when queries require counting, sorting, or exact aggregations.

What to Watch Next

  • Whether inference routers adopt cache-aware sticky routing by default so open-weight CAG workloads stop suffering silent cache misses.
  • How teams split hybrid architectures: CAG for static sub-66K knowledge bases (under $1 per 1,000 queries), hybrid RAG for large changing corpora, and tool-calling SQL/API layers for aggregations.
  • Whether long-context pricing cliffs above 256K tokens compress in 2027 as custom inference ASICs expand.

// sources

// WebZona Studio products

Need a product or service that does not exist yet?

Pitch your idea in our "50 Hours" program — every month we build one community idea free for everyone. Or explore our released products.

// comments (0)

// no comments yet.