We use analytics to count visits and form use. It is on unless you reject it. We show no ads on this site.

Glossary

RAG evaluation

Published . Last updated . Published by Zapple.Tech, founded by the founders of CodeceptJS and Codeception, open-source testing frameworks.

Also called
retrieval-augmented generation evaluation, RAG testing
Published
Updated
Related service
AI testing
Definition

RAG evaluation measures a retrieval-augmented generation system in two parts: whether the search step returned the right passages, and whether the answer built from them is supported and useful. Scoring the two separately tells you which one to fix. You need a labelled question set before any score means something.

What does RAG evaluation measure?

A RAG system has two steps. Search finds passages in your documents. A model then writes an answer from them. The term comes from Lewis et al., whose 2020 paper on retrieval-augmented generation named the approach. Evaluation scores each step on its own.

Step Measure What a low score tells you to fix
Retrieval Did the right passages come back? Chunking, the search index, the embedding model
Retrieval Were they near the top, in the right order? Ranking and filters
Answer Is each claim supported by a retrieved passage? The prompt, or a model that adds facts of its own
Answer Does it answer the question that was asked? The prompt and the answer format
Answer What happens when the documents hold no answer? Refusal behavior

The last column is our judgement from practice on where to look first. The tools below define the measures, not the fixes.

The TruLens documentation calls the core of this the RAG triad: “context relevance, groundedness and answer relevance.” The Ragas documentation lists context precision, context recall, response relevancy and faithfulness for the same job.

RAG evaluation: search finds passages and a model writes the answer from them; the retrieval and the answer are scored separately against a labelled question set, so a low score shows which step to fix

Is the problem in retrieval or in the answer?

Look at the passages before you look at the answer. If the right passage never came back, no prompt change will help. If it did come back and the answer ignores or contradicts it, search is fine and the generation step needs work.

The LlamaIndex documentation makes the same split. It separates response evaluation from retrieval evaluation, and asks of the latter: “Are the retrieved sources relevant to the query?” Microsoft’s RAG evaluators draw the line on labels. Its document retrieval evaluator suits teams that “have query relevance labels (ground truth)”, while its retrieval evaluator is for when “you don’t have ground truths” and uses a judge model to rate how relevant the chunks are.

That is the practical rule. With labels you can measure search directly. Without them you are asking a model to grade the search, and you inherit its errors.

What do you need before you can evaluate a RAG system?

Three things, before any tool:

  • A labelled question set. Real questions from users or support, each with the passage or answer that is correct. Keep it separate from the examples used to tune the system.
  • An owner. Someone who adds new questions when users find failures and removes ones that no longer apply.
  • An agreed threshold. The product owner decides what score is good enough to ship, before the first run, not after.

If you want outside help with an AI feature, see our AI testing service. For a conversational product, the step-by-step view is in our guide to automating a chatbot test.

What does RAG evaluation not solve?

Scores depend on the question set. A system can score well on questions you thought of and fail on the ones users ask. A judge-scored metric inherits the judge’s errors, so check a sample of its verdicts by hand. And a good offline score says nothing about documents that change after the test, so rerun the set when the content changes. Related risks for agents are covered in how to test AI agents and how to test an MCP server, and whether this work replaces testers in will AI replace software testers.

What does Zapple.Tech do about it?

If you are not sure where your RAG system stands, start with the evidence. Zapple.Tech starts with a one-week QA audit of one product area. It looks at its tests, pipeline and release process, and ends in a written report on what is at risk and what to fix first, plus a pilot plan you can run with Zapple.Tech or without it. Read more on the QA audit and assessment page.

Tell us about your RAG system in the form below.

  • AI testing

    AI testing is the testing of software that uses machine learning or large language models, whose outputs vary and cannot always be checked against one fixed answer. Our AI testing services build an evaluation dataset for your AI feature, a baseline of how it behaves today, and checks that run in your CI.

  • LLM evaluation

    LLM evaluation is the practice of measuring how a language-model feature or agent behaves on a defined set of tasks, using written success criteria and scores. It does not by itself show the feature is correct. Our AI agent testing builds a task set, a measured baseline and a suite that scores each model, prompt or tool change.

  • LLM as a judge

    LLM as a judge means using one language model to grade the output of another against a rubric, so a team can score thousands of answers unread by people. It is fast and flexible, but the judge makes its own errors. Trust its score only after you compare it with human labels, and check hard rules without a model.

  • Test harness

    A test harness is everything around the code under test that lets you run it and judge the result: the driver that calls it, stand-ins for its dependencies, the test data, the runner and the reporting. You pay for one whenever tests need more than the product itself. An AI agent needs one that also contains its side effects.

All terms in the glossary

Test AI

AI testing

AI testing services for LLM features, chatbots, agents and RAG. Evaluation datasets, regression baselines and CI checks. Start with a one-week baseline.

See the service

Questions about RAG evaluation

What is RAG evaluation?

RAG evaluation is the measurement of a retrieval-augmented generation system. It scores the retrieval step, which finds passages in your documents, and the generation step, which writes an answer from them. Scoring both separately shows whether a bad answer came from missing context or from how the model used it.

Which metrics are used to evaluate RAG?

Retrieval metrics ask whether the right passages came back and in what order. Answer metrics ask whether each claim is supported by the retrieved passages and whether the answer addresses the question. TruLens names these context relevance, groundedness and answer relevance. Ragas and Microsoft's evaluators use other names for the same checks, such as faithfulness and relevance.

What is the difference between retrieval metrics and answer metrics?

Retrieval metrics judge the search step, and some need labels saying which passages are correct. Answer metrics judge the written response against the retrieved text and the question, and are often scored by a judge model. A low retrieval score points to search and indexing. A low answer score with good retrieval points to the prompt or the model.

Can a RAG system pass evaluation and still give wrong answers?

Yes. Scores depend on the question set, so questions you did not include are not covered. Judge-scored metrics carry the judge's own errors. And documents that change after the test can break answers that scored well on the day.

Request a QA audit quote

Tell us what you ship and what worries you.

What happens after you send this

  1. You send the form: your situation and what you need tested, then your name and work email.
  2. Within one business day, we reply with a suggested first step, its scope, timeline and a quote.
  • Fixed scope
  • You decide after each step
  • The tests live in your repository
  • An NDA signed before access

“They helped us to close the positions and consult our team how to proceed further. High-quality quick feedbacks with the deep checking of the required tasks, professional approach, great understanding of the company's technologies and product, detailed reports.”

Kristina Lavrentieva, Manager at keepgo.com, Israel
  • Rated 4.9 out of 5 on Clutch, from 7 client reviews
  • 42 completed test automation and infrastructure projects
  • Founded by the founders of CodeceptJS and Codeception, open-source testing frameworks

Request a QA audit quote

    What is closest to your situation?
    Optional. The product, the platforms, how often you release, what broke last.

    You decide after our reply whether to go ahead.

    Prefer to talk first? Book a call

    One-week QA audit · written report

    Request a QA audit quote