Problem
Teams that build a RAG chatbot over mixed documents (manuals, product specifications, news) get a prototype quickly and weak answers soon after. The model answers from the chunks it is given, so a RAG system is only as good as its retriever. Two failures dominate: the needed fact is not in the retrieved chunks, so the model invents an answer, or the fact is buried in irrelevant text and the model mixes sources. Evaluation is hard too, because ground truth takes time and human effort to collect.
Example from the article: a manufacturer's chatbot for product specifications could not find the shelf life of product XYZ, because the product name appeared only in the first chunk of the document.
Solution in brief
Measure the retriever on question-to-chunk pairs, then use a symptom-to-fix table: hybrid search, chunk titles, neighbor or parent chunks, query rewriting with metadata filters, and a custom embedding as the last resort. If retrieval is fine, fix generation with prompt guardrails and verifiable quotes.
Questions this case answers
- How to locate the failing stage of a retrieval-augmented question answering system when only a few labeled question-chunk pairs exist
- How to raise retrieval recall and precision over long, heterogeneous documents whose chunks lose their identifying context
- How to keep a generative answer grounded in retrieved sources and let users check the claims
- How to find out whether a weak RAG chatbot fails in retrieval or in generation, and which fix to try first?
Tools and methods
- Amazon Bedrock, Claude — model calls; a small model such as Claude Haiku does query rewriting
- OpenSearch Serverless — vector store with k-NN, keyword match and metadata filters
- Hybrid search — weighted mix of semantic and keyword scores
- RAGAS, LlamaIndex, RefChecker — FM-based evaluation and hallucination detection libraries
- FlagEmbedding (BGE) — fine-tuning of an open embedding model
Google or a one-time email code. No password.