
Your RAG Found the Right Document. The Answer Can Still Be Wrong
Research shows a model can do worse when the right document sits in the middle of its context, and that RAG systems fail in seven distinct ways. Here is how to test retrieval and generation separately, and which Amazon Bedrock features help with each half.
One experiment worth knowing
In 2023, researchers gave a language model 20 retrieved documents and a question. Exactly one document had the answer. They only changed where that document appeared.
- Answer in the 1st document: 75.8% accuracy
- Answer in the 10th document: 53.8%
- No documents at all: 56.1%
Same question. Same document. Only the position changed, and the model did worse than when it was given nothing.
This comes from "Lost in the Middle" (Liu et al., TACL), tested on GPT-3.5-Turbo. Models have improved since then, and newer ones handle long inputs better. But the lesson still matters for anyone building RAG: retrieving the right document is not the same as using it.
Where RAG systems actually fail
"Seven Failure Points When Engineering a Retrieval Augmented Generation System" (Barnett et al., CAIN 2024) studied three RAG systems in research, education and biomedical question answering, and listed seven ways they failed:
- Missing content: the answer isn't in the documents, but the system answers anyway
- Missed the top-ranked documents: the answer exists but ranks too low to be returned
- Not in context: the right document was retrieved but didn't make it into the final context
- Not extracted: the answer is in the context, but the model doesn't pull it out
- Wrong format: the model ignores the requested format, such as a table or a list
- Incorrect specificity: the answer is too general or too specific
- Incomplete: the answer is correct but leaves out information that was available
Notice the split. The first three are about what reaches the model, so they are retrieval problems. The last four happen during generation. "Lost in the Middle" is a clear example of failure point 4.
The paper's main lessons: validating a RAG system is only really possible during operation, and robustness is built over time, not designed in on day one.
Split the problem before you fix it
A reader's comment on my previous article, about agent reliability, made a point that applies here too: classify failures first, because different failures need different fixes. For RAG, the most useful split is retrieval vs. generation. If you only look at the final answer, you can't tell which one broke.
This mapping is my own reading of the paper, but Amazon Bedrock supports both halves of that split:
Where it fails | Failure points | Question to ask | Amazon Bedrock feature |
|---|---|---|---|
Retrieval | 1, 2, 3 | Is the evidence in what the model actually sees? | Passages-only mode, retrieve-only evaluation (context relevance, context coverage) |
Generation | 4, 7 | Did the answer use the evidence, and all of it? | Retrieve-and-generate evaluation (correctness, completeness, faithfulness) |
Generation | 5, 6 | Is the answer shaped the way the user needs? | Helpfulness, logical coherence, custom metrics |
Passages-only mode. On November 9, 2026, AWS added new modes to Amazon Bedrock Managed Knowledge Base, selected with the
maxAgentIteration parameter: 0 returns matching passages with no model call, 1 is single-shot RAG (one retrieval, one answer), and 2 to 5 is agentic, multi-step retrieval. Mode 0 is a cheap way to inspect retrieval on its own.RAG evaluation. Bedrock evaluation jobs can score retrieval only (context relevance, plus context coverage, which needs ground-truth answers) or the full retrieve-and-generate flow, with metrics such as correctness, completeness, faithfulness, citation precision and citation coverage. If your pipeline was built outside Bedrock, you can bring your own responses and retrieved contexts.
One caution about the judge. These metrics are scored by an LLM acting as a judge. Zheng et al. (NeurIPS 2023) found that strong judges like GPT-4 agree with human preferences over 80% of the time, about the same level at which humans agree with each other. They also documented position, verbosity and self-enhancement biases. Use the scores, but still review a sample by hand.
More documents, more steps, better answers?
Not necessarily. In "Lost in the Middle", using 50 retrieved documents instead of 20 improved GPT-3.5-Turbo by only about 1.5 points: the reader model saturated long before retrieval did.
AWS's guidance for the new modes points the same way: lower values are faster and more predictable, so start low for simple questions and test higher values against representative questions instead of assuming they help. That echoes the multi-agent research from my last article: more steps don't automatically mean better answers.
A short checklist
- Build a small test set with questions and ground-truth answers, and keep adding real user questions.
- Test retrieval alone first. If the evidence isn't there, no prompt will fix it.
- Check where the best evidence lands in the context. More passages are not automatically better.
- Evaluate generation for faithfulness and completeness, and spot-check the judge.
- Start with single-shot retrieval. Move to agentic retrieval only when your tests show it helps.
Conclusion
A RAG system can retrieve the right document and still give the wrong answer. Testing retrieval and generation separately turns "the answer is wrong" into a problem you can actually fix.
I've been building a small RAG project with LangChain, and splitting the evaluation this way is what I'm applying next. I haven't used Bedrock Knowledge Bases in production yet, so I'm curious:
When your RAG gives a wrong answer, how do you find out whether retrieval or generation failed?
References
- Liu, N. F. et al. (2024). Lost in the Middle: How Language Models Use Long Contexts. Transactions of the Association for Computational Linguistics. https://arxiv.org/abs/2307.03172
- Barnett, S. et al. (2024). Seven Failure Points When Engineering a Retrieval Augmented Generation System. CAIN 2024. https://arxiv.org/abs/2401.05856
- Zheng, L. et al. (2023). Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena. NeurIPS 2023 Datasets and Benchmarks. https://arxiv.org/abs/2306.05685
- AWS Machine Learning Blog. Single-shot and agentic retrieval with Amazon Bedrock Managed Knowledge Base (November 9, 2026). https://aws.amazon.com/blogs/machine-learning/single-shot-and-agentic-retrieval-with-amazon-bedrock-managed-knowledge-base/
- Amazon Bedrock User Guide. Metrics for RAG evaluation. https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-evaluation-metrics.html
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article