OpenRouter Measured RAG vs CAG: Feed Small Docs Whole, Retrieve Big Docs Hybrid — and Let Tools Do the Counting
RAG or CAG? OpenRouter stopped arguing and measured it: the same 40 questions at three catalog sizes (9K/66K/330K tokens) on GPT-6 Luna and DeepSeek V4.1 Flash. CAG wins on accuracy at every size (40/40 small, 31/32 large); hybrid RAG wins on cost once the catalog grows (CAG hits $8.70 vs $0.14 per 1,000 questions on Luna). Pure-embedding RAG scores 0 on SKU lookups and 0 on two-hop questions — and neither method can count across a catalog. Tools can: 40/40.

When you connect a chatbot to your own documents, there are two mainstream approaches. The first is RAG (retrieval-augmented generation): when a question comes in, search the documents for the few most relevant passages and send only those to the model. The second is CAG (cache-augmented generation): put all of your documents at the start of the prompt, send the whole lot with every question, and rely on prompt caching to keep the repeated part cheap. The argument between the two has run for two years, mostly at the level of concepts — RAG is cheaper, CAG is more accurate, each side asserting without numbers. On December 2, 2026, OpenRouter published a measured comparison that turns the argument into an experiment you can do arithmetic with.
The experimental design is clean. OpenRouter built a fake product catalog for an online outdoor gear store, which has the advantage that the right answer to every question is known in advance — no grading by feel. The catalog comes in three sizes: 80 products (8,871 tokens), 600 products (66,053 tokens), and 3,000 products (329,303 tokens). Forty questions fall into three kinds: 16 single-fact questions (for example, "What is the warranty, in years, on product CX-15350?"), 12 two-hop questions (for example, "What is the warranty, in years, on the backpack that the Fjord Ridge Trekking Pole lists first under Compatible with?" — the answer is on a different page), and 12 whole-catalog questions (for example, "How many headlamps were first sold in 2024?" — the answer is spread across hundreds of pages). The answering models were GPT-6 Luna and DeepSeek V4.1 Flash, both with reasoning effort set to "low." Everything ran through the OpenRouter API on November 8, 2026. The headline first: CAG was the most accurate at every size; RAG cost much less once the catalog got large; and neither approach could count across the whole catalog — in the end, giving the model tools won.
Look at the accuracy table first. The numbers are questions answered correctly out of 40, with GPT-6 Luna first and DeepSeek V4.1 Flash second. Small catalog (80 products): plain RAG 23/23, hybrid RAG 26/26, CAG 40/40. Medium catalog (600 products): plain RAG 10/10, hybrid RAG 17/17, CAG 31/35. Large catalog (3,000 products): plain RAG 9/9, hybrid RAG 17/16, CAG 31/32. Three findings deserve to be pulled out separately. First, CAG was the most accurate at every size, beating hybrid RAG by 14 to 18 questions, mostly by answering two-hop questions. Second, plain RAG's score falls off a cliff as the catalog grows, from 23 down to 9; hybrid RAG, which adds keyword search, holds steady around 17 and stops falling. Third, CAG scores a perfect 40/40 on the small catalog but drops to 31/32 on the large one — having every document in the prompt is not a cure-all either, and once the documents pile up, the model itself gets confused.
Splitting the large catalog's results by question type makes it clearer where each method breaks. Single-fact questions (16): plain RAG 8/8, hybrid RAG 16/16, CAG 16/15. Two-hop questions (12): plain RAG 0/0, hybrid RAG 1/0, CAG 11/12. Whole-catalog questions (12): plain RAG 1/1, hybrid RAG 0/0, CAG 4/5. This table actually tells three different stories, and each is worth telling separately. The single-fact story is about keyword search: plain RAG found all 8 questions asked by product name and none of the 8 asked by product code (SKU). Hybrid RAG, adding BM25 keyword search, answered all 16. The two-hop story is about retrieval happening only once: the question names the trekking pole, so retrieval finds the pole's page, but the answer is on the backpack's page, which the question never names, so that page never looks relevant and is never sent. CAG has no such problem, because every page is already in the prompt and the model can follow the chain from pole to backpack to warranty itself. The whole-catalog story is about counting: even with every page in hand, CAG answered only 4 or 5 of 12 on the large catalog — asking a language model to count across hundreds of pages is asking too much of it.
The plain-RAG SKU failure is worth expanding, because it punctures a widespread misunderstanding: embedding search is good at "similar in meaning" and bad at "identical in characters." A product code like CX-15350 carries almost no meaning, so in embedding space it is a string of noise. On the large catalog, the right page ranked between about 690th and 2,384th out of 3,000, while plain RAG only takes the 30 closest pages and has a reranker keep the best 5 — the right page never even made the candidate list. When the catalog was small, the problem was less visible: with 80 products, the right page was often still in the top 30, and plain RAG answered 5 of the 8 SKU questions. As the catalog grew, the right page drowned. Keyword search fixes this. BM25 ranked the right page first for every SKU question, so hybrid RAG answered all 16 single-fact questions at every size. The conclusion is direct: keyword search is not a legacy method, it is the load-bearing beam in a RAG system. Any RAG setup that uses embeddings alone will fail in exactly the same way on product codes, model numbers, people's names, and code identifiers — anything where the question is an exact string rather than a meaning.
The two-hop failure is structural, not something tuning can fix. Retrieval runs once, using the question. The question names the Fjord Ridge Trekking Pole, so retrieval finds the pole's page; the warranty is on the backpack's page, and the backpack's name appears only in the pole's page under "Compatible with" — the question never mentions it, so the retrieval system has no reason to look for it. On the large catalog, the backpack's page ranked between 18th and 799th and was never sent. Hybrid RAG answered 1 of 12 two-hop questions on GPT-6 Luna and 0 on DeepSeek — effectively a wipeout. CAG answered 11 or 12, because it does not need retrieval: with every page in the prompt, the model follows the chain itself. The more general lesson is that RAG's bottleneck is not whether the model is smart enough, but that the retrieval step has too little information — when the question contains no clue about where the answer lives, even the smartest model can only stare at five irrelevant pages. The fix is either to retrieve in multiple hops (find the pole's page, then search again using its contents for the backpack's page) or to skip retrieval altogether. OpenRouter's experiment did not test multi-hop retrieval, but it did test the "skip retrieval" path, and the result is CAG's 11/12.
Now the cost table, in average cost per 1,000 questions, including embedding and reranking. On GPT-6 Luna: small catalog, plain RAG $0.15, hybrid RAG $0.13, CAG $0.13; medium catalog, $0.15, $0.14, $0.92; large catalog, $0.15, $0.14, $8.70. On DeepSeek V4.1 Flash: small, $0.20, $0.17, $0.73; medium, $0.20, $0.20, $4.09; large, $0.22, $0.21, $21.92. RAG's cost barely moves with catalog size, because each question sends only 650 to 710 tokens no matter how many documents there are; CAG's cost follows the catalog, and on the large catalog Luna's CAG costs 62 times hybrid RAG ($8.70 against $0.14), and DeepSeek's more than 100 times ($21.92 against $0.21). On the small catalog the two tie, with CAG even slightly cheaper; past about 60K tokens, the bill starts tilting toward RAG. One easily missed detail: the first CAG request costs more, because it writes the catalog into the cache — $0.08 on the large catalog, on both models — and the CAG numbers include that first request, while the RAG numbers leave out the one-time cost of creating embeddings (embedding the whole catalog cost less than a cent). GPT-6 Luna also charges more for long prompts: above 272K tokens, its input and cached prices double, and the large catalog's 329K tokens land squarely past that line.
Why CAG cost so much more on DeepSeek deserves its own section, because it shows that the real difficulty of caching is routing, not pricing. DeepSeek V4.1 Flash is served by more than 30 provider endpoints on OpenRouter, and with default routing, CAG requests were spread across 11 providers, each keeping its own cache. Many requests landed on a provider that had not cached the catalog yet, so only 75 percent of the input was cached on the large catalog. GPT-6 Luna went to OpenAI alone and cached 97 percent, so it had no such problem. OpenRouter's fix is a session_id: a label, up to 256 characters, sent in the request body or the x-session-id header, that lets sticky routing send related requests to the provider that already holds the cache. By default, sticky routing decides which requests are related by looking at "the first system (or developer) message and the first non-system message." In CAG, the first non-system message is the question, which changes every time — so each question looks unrelated to the last. Default sticky routing also "only activates after a cache hit is detected," meaning requests keep spreading across providers until one of them happens to find the catalog already cached. Sending the same session_id with every question collapses DeepSeek CAG on the large catalog from 11 providers to 1, lifts the cached share from 75 percent to 97 percent, and cuts the cost of lookup questions (the 28 single-fact and two-hop questions) about 3 times — from $20.16 to $6.31 per 1,000 questions. Leave out the first request, which writes the cache, and lookup questions cost about 7 times less, $2.69 instead of $18.02 per 1,000. Total cost fell less, from $21.92 to $15.85, because the counting questions made DeepSeek think for up to three minutes each, and that thinking is billed as output, which caching cannot make cheaper.
The experiment also tested a third routing setup: session_id plus provider sorting by price, so requests go to the cheapest provider. Lookup questions then cost $1.97 per 1,000, ten times less than default routing — but accuracy fell from 38/40 to 30/40. The cheapest provider ran an fp4 version of the model, storing the model's numbers at lower precision. One run is not enough to say whether the lower precision caused the drop, and OpenRouter says so itself. If you want to avoid lower-precision versions, use the quantizations filter. The comparison is representative: every tier of cost optimization has a price, and the price of the previous tier was cache-hit rate, while the price of this tier is model precision. The right way to save money is not to drill straight to the cheapest option, but to measure how much accuracy each tier costs and then decide whether the trade is worth it. OpenRouter's own check is to read cached_tokens in each response to confirm the cache is working, and to try CAG with a constant session_id if your documents fit in the context window.
Finally, the whole-catalog counting questions — the most interesting section of the study. RAG cannot answer them, because it sends only 5 pages and the answer needs hundreds. CAG has every page, answered all 12 on the small catalog, and only 4 or 5 of 12 on the large one — the model loses count somewhere in the hundreds of pages. The approach that answered all 40 questions was a third one: give the model two tools that query the catalog directly, one to look up a product by SKU or name, and one to filter and sort the catalog. With those tools, both models answered all 40 questions on the large catalog. The weight of that result is considerable: it suggests the "retrieval or full context" debate may be asking the wrong question. For questions that need aggregation, counting, or filtering, the answer is neither better retrieval nor a bigger prompt, but letting the model query structured data. RAG and CAG both operate inside the idea of "turn documents into text and feed them to the model," while tool use steps outside it — the model never has to read 3,000 pages, it only has to ask "how many headlamps were first sold in 2024" and let the database count.
Here is a decision table a builder can use directly. Documents are small (a few thousand to ten or twenty thousand tokens), rarely change, and the questions are mostly "what does page X say": use CAG — it costs about the same as RAG, it is more accurate, and fix the session_id while you are at it. Documents are large (tens of thousands of tokens or more) or change often: use hybrid RAG — embeddings plus keyword search plus a reranker — whose cost barely rises with scale. Do not use pure embedding RAG on its own; exact-string questions like SKUs will break it. Questions involve "how many," "list all," or "sort by" — aggregation and counting: do not agonize between RAG and CAG, give the model tools and let it query structured data. Be careful when documents change and the cache has to follow: CAG's cache is keyed on the prompt prefix, so every edit invalidates it and forces a rewrite, and the more often documents change, the worse CAG looks. One more piece of background comes from OpenRouter's companion study published the same day: across the 354 paid text models in its catalog, the median list price is $0.41 per million input tokens and $1.93 per million output tokens, or $0.09 and $0.50 when weighted by real traffic; caching made the second GPT-6.1 Sol call 72 percent cheaper than the first. The room to cut costs is real — the point is to measure the real numbers on your own path first.
The study's limits should be stated plainly, and OpenRouter states two of them in its methodology section. First, the catalog is synthetic, and every page follows the same template — the template flatters BM25 (uniform code formats make keyword search trivially accurate) and hurts embeddings (pages that look alike make small differences in codes harder to distinguish in vector space). Real documents are messier, and the numbers will move in both directions. Second, each setup ran once on two models, so small differences should be treated as noise. DeepSeek's score on the whole-catalog questions, for example, ranged from 4 to 10 of 12 across the three routing setups, and OpenRouter says explicitly that it cannot tell whether routing caused the difference. So read this article's numbers for direction and order of magnitude, not to two decimal places: CAG is more accurate, RAG is cheaper, keyword search is indispensable, counting needs tools, and caching needs routing — those five hold. Whether the gap is 62 times or 100 times, 38 of 40 or 30 of 40, will change with a different set of real documents and a different model.
One methodological detail is worth adding for readers who want to reproduce the study. The RAG pipeline was: each product page is one chunk; embeddings came from voyage-4-lite, and embedding the whole catalog cost less than a cent; plain RAG took the 30 pages with the closest embeddings, hybrid RAG took the 15 closest by embedding and the 15 best by keyword search, and rerank-3-lite then kept the best 5 for the model. For CAG, the whole catalog went into the system message and the question into the user message, with the catalog identical in order and content on every request — the order must not change, or the cache will not hit. Reasoning effort was set to low, which also keeps the cost numbers on the low side. Reproduce it with this configuration and the numbers should land in the same range; change the embedding model, the reranker top-k, or raise the reasoning effort, and the results will move — but "hybrid retrieval fixes SKUs, tool use fixes counting" is unlikely to change.
This study speaks directly to VibeFix readers, because "add document Q&A to your product" is one of the most common features in vibe-coded projects — a support bot, a product help center, an internal knowledge base — and the implementation choice is almost always RAG or CAG. Many projects pick RAG first, because that is what the tutorials teach, and then stumble in two places: users ask about a product code, an order number, or an error code, and retrieval never finds it; or users ask "how many tickets are there this month," and the model invents a confident number. This study is effectively a shopping list for those projects: ask how big the documents are, how often they change, and what shape the questions take, then pick the route — small and stable documents go whole into the prompt, large and living documents go through hybrid retrieval, and counting and aggregation questions get a tool that can query data, not a language model asked to count. Every item on the list comes with a reproducible number behind it rather than a "best practice" slogan. For an independent developer, that is worth more than ten more conceptual articles.
Boundary note: this article covers only OpenRouter's December 2, 2026 RAG vs CAG study — three catalog sizes, 40 questions, GPT-6 Luna and DeepSeek V4.1 Flash, run on November 8, 2026 — and its cost and routing conclusions. It is distinct from previously published articles as follows: the November 6, 2026 OpenRouter Auto Router and Auto Code article covers model routing and a code-specialized router, not an accuracy and cost comparison of RAG and CAG; the November 12, 2026 OpenRouter six-model agent-loop article covers guardrails for tool calls, not the choice between retrieval and caching; and the October 2026 LlamaIndex OpenDocRouter article covers packing several models into one API, unrelated to this study's retrieval methods. OpenRouter's same-day token-cost study (median $0.41/$1.93 per million tokens across 354 models) is cited only as cost background and is not expanded on here.
There is a second economics lesson hiding behind the CAG numbers, and it comes from OpenRouter's companion study on token pricing, published the same day. Of the 354 paid models in its catalog, 259 list a cache-read price at a median of 12 percent of the normal input price, and 72 list a cache-write price at a median of 1.25 times normal input. In other words, CAG's entire business case rests on the gap between those two numbers: you pay a 25 percent premium once to write the documents into the cache, and then you pay 12 cents on the dollar every time you read them back. That is a good deal if the same documents are read many times, and a bad deal if they are read once — which is exactly why the small catalog ties RAG on cost while the large catalog loses by 62 times. The same study found that caching made the second GPT-6.1 Sol call 72 percent cheaper than the first, and that caching plus the flex tier cut a triage request from $8.21 to about $1.06 per 1,000 tickets. The lesson generalizes beyond this one experiment: before choosing CAG, estimate how many times each cached token will be read. If the answer is "dozens," CAG is cheap. If the answer is "once or twice," you are paying the write premium for nothing, and RAG wins on cost without even trying.
Document change is the other half of the CAG story, and the study's catalog — fixed, frozen, never edited — is the most favorable possible case for it. In real products, documents change: prices move, pages are added, policies are rewritten. CAG's cache is keyed on the prompt prefix, so any edit to the documents changes the prefix and invalidates the cache, forcing a full rewrite at the cache-write price. A catalog that changes daily makes CAG pay the write premium daily; a catalog that changes hourly makes it nearly pointless. RAG has the opposite shape: an edit means re-embedding one page, for less than a cent for the whole catalog in this study's numbers, and the rest of the index is untouched. This is why the study's decision rule — small and stable documents favor CAG, large or changing ones favor RAG — is really a statement about two different cost curves crossing. The crossing point in this experiment sits somewhere between 9K and 66K tokens, where CAG goes from $0.13 to $0.92 per 1,000 questions while hybrid RAG stays at $0.14. On your own documents, the crossing point will be somewhere else, and the only way to find it is to measure it — which is why OpenRouter's advice to read usage.cost from a sample of real requests is the most actionable sentence in either study.
Step back, and the study points at a bigger shift: retrieval is becoming a spectrum rather than a choice between two methods. At one end sits plain RAG — cheap, scalable, blind to exact strings. Next comes hybrid RAG, which patches the blindness with keyword search. Then CAG, which trades money for accuracy on small, stable document sets. Then tool use, which stops feeding documents to the model entirely and lets it query structured data instead. And beyond that sits the agentic pattern OpenRouter tested in its November study, where models loop with tools and need guardrails to keep them from calling in circles. The direction of travel is consistent: the model sees less raw text and does more targeted asking. The interesting question for builders is not "RAG or CAG" but "which step on the spectrum does each question type need" — a lookup needs hybrid retrieval, a synthesis needs full context, a count needs a database query, and a multi-step task needs an agent with tools. OpenRouter's own product direction follows the same arc: embeddings and rerank endpoints for the retrieval end, prompt caching and sticky routing for the middle, and routers that pick models and providers per request. The study is, among other things, a field manual for that spectrum, with numbers attached to each step.
The DeepSeek routing result deserves one more paragraph, because it generalizes beyond CAG. Open-weight models on OpenRouter are served by many providers at different prices — on November 16, DeepSeek V4.1 Flash had 37 endpoints, with standard endpoints ranging from $0.05/$0.20 to $0.45/$1.80 per million tokens, about a ninefold spread on input — and each provider keeps its own cache, its own quantization, and its own price. Default routing spreads requests across them, which is good for availability and bad for anything that depends on state, like a cache. The session_id fix is really a way of saying "these requests belong together," and it works for any workload where consecutive requests share a large prefix, not only for CAG. The companion study adds two more levers in the same direction: the :floor suffix, which sorts providers by price and cut DeepSeek triage requests from $1.62 to $0.55 per 1,000, and the quantizations filter, which keeps a cheap fp4 endpoint from silently answering with lower precision. The practical checklist that falls out of both studies is short: send a constant session_id for related requests; read cached_tokens in every response to confirm the cache is actually working; check which provider answered, and what it charged, before assuming the cheapest route is the best one. Caching is not a switch you flip; it is a routing discipline, and the 75 percent versus 97 percent cache-hit gap in this experiment is the difference between doing it and merely enabling it.
OpenRouter's study does not end the RAG-versus-CAG argument, and it does not try to. What it does is replace slogans with measurements: 40 questions, three catalog sizes, two models, one table of accuracy and one table of cost. Any team building document Q&A can rerun the same design on its own documents in an afternoon — build a small catalog with known answers, ask the same questions three ways, and read the bill. The answer that comes back will be specific to those documents, and that specificity is the point. There is no universal winner between retrieval and caching, only a winner for your documents, your questions, and your volume — and now there is a published method for finding it.

Comments (0)
Sources
Related articles
Three OpenAI image models stopped accepting requests on December 1, 2026. On December 11, the GPT-5 family and o3 shut down. On December 15, self-serve fine-tuning creation closes. This is not a single vendor's cleanup: between November 30 and December 11, thirteen models or services across OpenAI, Anthropic and Google end or re-route. The article maps every replacement, the notice periods, and a five-step checklist — verified against OpenAI's official Deprecations page.
df says the disk is full; it never says who took the space. du does. This guide runs every command for real on GNU coreutils du 9.4: -sh totals, -d drilling, block rounding (a 100-byte file takes 4.0K), sparse files (100M apparent, 0 on disk), -b vs --apparent-size, --exclude, and the three reasons du and df disagree — plus a full-disk investigation flow.
Which process is eating memory, who started whom, which one died but was never collected? ps answers all of it with one snapshot. This guide runs every command for real on procps-ng ps 4.0.4: default selection, Unix vs BSD vs GNU options, -o custom columns, --sort, --forest trees, the full STAT alphabet, a live zombie demo, and headerless output for scripts — plus the four classic traps.