skip to content
$cat enterprise-rag-fails-at-scale.md

Enterprise RAG Fails at Scale, Not in the Demo

18 min readby MDflowview as .md
A long receding row of near-identical emerald wireframe document pages funnelling into a single bright point of light, while a few pages at the front carry distinct glowing label tags that keep them apart, on a dark terminal-grid background

Your enterprise RAG demo worked. A few hundred documents went in, the answers came back with citations, and everyone agreed to roll it out across the archive.

Then it got worse. Not broken — worse. The answers are still fluent, still cited, still plausible. They are just wrong more often than they were, and nobody can point at the step where that happened, because no step reported an error.

TL;DR — Enterprise RAG degrades on a real archive for a structural reason rather than a tuning one: a single embedding vector has a bounded capacity for how many distinct sets of documents it can single out, and the bound comes from the embedding dimension. On the benchmark built to probe it, today's models fall far short of even that ceiling. The failure does not surface as an error, because a competent agent compensates by querying repeatedly, spawning sub-agents and reading everything — so the first symptom is usually a token bill. Late interaction raises the ceiling, and keyword matching beats both when the words are actually present. MDflow is the authored end of that: markdown documents ranked by human-written folder descriptions, with no parse step in the way.

What enterprise RAG actually is

Enterprise RAG is the pipeline that stands between an agent and the documents a company already has. In the shape almost everyone built, it has five stages: parse the file, cut the text into chunks, turn each chunk into one embedding vector, store the vectors in a database, and rerank whatever the database returns.

In an AI Engineer talk published in November 2026, Aamir Shakir of the retrieval company Mixedbread described that stack bluntly. Every stage throws information away — a table that the parser flattens, a figure boundary the chunker guesses wrong, a page of structure reduced to one point in space — and every stage needs its own vendor and its own evaluation. Mixedbread's internal name for the result is "the Frankenstein stack."

The parse stage has been written about here before, in Document Extraction for AI Agents: a document that ingests incorrectly is worse than one that fails to ingest, because nothing downstream can tell. This post is about the stage after that one, which fails in a different and stranger way.

The capacity limit nobody budgeted for

The embedding stage has a hard ceiling, and it is not a quality ceiling.

In August 2025, Orion Weller, Michael Boratko, Iftekhar Naim and Jinhyuk Lee published On the Theoretical Limitations of Embedding-Based Retrieval, since accepted to ICLR 2026. Connecting known results from learning theory, they show that the number of distinct top-k document sets an embedding can ever return, across all possible queries, is bounded by the dimension of the embedding. Not by the training data. Not by the model. By the dimension.

This is the part that makes it structural rather than solvable by shopping. The bound holds empirically "even if we directly optimize on the test set with free parameterized embeddings" — that is, even when you abandon any pretence of generalisation and fit the vectors directly to the answers, there are combinations of documents no single vector per document can pick out.

The authors then push that best case until it breaks. Fitting vectors freely, they raise the document count until all top-2 combinations can no longer be represented — they call it the critical-n point — and extrapolate a curve from it. The numbers they extrapolate are worth sitting with: around 500,000 documents at 512 dimensions, 4 million at 1,024, and 250 million at 4,096.

Read that generously and it sounds reassuring. A 4,096-dimensional model has headroom for a quarter of a billion documents, so unless you are a hedge fund you are fine.

Except those figures describe an upper bound reached by optimising vectors directly against the answers. Real models are trained to generalise, and come nowhere near it. The authors built a benchmark to show the gap: LIMIT, 50,000 documents and 1,000 queries, of which only 46 documents are relevant to any query at all, in deliberately simple language. On the full version, as the paper puts it, "models struggle to reach even 20% recall@100."

One more result from the same paper matters, because it rules out the easy explanation. They also build a 46-document version: just the relevant documents, nothing else. The paper notes it could be embedded in as few as 12 dimensions, and reports that models still fail on it, which it reads as evidence of "other architectural weaknesses." So this is not a story about corpora being too big. It is a story about which combinations of documents a query might need, and the paper's own reading is that difficulty tracks how interconnected the relevance structure is.

Your archive is mostly near-duplicates

That is the theory. Here is the practitioner's version of the same complaint, and I want to be explicit that joining the two is my reading rather than anything the paper claims — LIMIT's documents are randomly generated, and document similarity plays no part in its account of why models fail.

A single vector has to represent everything a document is in one position. Shakir's example on stage was a financial filing: a complex table of net income, revenue and the rest collapses to one point, and that point mostly encodes this is an earnings report for this company. Which means the same company's earnings report from 1996, from 2000 and from 2026 land in nearly the same place.

An enterprise corpus is made of exactly this. Quarterly reports. Monthly board packs. Weekly status documents. Policy version 4 and policy version 5. The thing that distinguishes any two of them is usually a date, a quarter or a single changed clause — the smallest possible fraction of the text, and therefore the part most likely to be averaged away by a representation that has to summarise the whole document into one position.

Shakir's description of the resulting curve is the one teams recognise: with tens or hundreds of documents the quality is good, and as you scale into production the answer quality degrades significantly. Teams read that as a regression and go looking for what they broke. The useful thing the theory adds is that there may be nothing to find — a representation can simply run out of room to keep two documents apart, and nothing in the stack is built to tell you that is what happened.

Bad retrieval arrives as a token bill

This is the part that makes the failure so hard to see, and it is the most useful idea in the talk.

When retrieval is poor, a competent agent does not stop. It compensates. Shakir's phrasing: it queries aggressively, spins up tens of sub-agents, and fills the context window — because that is the diligent response to a search tool returning a pile of plausible candidates with no usable ranking. For the grep-driven version of this, over a folder of PDFs with no index at all, Shakir put the cost at ten or twenty dollars for one basic question. Treat that as an illustration rather than a measurement.

The consequence is a diagnostic inversion. Everyone watches accuracy, and accuracy is often the last place this shows up, because the compensating behaviour is working — expensively. What moves earlier is spend per answered question, sub-agent count, and the share of the context window occupied by documents that turned out to be irrelevant. Those look like infrastructure metrics. They are retrieval metrics wearing a disguise. The same substitution shows up at the tool boundary, which is where tool output eats your agent's context window.

It runs in the other direction too. Mixedbread's headline case is a hedge fund with over a billion documents that replaced a hand-assembled stack and, on questions where human experts knew and graded the answer, went from 36 percent to 98 percent correct — with LLM spend falling threefold, because most of the tokens had been going into finding and reading rather than answering. Both halves of that are a vendor's account of one unnamed customer, stated on stage and unpublished at the time; it is not a benchmark, and it is not independently checkable. The threefold token drop is the part worth keeping, because it is the mechanism, and the mechanism is what generalises: tokens spent hunting are tokens not spent reasoning.

Shakir's conclusion from it is the sentence to take away. The intelligence is there. The bottleneck is access to your own knowledge — and so what gets unbundled next is intelligence from data, with models becoming interchangeable and access to your corpus becoming the part you own.

What late interaction changes, and what it does not

The architectural answer to a one-vector ceiling is more vectors.

ColBERT (Omar Khattab and Matei Zaharia, SIGIR 2020) introduced late interaction: encode the query and the document separately, keep a vector per token rather than per document, and defer the comparison to a cheap matching step at query time. Because the interaction is deferred, document representations can still be computed offline, which is what makes it a retrieval method and not just a reranker. Against the BERT-based ranking models it is measured on, the paper reports execution two orders of magnitude faster and four orders of magnitude fewer FLOPs per query. Note what it does not claim: its stated comparisons are with BERT-based models and non-BERT baselines, not with single-vector dense retrievers.

ColPali (Manuel Faysse and colleagues, ICLR 2025) pushed it further by skipping the text pipeline altogether: embed the page image with a vision language model into multi-vector form and match with late interaction. Their argument is the one the extraction post makes, in benchmark form — indexing documents by extracted text misses layout, tables, figures and fonts — and they released ViDoRe to measure it. This is also what Shakir demonstrated: embeddings built from the page as rendered, with bounding boxes so an analyst can trace a number back to the pixels it came from.

The honest cost is storage. ColBERTv2 (Keshav Santhanam and colleagues, NAACL 2022) says plainly that token-level multi-vector representations inflate the space footprint by an order of magnitude, and the paper's contribution is a residual compression scheme that claws back 6 to 10 times of it.

And then the complication, from the same paper that identified the limit. On LIMIT, late interaction was better than single vectors and still did not solve the task — the authors' own caption reads "Even multi-vector models struggle." What came close to perfect scores was BM25, the keyword ranking function that grew out of work Stephen Robertson and Steve Walker presented at SIGIR in 1994, and which has no learned semantics at all.

Before concluding that thirty years of retrieval research was a detour, read the next experiment. The authors rebuilt the small version of LIMIT with every item in the corpus replaced by a synonym, cutting the lexical overlap. BM25 dropped by more than 89 percent — ending up, by the paper's own account, worse than most single-vector models on that version — while Qwen3 Embedding dropped 38.9 percent. Their conclusion is the one to carry: lexical models "are not a panacea." They are superb when the words are there and they collapse when the words are paraphrased. Dense retrieval is the reverse.

Which is the actual lesson, and it is not an architecture recommendation. No single representation is the answer, because the limit is on what one representation can carry. The leverage is in making sure the distinguishing words exist somewhere a cheap ranker can find them — and in a company, those words are written by people, not derived from pixels.

Which applications benefit most from getting this right

  1. Financial and investment research. Near-identical filings per issuer per quarter: the canonical near-duplicate corpus, and the one where a wrong quarter is a wrong answer.
  2. Legal and contract review. Template documents whose meaning lives in the clauses that differ from the template.
  3. Regulated operations and compliance. Procedure version 11 versus version 12, where retrieving the superseded one is the failure mode.
  4. Customer support over product history. Release notes and policies that repeat with small deltas across years and SKUs.
  5. Internal engineering knowledge. Runbooks and design documents that describe the same service at six different points in its life.
  6. Any agent with a per-run budget. When retrieval is the thing deciding how many documents get read, retrieval is the thing deciding what the run costs.

How MDflow fits

Be clear about the boundary first. MDflow is not a billion-document retrieval layer and does not parse PDFs. There is no embedding index, no vector store and no page-image model in it. For a corpus like the hedge fund's, you want a specialist retrieval system, and that is an entirely reasonable thing to buy.

What MDflow is, is the other end: the knowledge your team authors, where the distinguishing words can be put in on purpose rather than recovered after the fact.

What lines up today.

  • No parse stage, because the document is already text. Documents are plain markdown. The authoring format and the agent's reading format are the same file, so there is no OCR step, no table flattening and no second lossy conversion on the way out. The failure mode described at the top of this post has one fewer place to happen.
  • Documents are the unit, not chunks. mdflow_get_context ranks and returns whole markdown documents, bounded by a document count and a maximum number of characters per document. A long document can still be trimmed at that limit, so this is not a guarantee that nothing is ever cut — but the corpus is never pre-split into fragments that have to be reassembled, and the agent can always fetch the full document by ID.
  • Folder descriptions are the primary ranking signal. Retrieval ranks each folder's human-written description above folder names and document titles. This is the LIMIT lesson applied: on that benchmark, keyword matching came close to perfect scores precisely because the matching terms were present, so the useful thing to do is make sure they are. A description reading "Quarterly board packs — financial, hiring and pipeline; superseded versions kept, current quarter marked" supplies exactly the vocabulary a near-duplicate corpus otherwise lacks.
  • Hierarchy carries context rather than implying it. A folder or document can be read with its full path and its compounded description — the cascade from workspace down — so the thing that distinguishes two similar documents does not have to be inferred from their bodies.
  • Agents read and write the same workspace. Over the MCP server or the HTTP API with a Personal Access Token on Pro, an agent that learns a distinguishing fact can write it into the description instead of leaving it in a session that ends.
  • The source file can sit beside the extraction. Attachments let a human check a suspicious number against the original document.

Honest gaps. Retrieval is lexical, which means it inherits exactly the weakness the synonym experiment measures: a topic phrased in words that appear in none of your descriptions, names or titles will not rank, and there is no embedding fallback to catch it. Attachments are not exposed over the HTTP API or the MCP server in this release on personal accounts, so an agent cannot open the original file — Team documents have files. Raw .md twins exist for shared pages, not for every document. Files edited in place through the GitHub, Google Drive and OneDrive integrations are not MDflow documents and sit outside workspace search and retrieval entirely.

This is also the scale boundary of an argument made here before. Folder Descriptions as Agent Context argues that for curated, hierarchical knowledge a written description beats an embedding you have to maintain, and it already concedes the condition: below the scale where you genuinely need approximate nearest-neighbour search. The paper above is the sharpest available statement of what happens on the other side of that line, and of why the cheap method wins where it wins.

Where this is headed — direction, not a dated commitment. Aliases and alternate phrasings on a folder description, so the vocabulary gap can be patched by the person who knows the synonyms. Retrieval that can report why a document ranked, so a bad answer can be traced to a bad description rather than guessed at. Attachments reachable over the API and MCP, so the original and the extraction are one hop apart for an agent as well as for a reader.

The bottom line

Enterprise RAG does not fail because the model is not smart enough. It fails because a single vector per document has a bounded capacity for telling documents apart, because today's models sit well below even that bound, and because nothing in the stack raises its hand when you cross the line — somewhere between the demo and the rollout, quietly.

Watch the token bill alongside the accuracy score; the bill usually moves first. Raise the ceiling with architecture if your corpus demands it. And for everything your team writes rather than inherits, spend the five minutes writing down what makes this folder different from the one next to it, because that sentence is worth more to a retriever than another thousand dimensions.

Start free · Connect an AI agent · Read the API docs

Frequently asked questions

Why does enterprise RAG work in a demo and fail in production?

A single embedding vector has a bounded capacity for how many distinct top-k document sets it can express, and the bound follows from the embedding dimension. A 2025 paper accepted to ICLR 2026 extrapolates where that breaks for a 512-dimensional embedding at around 500,000 documents, under best-case conditions real models do not reach. Its benchmark then shows current models falling far short of even that, on a corpus of 50,000 documents.

Is a bigger embedding model the fix for enterprise RAG?

Not on its own. The same paper shows the ceiling follows from the embedding dimension rather than from training data or model quality, and that it still appears when the vectors are optimised directly on the test set. More dimensions raise the ceiling, and the paper reports performance rising with dimension — but its 46-document variant, which it says 12 dimensions could encode, still defeats every embedding model tested.

What is late interaction retrieval?

Late interaction keeps many vectors per document instead of one. The query and the document are encoded separately, so document vectors can be computed in advance, and a cheap matching step then compares them token by token at query time. ColBERT introduced it in 2020 and ColPali extended it to page images in 2024. It raises the ceiling at the cost of storage.

Does keyword search beat vector search for enterprise RAG?

On the benchmark built to expose the dimension limit, BM25 came close to perfect scores while both single-vector and multi-vector models struggled. But the same paper's synonym variant reversed it: BM25 lost more than 89 percent while a dense embedding model lost 38.9 percent. Keyword matching is excellent when the words are present and brittle when they are paraphrased.

How do I tell whether retrieval is my agent's bottleneck?

Watch token spend per answered question alongside accuracy, not accuracy alone. An agent with poor retrieval does not fail loudly: it compensates by querying repeatedly, spawning sub-agents and reading whole documents to find the paragraph it needed. That behaviour is often visible in the bill and in context-window pressure before anyone notices the answers getting worse.

Further reading