AWS Builder Center

Evaluating RAG on Amazon Bedrock: Measuring Retrieval and Generation Separately

A RAG pipeline that works in a demo is not necessarily one that answers correctly. This article shows how to use Amazon Bedrock RAG evaluation to measure retrieval and generation separately, choose the right metrics (context coverage, faithfulness, correctness, and citations), build a reliable evaluation dataset, and turn the results into a repeatable improvement cycle.

How to Evaluate a RAG Application with Amazon Bedrock: From "It Seems to Work" to Metrics You Can Defend

Introduction

A RAG pipeline that answers well in a demo is not the same as one that answers correctly. The problem usually shows up when someone asks a question you never tested, and the answer comes back fluent, confident, and wrong.
Evaluating RAG is hard because two different parts can fail in two different ways. The retriever may bring back irrelevant passages or miss the one that contained the answer. The generator may invent, omit, or ignore the context even when the retrieved passages are good. If you only look at the final answer, you can't tell which part to fix.
This article shows how Amazon Bedrock helps you separate those two layers, which metrics to use, how to build the evaluation dataset, and how to turn evaluation into a continuous improvement loop.

What Amazon Bedrock offers

Amazon Bedrock RAG evaluation has been generally available since March 2025. It works for applications built on Amazon Bedrock Knowledge Bases as well as for custom RAG systems, and it can evaluate either retrieval alone or the end-to-end generation.
The evaluation uses the LLM-as-a-judge technique: a second model, the judge, reads the question, the context, and the answer, then assigns a score together with an explanation. The rubrics and judge prompts are published in the documentation, so you can understand how each score is derived.
There are two job types, and your choice determines which metrics are available:
  • Retrieve only: evaluates the retriever in isolation, meaning how relevant and complete the retrieved passages are.
  • Retrieve and generate: evaluates the whole pipeline, including the final answer and how well it is grounded in the retrieved context.

The metrics, one by one

Retrieval metrics

Context relevance measures whether the retrieved passages relate to the question. A low score often points to chunks that are too large, an embedding model poorly suited to your language, or noise in the knowledge base.
Context coverage measures whether the retrieved passages contain everything needed to answer. It requires a reference: the  referenceContexts  field is what lets a retrieve-only job measure coverage against the passages you defined as correct. A low score means the retriever is leaving important information behind, which suggests retrieving more passages, revisiting your chunking strategy, or testing hybrid search.

Generation metrics

Correctness and completeness compare the answer against the expected one. If you provide  referenceResponse , the judge uses it to compute both metrics. They also work without a ground truth, using different judge prompts.
Faithfulness is the hallucination metric. It checks whether the claims in the answer are supported by the retrieved context, not whether they are true in the real world. An answer can be factually correct and still unfaithful if the model answered from its own knowledge instead of your documents. For an assistant that must answer only from official documents, this is one of the most important metrics.
Citation precision and citation coverage evaluate, respectively, whether the cited sources are correct and whether the important claims were actually cited. These two metrics were added for Knowledge Bases evaluations when the feature reached general availability.
There are also responsible AI metrics such as harmfulness, answer refusal, and stereotyping. The refusal metric is useful for spotting when the system declines to answer when it should not, and also when it answers when it should have declined.

Building the dataset: where evaluation is really decided

The quality of your evaluation depends more on the dataset than on the judge. A few principles:
Cover question types, not just the happy path. Mix direct questions, questions that require more than one document, questions with ambiguous or informal wording, and questions whose answer is not in the knowledge base. That last group tests whether the system knows how to say "I don't know."
Write reference answers from the source, not from memory. If the ground truth contains errors, the judge will penalize correct answers. Manually review a sample.
Record where each answer comes from. Keeping the source document and passage lets you build  referenceContexts  and later understand why a question failed.
Think in batches and in coverage. Instead of generating hundreds of questions at once, split the dataset by topic or by document, review each batch, and track what has already been covered. This prevents a dataset biased toward the easiest subjects.
On format: the dataset is uploaded to Amazon S3, and each entry carries the prompt, the reference answer, and, when applicable, the reference contexts. For retrieve-and-generate jobs, conversations can have up to 5 turns, while retrieve-only jobs allow a single turn.

Evaluating a Knowledge Base or your own RAG

If you use Amazon Bedrock Knowledge Bases, the job calls the knowledge base for you: you choose the judge model, the knowledge base, the metrics, and the dataset.
If your RAG is custom, for example with a different vector store or your own orchestrator, you can still evaluate it. You bring your input-output pairs and the retrieved contexts directly in the dataset, which skips the call to a Knowledge Base. This "bring your own inference responses" option makes the feature useful even if your application does not run entirely on AWS.
On the infrastructure side, the job needs an S3 bucket for the results, configured with the CORS permissions described in the Amazon Bedrock User Guide, and an IAM service role that Bedrock can assume, with access to the Bedrock and S3 resources used by the job. These two items are the most common source of errors when creating your first job.

Interpreting the results

A single score says little. The value comes from reading results at three levels:
  1. Metrics summary, for an overall picture.
  1. Per-prompt details, where each score comes with the judge's reasoning. This is where you discover patterns, such as "every question about deadlines has low coverage."
  1. Comparison between jobs. You can compare evaluation jobs to see the effect of changing chunking strategy, vector size, rerankers, or the generator model.
A good diagnostic order starts with retrieval. If context coverage is low, fix the retriever before touching the prompt or swapping the model, because no generator can use a passage that never arrived. If retrieval looks good but faithfulness is low, the problem is in generation: system instructions, temperature, or model choice. If faithfulness is high but completeness is low, the system may be too cautious or the context too fragmented.
Change one variable at a time. Changing chunking and model in the same experiment makes it impossible to know what caused the difference.

Caveats about the judge

LLM-as-a-judge is fast and cheaper than human evaluation, but it is neither neutral nor infallible:
  • Judges tend to be strict with answers that lack detail, so always compare across versions rather than against an "absolute 10."
  • Calibrate with humans. Manually review a sample and check whether the judge's scores track your own judgment.
  • Language matters. If your knowledge base is not in English, check that the judge handles the nuances of your domain and language.
  • Treat results as a directional signal, not a verdict. Critical questions deserve human review.

Making evaluation a routine

The biggest gain comes when evaluation stops being an event and becomes part of the development cycle. Keep a stable regression dataset, run jobs after every relevant change (new chunking, new embedding model, new prompt, new generator), and record the results side by side. Every technical decision then has a number behind it.

Conclusion

Evaluating RAG means measuring two separate things: whether the system finds the right information and whether it uses that information faithfully. Amazon Bedrock brings those metrics, the judge, run-to-run comparison, and the ability to bring your own pipeline into one place. What it cannot replace is the work of building a good dataset, and that is where most of the effort should go.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article