GUIDE · RAG AND KNOWLEDGE BASE

Evaluating a RAG system: how to test accuracy and citations

By the end of this guide you will be able to build a test set for a RAG system, measure document retrieval and answer faithfulness separately, check citations and decide whether the system is ready for use. The method applies to any supplier or architecture.

Updated october 2026
7 min read
Altovar Technical Editorial Team

1. Why evaluation comes before use

A generated answer is almost always well written. The fact that it sounds correct says nothing about whether it is. A RAG system can cite the wrong document, retrieve the right passage and summarise it badly, or answer with confidence a question the knowledge base does not cover. Without a measure, these errors are discovered when someone acts on the wrong information, that is, at the worst moment and at the highest cost.

Evaluation is therefore a condition for opening the system, not a check to carry out at the end of the project. It also serves to compare suppliers, models and configurations by the same yardstick, and to decide when a change genuinely improves the knowledge base. Without a common yardstick, every demonstration looks convincing, because it is built on the questions that work best. The same yardstick also serves the person who approves the project.

2. Prerequisites: questions, reference answers and documents

The test is built from real material. Gather questions that colleagues would genuinely ask, including the ambiguous ones, those phrased informally and those the knowledge base should not answer. For each question, state the expected answer and the document that contains it, with the precise section. A test built only on easy questions measures the ease of the test, not the quality of the system.

The material must be approved by the content owner, because a test built on wrong answers measures the error with confidence. Keep the test separate from the documents used in the supplier's demonstration sessions, otherwise the evaluation becomes an exercise in memory rather than quality. Keep a dated version of the test, to reuse after every change to the system. Also state who is authorised to modify it.

3. The steps to build the evaluation

The evaluation follows a precise sequence. Each step produces data that helps interpret the next, so do not skip building the reference material. Always run it with the same procedure, so that results are comparable over time. The person who runs the test should not be the same person who configured the system, because they tend to look for confirmation of what they built.

Document each step in a simple log, with the date, the version of the documents, the version of the model and the person who ran the test. Without this log, two different results cannot be explained, and the discussion shifts to impressions rather than data. The log is the simplest way to make the evaluation repeatable even when the staff running it change, and to demonstrate after the fact how a result was obtained.

  1. Build the set of questions with the reference answers and the source document.
  2. Run retrieval alone and record which documents are retrieved for each question.
  3. Compare the retrieved passages with the expected ones and calculate in how many questions the right document appears.
  4. Run the full system and compare the generated answer with the reference answer.
  5. Check that every statement in the answer is supported by the cited passage.
  6. Record the errors by type: missing retrieval, unfaithful answer, incorrect citation, unnecessary refusal.
  7. Repeat the same procedure after every significant change and compare the results.

4. Metrics to track

Measures should not be reduced to a single score. An average score hides the problem: a system may almost always find the right document and invent details in the answer, or the reverse. Keep the signals separate, and for each define in advance what would concern you. An acceptable value on one signal does not justify a fault on another, because each fault has a different cause and a different fix.

For handling limits, how often the system abstains matters. A knowledge base that always answers seems more useful, but it is more dangerous, because it turns gaps in the documents into confident answers. A correct refusal is a positive test result. Document the expected behaviour for each measure before running the evaluation, so that the judgement does not depend on the impression of the moment.

What you measureQuestion it answersSign of a problem
Passage retrievalDoes the right document appear among the results?Correct documents missing for frequent questions
Answer faithfulnessDoes the answer say only what the text supports?Details not in the document, different figures or dates
Citation qualityDoes the cited source really contain the information?Citations pointing to nearby but irrelevant sections
Limit handlingDoes the system state when the knowledge base does not answer?Confident answers on topics not covered

5. Common mistakes in evaluation

The first mistake is evaluating only with easy questions, chosen from those the system already handles. The second is relying on the judgement of a single person, who tends to consider correct an answer they already know. The third is changing the model, the documents and the instructions at the same time, so that it is unknown which change produced the improvement or deterioration observed. Each change should be evaluated on its own, even though this takes longer.

The fourth is confusing speed with quality. A fast, well-formatted answer can be wrong, and an impression of efficiency is not a measure. The fifth is failing to update the test when the documents change, with the result that the evaluation measures a knowledge base that no longer exists. Review the test with the content owners at every significant update to the knowledge base.

6. When the evaluation is reliable

An evaluation is reliable when two different people reach the same judgement on the same answers. Ask two assessors to classify a sample independently and compare the results. The points of disagreement indicate ambiguous questions or unclear criteria, and must be clarified before measuring the system, otherwise the final number does not mean anything precise. Also state the criterion you used to choose the difficult cases.

Use human judgement for the difficult cases and automatic checks only where the result is easy to verify. Document in the records which measures are automatic and which are manual. If the supplier proposes only automatic scores, ask to see the examples that produced them, because that is where you can tell whether the score genuinely measures quality. The choice of assessors must also be documented.

7. How to get started

This week, gather a first set of real questions, with the expected answers and the reference documents, and have it approved by the content owner. A complete set is not needed to begin: what is needed is a set representative of the most frequent and most risky cases, including the questions where a wrong answer would have real consequences. A small but well-chosen set is already useful for a first picture.

Run it on the system before launch and keep the result as a baseline for future changes. The first comparison will show immediately where to concentrate the work, and will give a common basis for discussing with the supplier without relying on impressions. Show the result to the content owner and discuss the most critical cases with them, so that the first evaluation becomes a shared reference and not an isolated test by the technician.

Frequently Asked Questions

Is there a single score for evaluating a RAG?

Not reliably. A single score mixes different problems and hides which part of the system is at fault. It is better to keep document retrieval, answer faithfulness and citation quality separate. A summary score can be useful on a dashboard, but not for making decisions.

Can we use AI to evaluate AI answers?

It can help speed up the work, but it does not replace human judgement on difficult cases. An automatic assessor can make the same mistakes as the system it evaluates. Use it to flag answers for review, and periodically verify that its judgement matches that of a person.

How often should the evaluation be repeated?

Whenever something significant changes: documents, model, instructions, permissions or search configuration. A periodic check is also advisable, because the knowledge base ages. The frequency should be set with the content owner, according to how often the documents change.

What should we do if the system often gets citations wrong?

First check whether the problem lies in how the texts were split or in the metadata. A citation may point to the wrong section because the splitting separated the context from the passage. If the source is correct but the answer is not, the problem lies in generation. Distinguishing the two cases avoids unnecessary corrections.

Should the test be run before purchase too?

Yes, and it is the best way to compare suppliers. Ask each proposal to run the same set of questions, using your documents or a representative sample. Document the result and attach it to the decision, so it remains clear on what basis it was taken.

About this content

General informational guide. Regulations and technical requirements change over time: always check the official sources and assess your specific case with a qualified technical or legal advisor.

GET IN TOUCH

Talk to our team.

We'll show how Altovar integrates into your infrastructure. No commitment, no sales pitch. Just a technical conversation.

BOOK A DEMO →