# What Are Common RAG Failure Modes?

> The usual ways a RAG system goes wrong, from missing chunks to leaked files, and how to test each part, for your AI interview.

**In short:** A RAG system can fail in the search, in the prompt it builds, or in the model's writing, and the answer often looks confident in every case. Test each part on its own, because each failure has a different fix.

AI and LLM interview question Q133, Retrieval-augmented generation (RAG). Intermediate, very common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/common-rag-failure-modes

## Say it in 30 seconds

RAG means the system searches your documents, then the model writes from what it found. It breaks in a few common places: the search misses the right text, a chunk loses its context, too many chunks bury the answer, or the model makes something up. Files can also leak between clients if nothing filters by permission. I'd test the search and the answer separately, so I know which part to fix.

## Say it in 2 minutes

Think of RAG as two halves. First, a search finds the pieces of your documents that look relevant to the question. Second, the model writes its answer from those pieces. A failure can sit in either half, and from the outside both look the same: a smooth, confident answer that is wrong or has no source behind it.

The search half fails in familiar ways. A piece of text can lose the company or year it belongs to. A meaning-based search can miss an exact contract code. The right document can rank just below the cut-off, so it never reaches the model. The writing half fails too. Too many pieces can bury the one that matters, because models use facts in the middle of a long prompt less well. Two versions of a clause can disagree, and the model may pick the old one.

Some failures are about safety. If one client's contracts sit in a shared index with no permission check, a lawyer can read another client's clause. A poisoned document can also carry hidden instructions. So the team needs a permission filter in code, and a rule that only approved sources go into the index.

My test is to split the system in two. I write down real questions, with the right answer and passage for each. I count how often the right passage is found, then how often the answer uses it correctly. The half that fails more gets the fix first. I keep checking live answers too, because a small test set never shows every failure.

## What is a RAG failure, in plain words?

RAG stands for retrieval-augmented generation. The system first retrieves, or looks up, the most relevant pieces of your documents. Then the model generates its answer from those pieces. A RAG failure is any point where that chain breaks, and the answer ends up wrong, missing or unsafe.

Picture a new hire at a law firm. Asked about one contract, she pulls the wrong file from the cabinet, or the right file with a page missing, and writes her memo as if she had read everything. The memo reads smoothly, so nobody notices. An AI system does the same when it searches 40,000 contracts and builds an answer from a clause that has since been replaced.

- **Chunk:** A piece of a document, cut small enough for the search to handle.
- **Top K:** How many chunks the search passes on. The team chooses K.
- **Reranker:** A second model that re-sorts the chunks by how well they fit.

## Where does a RAG answer break?

A RAG answer passes through three stages after the question: the search, the prompt it builds and the model's writing. Each one can fail. Meaning-based search matches ideas rather than exact words, so it can miss a contract code. The chart shows the common causes. The orange boxes are the failures, and the green box is the habit that catches them: test each stage alone.

*Diagram, Where a RAG answer breaks: Left to right: the question, the search, the prompt it builds, the model's writing, and a test at the end. Orange boxes show the common causes at each stage. The green end is testing each stage alone, which shows which part broke.*
1. The question goes to a search, which returns a few chunks.
2. The chunks that survive are packed into the prompt.
3. The model reads the packed prompt and writes its answer.
4. Testing each stage alone shows which part broke.

1. **The answer is not in the files:** Nothing in the index answers the question, but the model still writes a reply. A 2024 experience report from three case studies lists this as one of seven failure points.
2. **A chunk lost its context:** A passage saying revenue grew 3% has no company or year attached. Anthropic says traditional RAG removes context when it encodes information, so the search can miss the right passage.
3. **Exact codes get missed:** Meaning-based search is strong on ideas and weaker on exact strings such as a contract code. Anthropic notes that keyword search suits unique identifiers, so pair the two.
4. **The right file ranks just too low:** The search keeps only the top K results. The answer can sit in a document that ranked just below that cut-off, so the model never sees it.
5. **Too many chunks bury the answer:** Passing dozens of chunks can push the one that matters into the middle of the prompt. A 2023 study found models use facts there less well than at the start or end.
6. **Noisy or conflicting sources:** Contradicting or noisy text can stop the model from pulling out the right answer. OWASP's 2025 list says knowledge conflict errors can occur when data from multiple sources contradict each other.

> **Tip:** Documents are inputs too. OWASP's 2025 list (its 2026 list keeps this risk as LLM09:2026) says poisoned data can come from insiders, prompts, data seeding or unverified providers, so check what goes into the index.

## How do you find out which part broke?

Build a small test set first. Use real questions from the team, and write down the correct answer and the right chunk for each one before you run anything. Then test the two halves on their own.

*Diagram, Testing the two halves of RAG: The test set runs through two checks. The first counts how often the search finds the right chunk. The second asks whether the answer used that chunk correctly. The weaker half gets the fix first.*
1. Each question runs through the search on its own.
2. The chunk the search found for each question goes to the answer check.
3. The weaker half gets the fix first.

Here is a worked example with made-up numbers. The legal search gets 200 questions. The right chunk turns up in the top results for 170 of them, so the search finds it 85% of the time. Of those 170, the answer uses the chunk correctly in only 120, about 71%. The writing half is the weaker one, so the prompt and the model's instructions get the work first.

- **Search failed: The chunk never showed up.** Fix the chunks and the search: add context to each chunk, add keyword search, and rerank.
- **Writing failed: The chunk showed up, then got misused.** Fix the prompt, the number of chunks and the instructions to the model.

Anthropic said in September 2024 that its contextual method can reduce failed retrievals by 49%, and by 67% when combined with reranking. Those are one vendor's results across several test datasets, so measure your own.

### How would you stop one client's files reaching another client's answer?

A mid-size law firm puts 40,000 contracts from 900 clients into one shared index. A lawyer on one client's matter asks about a liability cap, and the answer quotes a clause from a different client. The search did its job, so no log shows an error.

- **Without a filter: One shared pool.** Everyone's chunks sit together, and the search ranks them by meaning alone.
- **With a filter: Only the client's chunks.** The search runs only over chunks tagged with the lawyer's matter, checked in code.

> "In multi-tenant environments where multiple classes of users or applications share the same vector database, there's a risk of context leakage between users or queries" (OWASP, 2025 list)
>
> "A permission-aware vector database should be implemented to restrict access and ensure that only authorized groups can access their specific information" (OWASP, 2025 list)

1. **Tag every chunk with its owner:** Each chunk carries its client and matter when it is indexed, so the filter has something to check.
2. **Filter before the search runs:** The app checks the lawyer's permissions in code, then searches only the chunks they may see.
3. **Test with another client's question:** Ask about a client the lawyer cannot see, and check that the answer says it has no information.

> **Tip:** A rule in the prompt, asking the model to use only this client's files, can be ignored. Put the check in code.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] The chain: a search first, then the model writes from what it found.
- [ ] The main failures: missed text, lost context, buried answers, and noisy or conflicting sources.
- [ ] Test each half on its own, with real questions and known answers.
- [ ] A fix that matches each failure, such as keyword search for codes and a reranker.
- [ ] Permissions checked in code before the search, never left to the prompt.
- [ ] Honesty: no setup is perfect, so keep checking live answers.

**Common traps**

- Trap: "The model is the problem, so use a bigger one." Better: Many failures happen in the search, before the model writes. Test the search first.
- Trap: "More chunks means a better answer." Better: More chunks can bury the right one. Rank well and pass fewer, better chunks.
- Trap: "If the answer sounds sure, it is right." Better: Fluent wording hides failures. Check the answer against its source chunk.

## Can you spot the broken chunk?

**Spot the broken chunk:** A lawyer asks what the liability cap is in MSA-2291. Which retrieved chunk could give a confident wrong answer?

A. This agreement, MSA-2291, sets the liability cap at 2 million dollars in clause 14.2.
B. The liability cap is 1.5 million dollars.
C. Under MSA-2291, invoices are payable 30 days after receipt.
D. Notices must be sent in writing to the registered office.

**Answer:** B. The second chunk gives a number but never names its agreement, so the search can pull it for any client. Chunks need their own context, such as the agreement name and clause, added before indexing.

**Quick check:** A lawyer searches for the contract code MSA-2291, and the search returns nothing with that code. Which change helps most?

A. A longer system prompt
B. Add keyword search next to meaning-based search
C. A bigger model
D. A setting that makes the model less random

**Answer:** B. Meaning-based search can skip exact codes, and keyword search matches the exact text. Prompts, model size and the randomness setting do not change what the search finds.

## Can you answer these from memory?

**Flash cards**

- **What are the two halves of RAG?** A search that finds chunks, then a model that writes from them.
- **What is a chunk that lost its context?** A passage with no company, date or clause name to say what it covers.
- **What misses exact codes?** Meaning-based search. Add keyword search beside it, a classic exact-word method called BM25.
- **Why do answers fail in a long prompt?** Models use facts at the start and end better than facts in the middle.
- **How do you find the broken part fastest?** Test the search and the answer separately, with known answers.
- **What stops one client's files reaching another?** A permission filter in code, applied before the search runs.

## Likely follow-up questions

- Q112 Walk through a RAG pipeline end to end. https://designervenkat.online/interview/ai/rag-pipeline-end-to-end
- Q134 How do you reduce hallucinations in RAG? https://designervenkat.online/interview/ai/how-to-reduce-hallucinations-in-rag
- Q138 RAG vs long context: which to use? https://designervenkat.online/interview/ai/rag-vs-long-context
- Q140 How do you enforce access control in RAG? https://designervenkat.online/interview/ai/how-do-you-enforce-access-control-in-rag
- Q155 Build a minimal RAG pipeline. https://designervenkat.online/interview/ai/build-a-minimal-rag-pipeline

## Learn it in depth

- [RAG & Dynamic Filters](https://designervenkat.online/learn/ai-engineering/rag-and-dynamic-filters)
