Monitoring RAG Retrieval and Generation Quality
This lesson explains how to monitor retrieval and generation separately, since RAG systems degrade silently as documents, questions and models change, and a wrong answer can come from either stage.
Learning outcomes
After completing this lesson, you will be able to:
- Separate retrieval failures from generation failures.
- Combine offline and online monitoring.
- Track RAG monitoring metrics.
- Build and maintain a retrieval test set.
Separating retrieval and generation failures
When a RAG application gives a wrong answer, the first diagnostic question is where the failure occurred. If the relevant passage was not retrieved, the failure is in retrieval: chunking, embeddings, metadata filters or stale content are the likely causes. If the passage was retrieved but the answer is still wrong or unsupported, the failure is in generation: the prompt, the model or the length of the context.
This diagnosis is possible only if the retrieved chunks are logged with each answer. Without them, every failure looks like a model problem, and teams change the model when the real fix is in retrieval.
The following diagram shows why a benefits assistant's answer quality dropped after a new policy was uploaded, and the effect on retrieval.

Retrieval or generation failure?
Offline and online monitoring
Offline, rerun Bedrock RAG evaluation jobs on a fixed test set after every change to documents, chunking, embedding model, prompt or generation model: retrieve-only jobs measure context relevance and coverage, and retrieve-and-generate jobs measure correctness, faithfulness and citation quality. Online, log queries, retrieved chunk IDs and scores, answers and user feedback; publish metrics such as the rate of empty retrievals, low top scores, "I don't know" answers and negative feedback to CloudWatch; and sample production traffic for periodic judge scoring of faithfulness.
Metrics to track
The following table lists useful RAG monitoring metrics.
| Metric | Signals |
|---|---|
| Context relevance / coverage (evaluation) | Retrieval quality |
| Faithfulness (judge) | Hallucination beyond retrieved context |
| Citation precision and coverage | Whether citations support claims |
| Empty or low-score retrieval rate | Missing content or new question topics |
| Negative feedback rate | User-perceived quality |
| Retrieval and generation latency | Performance of each stage |
RAG metrics
Building and maintaining a retrieval test set
Offline retrieval metrics need a test set of questions with known relevant passages or reference answers. A good set covers the main document collections, the question types users actually ask, and difficult cases such as questions that combine two topics, contain exact identifiers or have no answer in the corpus. Production logs are the best source of realistic questions; subject-matter experts then write reference answers or mark the passages that should be retrieved. A judge model can draft candidate questions from documents, but people should review them, because generated questions tend to repeat the document's own wording and make retrieval look easier than it is.
The test set must change as the system changes. When new document collections are added, questions about them should be added too; otherwise the evaluation keeps passing while users fail. Each version of the test set should be stored with a version identifier, so that scores from different months remain comparable and a change in score can be attributed to the system rather than to the test.
Online signals complement the test set by covering questions nobody anticipated. A rising share of queries with low top retrieval scores, a cluster of similar questions with negative feedback, or a new topic that appears in many queries all suggest gaps in the corpus. Reviewing these queries regularly and adding representative ones to the test set turns production experience into regression protection for future changes.
A sudden quality drop
User thumbs-down feedback on a benefits assistant doubles in one week. Logs show the rate of low-score retrievals rose from 4% to 19%, mostly for questions about a new parental-leave policy.
The new policy PDF was uploaded to a different S3 prefix that is not part of the data source, so it was never ingested. Adding the prefix and syncing fixes retrieval, and a retrieve-only evaluation job confirms context coverage is back above 0.9. Switching to a larger generation model would not have helped, because the information was never retrieved.
Why log the retrieved chunks with every answer?
Show answer
To tell retrieval failures from generation failures when an answer is wrong.
Exam Tips
Remember for the exam
- Log retrieved chunks with every answer to separate retrieval from generation failures.
- Retrieve-only evaluation: context relevance and coverage.
- Faithfulness detects answers unsupported by the context.
- Rising low-score retrievals often mean missing or stale content.
- Rerun RAG evaluations after every configuration or content change.