Consider a situation most teams running RAG in production will recognise. A support team spends two weeks rewriting its system prompt because the assistant keeps answering pricing questions with numbers from a superseded rate card. The prompt was fine all along. The old rate card was still in the index, sitting next to the current one, and nothing about embedding similarity told the retriever which document was authoritative. So the model was confidently reporting the contents of a document it should never have been handed, rather than misreading its instructions.
That pattern sits behind almost every "the AI is making things up" complaint once the RAG applications work is actually live. The model is usually not hallucinating in the sense people mean; it is accurately summarising a passage that retrieval should never have surfaced. Editing the prompt to fix that is like debugging a broken query by changing the font on the results page. The failure happened a step earlier, and instruction-tuning the generation step cannot reach back to fix it.
We assume here that you have already decided RAG is the right architecture for the problem. If you are still weighing it against fine-tuning or a plain prompted model, that decision belongs in a separate conversation. The rest of this article is about a RAG system that exists, is retrieving something, and is nonetheless wrong more often than it should be.
Chunking is a trade between precision and context
Every RAG pipeline starts with a chunking decision, and most start with the same one: split documents into fixed-size windows, embed each window, index it. That works well enough to demo, and then erodes trust once real questions arrive, because the right chunk size depends on what the chunk needs in order to make sense on its own.
Chunks that are too large lose precision. A 2,000-token chunk covering an entire policy section gets retrieved correctly (it is, after all, topically relevant), but the model still has to find the one sentence that answers the question inside a block of text that also contains four adjacent, similar-sounding rules. Retrieval did its job, and generation is now left doing disambiguation that retrieval should have done. It doesn't always get it right.
Chunks that are too small lose context. Split a table from its header, or a clause from the definition it depends on, and you get a chunk that embeds well and means nothing on its own. A line reading "the reduced rate applies for the first 90 days" is a different fact depending on which plan's rate the preceding sentence was describing, and if that sentence lives in a different chunk, the retriever has no way to know they belong together.
There is no universal chunk size that solves this. What helps is chunking along the document's actual structure and carrying enough breadcrumb context into each piece that it stands alone:
# Fixed windows ignore what the document actually is
chunks = [text[i:i+1000] for i in range(0, len(text), 800)]
# Structure-aware chunking carries the context a reader would need
for section in parse_sections(document):
for chunk in split_by_paragraph(section.body, max_tokens=400):
index(
text=f"{document.title} > {section.heading}\n\n{chunk}",
metadata={"doc_id": document.id, "section": section.heading},
)
Across a mixed corpus, a single chunk size will fail somewhere. A legal clause, a support ticket thread and a product spec table each break differently at the same fixed window. Chunking strategy is a modelling decision made per document type, and it deserves the same scrutiny as the choice of embedding model rather than the leftover five minutes at the end of a sprint.
The retriever finds "similar", not "true"
Embedding-based retrieval ranks by semantic similarity, and semantic similarity is a different property from factual relevance. A query about your refund window can retrieve a passage about a different company's refund policy that happens to use nearly identical phrasing, or last year's terms sitting a few cosine-similarity points away from this year's. The vector index has no concept of "current" or "correct". All it knows is what sounds like the query.
The mismatch shows up in a few recognisable shapes:
- Near-duplicate documents with different facts. Two versions of the same policy, one superseded, both indexed, both semantically close to the query. Nothing ranks the current one above the old one unless you've told the system which is which.
- Stale documents nobody removed. An onboarding guide from before a product change, still in the index and still perfectly well written, but now wrong. Retrieval has no sense of expiry unless expiry is metadata you actually filter on.
- Adjacent-but-wrong domains. A query about one product line surfaces a passage about a similarly named one, because the embedding space clusters them together on vocabulary rather than on which one the user actually asked about.
- Short queries landing in the wrong part of embedding space. A three-word query and a 400-word chunk are structurally different objects, and pure vector similarity between them is often a weaker signal than a hybrid of keyword and vector search.
- No re-ranking step, so the right passage is buried at position seven. Vector search returns an approximately ranked top-k. If your pipeline hands that raw list straight to the model, the passage that actually answers the question can sit below three passages that are merely on-topic. A re-ranking pass over the retrieved set (even a lightweight cross-encoder step before generation) routinely reorders results in ways that change the answer.
None of these are exotic edge cases. They are what happens by default when an index accumulates real organisational content over time, and they rarely announce themselves. The model still returns a fluent answer, because a language model writes just as smoothly whether or not the material underneath was the right material.
An index is a data asset, and it needs the housekeeping one implies
Teams that would never let a production database accumulate duplicate, unlabelled, undated records will do exactly that to a vector index, because it looks like an input to a demo rather than a database. It needs the same lifecycle discipline: versioning, deduplication, expiry, and a defined path from "source document changed" to "index reflects that".
Retiring a document from the source system does nothing to the index unless something actively removes or re-embeds it. When this goes wrong, it usually goes wrong quietly. A document is updated in the CMS, the corresponding index entry is never refreshed, and the system now serves two answers to the same question depending on which chunk retrieval happens to favour that day. Reindexing has to be a triggered, monitored step tied to changes in the source of truth, rather than a one-time job run at launch and then forgotten.
Retrieval quality has to be measured
The most common way we see a RAG project go sideways after launch has less to do with any single failure above than with nobody having a way to notice one. Someone reads five transcripts, judges them "pretty good", and ships. A month later a pattern of wrong answers has accumulated, and it gets a shrug instead of a bug report, because there was never a baseline to regress against.
What fixes this is an evaluation set: a fixed collection of real questions with known-correct source documents, run before any change to chunking, embeddings or prompts, and again after. Measure retrieval separately from generation. The question is whether the correct source document appeared in the top-k results at all, regardless of whether the final answer sounds right. A good model answering from a bad retrieval set will produce a readable, wrong answer every time, and prompt polish does not move that number. This groundwork is worth scoping properly before any retrieval code is written, which is why it belongs in an upfront AI consultancy engagement rather than arriving as an afterthought once users start complaining.
With that measurement in place, showing users the source alongside the answer is the second-cheapest reliability improvement available. Citations build trust, and they also give every user a lightweight way to verify answers, which catches retrieval failures your eval set did not anticipate. Real usage always finds questions your test set missed.
Permissions: the same problem with security consequences
Everything above assumes the retriever is allowed to search everything it is searching. That assumption is where retrieval quality and security stop being separate topics. A RAG index built over documents with different access levels (HR records, contracts, one customer's data next to another's) has to enforce the same access control the source systems enforce. That means a filter applied at query time, derived from the authenticated caller's identity rather than anything the query or the model can influence. Skip it, and the system can hand a correct answer to someone who should never have received it, which is how this failure mode turns from a quality problem into an incident. It is the same concern we have written about for agents that read from a permissioned RAG layer and then act on what they find: the retrieval layer is the enforcement point, and no later stage will catch a missed permission check.
Where this lands
Most "the AI is wrong" reports turn out to be retrieval problems, and treating them as prompt problems burns time without improving accuracy. If your system is giving confidently wrong answers, look first at what actually made it into the context. Was the right document chunked in a way that preserved its meaning? Was it still current? Was it ranked above the plausible-sounding distractor next to it, and was this particular user allowed to see it at all? Retrieval quality degrades as your document set grows, changes and accumulates duplicates, so it needs ongoing measurement and a maintenance cadence after launch. If you're running a RAG system that's giving you this kind of trouble, or scoping one and want the retrieval and permission questions answered before the build starts rather than after a bad month, we'd be glad to talk it through.