In my recent article about building smarter AI applications with Amazon Bedrock and Retrieval-Augmented Generation (RAG), I introduced the basic idea: retrieve relevant information, then use it as context for a model's answer. A useful next question is: how do we tell whether the system is doing that well?
A convincing answer is not automatically a correct one. A RAG application can fail because it retrieves the wrong document, misses an important passage, or generates a response that goes beyond its sources. Testing retrieval and generation separately makes these problems easier to find.
1. Start with realistic questions
Create a small set of questions that represent what a user would actually ask. Include straightforward questions, questions that need details from more than one passage, and questions for which the source documents do not contain an answer. For each question, note which source or facts should support a good answer.
Keep this set as a repeatable check. When you change your documents, chunking, retrieval settings, or prompt, run the same questions again and compare the results.
2. Inspect what was retrieved
Before judging the generated text, check the retrieved passages. Are they about the question? Do they contain the needed facts? Are important details missing or buried among unrelated results? If the retrieved context is weak, changing the prompt alone may not solve the problem.
Amazon Bedrock Knowledge Bases offers a Retrieve operation for inspecting relevant source chunks, and RetrieveAndGenerate for retrieving context and generating an answer together. The combined response can include citations to source material, helping a reviewer check where an answer came from.
3. Review the answer against its sources
For each response, ask: Does it answer the question? Are its claims supported by the retrieved passages? Does it clearly acknowledge when the available information is incomplete? A short answer grounded in the documents is more useful than a detailed answer that adds unsupported claims.
Citations help with review, but they do not replace it. Open the cited source and confirm that it supports the sentence it is attached to.
4. Repeat after changes
A small test set gives you a practical way to compare versions of an application. If a change improves one question but harms another, that trade-off becomes visible. Amazon Bedrock also provides evaluation capabilities for assessing models and knowledge bases with prompt datasets and metrics.
The main lesson I’m taking away is to evaluate the retrieval step as carefully as the generated answer. When the sources are relevant, citations are checkable, and the same tests keep passing after changes, it becomes easier to understand where a RAG application is working—and where it still needs improvement.
How do you test whether a generated answer is truly supported by its sources?
Further reading
Loading article