Skip to content
Insights

How to Evaluate a RAG System: Checking Whether Your Knowledge Search Gets It Right

Evaluate RAG stage by stage: knowledge base, parsing, chunking, retrieval, answer and agent. With metrics, test questions, AI judges and their limits.

Updated on

Short answer

You evaluate a RAG system stage by stage: the knowledge base, how tables and charts are parsed, whether retrieval finds the right passage, the answer and, where there is one, the agent. You test with your users' questions or synthetic ones whose correct answer is fixed in advance. How good the result must be is decided by whoever is accountable for a wrong answer.

RAG stands for retrieval-augmented generation: an AI that first searches your company documents and then writes an answer from the passages it found. Many internal assistants and company chatbots work this way. You can check whether they answer correctly, but not with a single number.

An invented example shows why. An employee asks the internal assistant how many days of paid leave she gets in her first year. The answer comes back at once, friendly and with a source: 28 days, according to the 2023 employee handbook. That sentence is in the document word for word. But the 2023 handbook was replaced in January. The new one sits in the system as a scanned PDF, and the program that read it in mangled the table with the leave allowances. So retrieval found the old version instead of the new one. A check that only asks whether the answer matches the retrieved document can give this answer full marks. The failures happened earlier: the old version was still in the knowledge base, and the new one was parsed incorrectly.

A RAG system is a chain of steps. Each step can fail in its own way, and each needs its own measurement.

StageTypical failureWhat you measure
Knowledge baseDocuments are missing, out of date, duplicated or contradict each otherHow many test questions the base can answer, document age, duplicates
ParsingTables, charts, scans and columns are read incorrectlySamples per file format, test questions on tables and charts
ChunkingRelated content is split apart, unrelated content is mergedRetrieval quality per chunking variant
RetrievalThe right passage is missing from the results or ranked too lowCompleteness and order of results (recall@k, MRR, nDCG)
AnswerThe answer goes beyond the passage, leaves out something important, or is wrongFaithfulness, comparison with the reference answer, “I don’t know” when the base has nothing
AgentCorrect results are misused, miscalculated or ignoredFinal answer and path, measured separately

Why isn’t one score enough?

Think of a cold chain. If you get a piece of spoiled meat, it is hard to tell where it went bad: at the producer, in transport, at the retailer or on the way to your fridge. At the end, you only notice that something is wrong. Where it went wrong only shows up if you check at every station. Why RAG reduces errors and still does not eliminate them is covered in our guide to AI hallucinations. This guide is about how you check whether it works.

There is good evidence that errors travel down the chain. For the OHRBench benchmark, researchers had more than 8,500 document pages read by different parsing tools and then asked questions about them. Even with the best tool, the overall score (an F1 score across retrieval and answering) dropped by about 14 percent compared with perfectly transcribed text, and the losses showed up in both retrieval and answers.1 Retrieval cannot recover what was lost during parsing.

It works the other way around too. In a Google test, the model Gemini-Pro-1.5 was given every Wikipedia article it needed for each question. Retrieval, in other words, was perfect. It still got 27 percent of the questions wrong, and about 80 percent of those errors involved arithmetic, tables or further processing of the facts.2 Another study found that a RAG system’s accuracy stayed below the share of cases in which the answer was actually in the retrieved passages, at every retrieval size it tested.3 Found does not mean used.

A score at the end tells you whether you have a problem. Only measurements at each stage tell you where it is.

The pipeline and its checkpoints Six checkpoints stacked vertically, joined by arrows from top to bottom, each with its question: 1. knowledge base (is the answer there, current and unambiguous?), 2. parsing (tables, charts and columns read correctly?), 3. chunking (does related content stay together?), 4. retrieval (right passage among the top results?), 5. answer (is every statement in the source, and is it correct?), 6. agent, if used (does it use the results correctly?). 1. Knowledge base Is the answer there, current and unambiguous? 2. Parsing Tables, charts, columns read correctly? 3. Chunking Does related content stay together? 4. Retrieval Right passage among the top results? 5. Answer Is every statement in the source, and correct? 6. Agent (if used) Does it use the results correctly? The pipeline and its checkpoints Six checkpoints stacked vertically, joined by arrows from top to bottom, each with its question: 1. knowledge base (is the answer there, current and unambiguous?), 2. parsing (tables, charts and columns read correctly?), 3. chunking (does related content stay together?), 4. retrieval (right passage among the top results?), 5. answer (is every statement in the source, and is it correct?), 6. agent, if used (does it use the results correctly?). 1. Knowledge base Answer there and current? 2. Parsing Tables, charts correct? 3. Chunking Does it stay together? 4. Retrieval Right passage on top? 5. Answer Grounded and correct? 6. Agent (if used) Results used correctly?
An AI-powered knowledge search system has six checkpoints, and each needs its own check. Parsing errors can carry through to retrieval and the final answer.

Where do you start?

You don’t have to measure everything at once. Three steps are enough to begin, and each has a clear owner.

The business team writes test questions. Ten to twenty questions that come up in daily work, each with the correct answer and the document it comes from. Include questions about tables, questions the knowledge base cannot answer, and questions not everyone is allowed to have answered. Put these questions to the assistant and note what comes back. That needs no engineering and often already shows which stage is failing. Ten to twenty questions are a start, not a test set. For reliable numbers, the set grows step by step to around 100 questions and more. It applies even if you use an off-the-shelf product and don’t run the technology yourself. The vendor then measures the technical stages, and you ask for the results. In production, this becomes a loop: real user questions whose correct answer has been checked go into the set as new test questions. That way it grows with every month of operation.

Whoever builds or runs the system turns this into a test set that runs automatically. Each question comes with its expected behavior. For answerable questions, that is a reference answer and a reference passage; for questions the knowledge base cannot answer, an “I don’t know”; for permission tests, also the role of the person asking. Store the reference passage as document and section, not as the ID of a retrieval chunk. Otherwise the test set breaks every time you change your chunking. The set lives next to the code and runs on every change to the model, prompt, parser, chunking, index or documents. Pin the model version instead of using “the latest model”. That makes runs comparable, but it does not remove the randomness in the answers. Whether a change does harm only shows up in repeated runs on the same questions (more in How precise is the number?). Don’t also use the test set to tune prompts and settings, or in the end it only measures what you tuned it for. Running costs can be estimated up front: number of questions times number of runs times tokens per answer and per grading by an AI judge.

The responsible team sets the threshold, often together with product management. Two kinds of rules work well. Some cases must pass every time, such as permission tests and questions the knowledge base cannot answer. Everything else gets a minimum score. As an example, not a recommendation for your case: for at least 90 percent of questions, the right source is in the top five results, and no change may fall below the previous version’s score. Small fluctuations trigger a review, not an automatic stop. Which number suits you is covered in What score is good enough, and who decides?

The following sections walk through the stages in order and show what to measure at each.

How good does the knowledge base need to be?

Four defects show up in almost every knowledge base. It has gaps, because knowledge lives in people’s heads or inboxes. It is out of date, because nobody removes old versions. It contains duplicates, often in slightly different versions. And it contradicts itself, because two departments wrote down the same rule differently. Contradictions can partly be resolved technically, for example by date, by ranking sources, or by marking the valid version. Gaps and outdated content cannot be fixed by any setup. No retrieval can correctly find what is missing from the base or wrong in it.

Language models make this worse, because they readily adopt the text they are given. In one experiment, models received documents with deliberately falsified details, such as a wrong drug dosage. In cases where they would have been right without the document, they took over the error in roughly one third to almost two thirds of cases, depending on the model.4 An outdated document can lead to a wrong answer in the same way.

Amazon Web Services lists running retrieval without freshness validation as a high-risk anti-pattern in its architecture guidance. It recommends tracking when content was ingested, flagging stale content before it is served, and removing duplicate passages.5 Treat the knowledge base like a data pipeline: with an owner, a freshness rule and checks at ingestion.

What you can measure:

  • the share of your test questions whose answer is in the base at all,
  • the age of documents per topic, and how many have passed their validity date,
  • the number of duplicate or near-duplicate documents,
  • contradictions on your most common topics, for example by deliberately including test questions that have two possible answers.

This stage belongs to whoever owns the content. That is usually the business team, not the technical team.

Does the system parse your documents correctly?

Before an AI can search a document, a program has to turn it into readable text. That program is called a parser. Plain running text rarely gives it trouble. Multi-column pages, tables, footnotes, charts and scanned pages are where it most often goes wrong. A parser that reads a two-column page straight across, line by line, produces half-sentences from different columns side by side.

The OmniDocBench benchmark compares parsers on real pages from newspapers, textbooks, notes and reports. On complex layouts, every method it compared got the reading order wrong more often than on single-column pages.6 No single method wins everywhere: classic tools were clearly better on dense newspaper pages, vision models on handwriting and poor scans.

Charts are among the hardest content. In OHRBench, retrieval found answers to chart questions with a score of 70.3 out of 100 from perfectly transcribed text, but only 16.5 with a common parser.1 For tables the gap was smaller but clear. Then there is the question of what format a table reaches the model in. A study on table questions found that Markdown beats CSV, JSON and HTML for most models.7 Markdown, however, cannot represent merged cells, and a nested price table loses its structure there.

For charts there are two routes. Either a vision model describes the chart in words and the description is searched, or the system searches the page as an image. The ColPali method does exactly that, and on the ViDoRe benchmark it scored clearly higher than text recognition plus image captioning, most of all on infographics, scientific figures and tables.8 Which route works better for your documents, only a measurement on your own pages will tell you.

How to test this stage:

  1. Samples per format. Microsoft recommends picking at least two examples of every file format and variant and putting the parsed output next to the original. Multi-column content should not be processed like single-column content.9
  2. Compare tables specifically. Tables have their own similarity measure, TEDS (tree edit distance similarity). It compares the structure of the parsed table with the real one, row by row and cell by cell.
  3. Test questions on tables and charts. How similar the parsed text is to the original says little about whether the final answer will be right. The OHRBench authors say so, and the olmOCR benchmark tests with thousands of pass/fail checks instead of similarity scores for that reason.10 So ask questions whose answer is only in a table or chart, and measure the result at the end of the chain.

How should documents be split into chunks?

Picture a cookbook cut into scraps. If the scraps are too small, the ingredient list ends up on one and the method on another. If they are too large, you get three recipes at once. RAG systems don’t search whole documents but scraps like these, called chunks. How you cut them is called chunking. Length is usually measured in tokens, the units of text a language model works with, often a word or part of a word.

The most naive approach treats each page or each document as one chunk. That is quick to build, but on long pages covering several topics, a hit brings a lot of irrelevant text with it. Three other methods are common. The simplest cuts at a fixed length, say every 500 tokens. The recursive method prefers to cut at paragraphs and sentences. The semantic method looks for places where the meaning shifts. That sounds best, but it costs considerably more compute. A study comparing fixed-length chunks with two semantic methods on retrieval and answering tasks reached a clear verdict: the cost of semantic chunking is not justified by consistently better results. It came out ahead mainly on documents artificially stitched together from many topics.11 There are also hybrids: a language model first summarizes individual chunks, and retrieval runs over those summaries.

Chunk size shifts the balance between completeness and precision. In a comparison by the vendor Chroma, smaller chunks mainly raised the share of relevant text within what was retrieved.12 Often more effective than the cutting method is giving each chunk its context. Anthropic has a short sentence written in front of every chunk saying which document and context it comes from. Combined with keyword search and reranking, this cut the retrieval failure rate in Anthropic’s own tests from 5.7 to 1.9 percent of questions.13 These are vendor figures without independent replication.

No chunking is best for every document. Test variants with the same questions and compare the retrieval metrics from the next section. Change only one thing at a time.

How do you measure whether retrieval finds the right passage?

A RAG system passes only the top k results to the language model, often 5 or 10. Whatever ranks below that, the model never sees, much like a Google search where you only look at the first page. To measure retrieval, every test question needs a reference passage: the chunks that contain the answer. With those you can compute five metrics.

A worked example shows them best. Retrieval returns five results in this order: X, A, Y, B, Z. Three chunks are relevant: A is very important (grade 3), B important (grade 2), C helpful (grade 1). C was not found.

MetricWhat it measuresIn the example
Precision@5Share of relevant results among the top five2 of 5 = 0.4
Recall@5Share of relevant chunks that are in the top five2 of 3 = 0.67
Hit rate (Hit@5, also Success@5)Is at least one relevant chunk there?yes = 1
Reciprocal rank1 divided by the position of the first relevant result1/2 = 0.5
nDCG@5Relevance grades weighted by position, relative to the ideal order0.58

Averaged over all test questions, the reciprocal rank becomes the mean reciprocal rank, MRR.14 For nDCG (normalized discounted cumulative gain), each result counts with its relevance grade, divided by a discount that grows with position (here the base-2 logarithm of position plus 1). The sum is divided by the score of the best possible order, here A, B, C in the first three places.15 In the example that gives 2.75 divided by 4.76, or 0.58.

Which metric fits depends on your system. MRR fits when only the first correct passage really matters, such as a question with exactly one answer. Recall@k fits when the model reads all k results and needs every part. nDCG fits when some passages matter more than others. Be careful with the term recall@k: in practice some people use it to mean the hit rate, “at least one correct passage in there”. Whenever someone quotes a number, ask which definition applies.

There is a trap in the reference passages themselves. Any result that was never marked relevant counts as a miss, even if it contains the answer. On the TREC-COVID dataset in the BEIR benchmark, 31.8 percent of the top ten results of a modern retrieval method had never been judged by a human, against only 6.4 percent for classic keyword search.16 The newer method looked worse than it was. So have a person spot-check results that are counted as misses.

Why fixed similarity thresholds rarely work

Vector search, the core of most RAG systems, turns questions and chunks into lists of numbers and measures how similar they are, usually as cosine similarity. Mathematically it ranges from minus 1 to 1, and search services often convert it into scores of their own. A rule like “only results above 0.8” seems obvious. In practice it fails for three reasons.

First, the values are relative to the model. What one model scores 0.8, another may score 0.5, and some models give high scores to almost everything. Second, a nearest-neighbor search without its own threshold always returns k results. Microsoft says so explicitly for its search service, “even if the nearest neighbors aren’t that similar”.17 Even a question the knowledge base cannot answer gets five results back. Third, every retrieval method has its own scale. BM25 keyword scores have no upper limit, vector search another range, and a reranker, a model that re-sorts results, yet another. For hybrid search, Microsoft therefore advises against minimum thresholds on the fused scores, because their range is “much smaller and more volatile”.17

What helps instead: look at the distribution of scores on your test questions, separately for correct and incorrect results. If the two overlap heavily, no threshold separates them cleanly. Then you are better off with a fixed number of results, with the scores of a reranker trained for relevance, or with letting the answer stage decide to say “I don’t know”.

Merging two searches: reciprocal rank fusion

Keyword search and vector search find different things. Keyword search hits exact terms such as part numbers or clause references, vector search catches paraphrases. Many systems therefore use both, which is called hybrid search. The problem: the two lists have incomparable scores.

Reciprocal rank fusion (RRF) solves this by ignoring the scores and using only the positions. For each document it adds up 1 divided by (k plus its rank) across all lists, with k set to 60 in the original paper.18 The constant dampens the advantage of the very top positions, so a document ranked high in both lists beats one ranked first in only one. RRF is a method for merging, MRR a metric for measuring. Both use the reciprocal of the rank, and that is all they share.

RRF is simple and robust, but not always the best. One study found that a weighted combination of normalized scores can beat RRF if the weight is tuned on your own data.19 Here too, measurement decides.

Two result lists become one Three result lists, an invented example. Keyword search: 1. Handbook 2026, sec. 4; 2. Leave request form; 3. Handbook 2023, sec. 4. Vector search: 1. Leave FAQ; 2. Handbook 2023, sec. 4; 3. Handbook 2026, sec. 4. Fused with reciprocal rank fusion, each scoring 1 divided by (60 plus rank): 1. Handbook 2026 with 1/61 plus 1/63 equals 0.0323; 2. Handbook 2023 with 1/63 plus 1/62 equals 0.0320; 3. Leave FAQ with 1/61 equals 0.0164; 4. Leave request form with 1/62 equals 0.0161. Keyword search 1. Handbook 2026, sec. 4 2. Leave request form 3. Handbook 2023, sec. 4 Vector search 1. Leave FAQ 2. Handbook 2023, sec. 4 3. Handbook 2026, sec. 4 Fused (RRF) 1. Handbook 2026, sec. 4 1/(60+1) + 1/(60+3) = 0.0323 2. Handbook 2023, sec. 4 1/(60+3) + 1/(60+2) = 0.0320 3. Leave FAQ 1/(60+1) = 0.0164 4. Leave request form 1/(60+2) = 0.0161 Two result lists become one Three result lists, an invented example. Keyword search: 1. Handbook 2026, sec. 4; 2. Leave request form; 3. Handbook 2023, sec. 4. Vector search: 1. Leave FAQ; 2. Handbook 2023, sec. 4; 3. Handbook 2026, sec. 4. Fused with reciprocal rank fusion, each scoring 1 divided by (60 plus rank): 1. Handbook 2026 with 1/61 plus 1/63 equals 0.0323; 2. Handbook 2023 with 1/63 plus 1/62 equals 0.0320; 3. Leave FAQ with 1/61 equals 0.0164; 4. Leave request form with 1/62 equals 0.0161. Keyword search 1. Handbook 2026, sec. 4 2. Leave request form 3. Handbook 2023, sec. 4 Vector search 1. Leave FAQ 2. Handbook 2023, sec. 4 3. Handbook 2026, sec. 4 Fused (RRF) 1. Handbook 2026, sec. 4 1/(60+1) + 1/(60+3) = 0.0323 2. Handbook 2023, sec. 4 1/(60+3) + 1/(60+2) = 0.0320 3. Leave FAQ 1/(60+1) = 0.0164 4. Leave request form 1/(60+2) = 0.0161
Reciprocal rank fusion merges two result lists by rank, not by raw score. Whatever ranks high in both lists wins. Fusion does not decide which version is valid: the outdated handbook comes in almost level. That is the knowledge base's job. An invented example.

Reranking

A reranker is usually a cross-encoder: a model that reads the question and a result together, instead of turning each into numbers separately. That can improve the order of results but costs compute time, so it only re-sorts the top results. In the BEIR benchmark, a reranker that re-sorted the top 100 keyword-search results improved nDCG@10 on 16 of 18 datasets, by about 11 percent on average in relative terms. With a million documents, it took 450 milliseconds on a 2021 GPU (Nvidia V100), against 20 milliseconds for keyword search alone on a CPU.16 Newer hardware is faster, but the gap is still something to budget for in your response times.

Is the answer grounded in its source?

The best-known tool for this stage, Ragas, measures faithfulness: a language model breaks the answer into individual statements and checks each one against the retrieved passages. The score is the share of supported statements.20 That is useful, but it does not measure whether the answer is correct. The answer about paid leave from the start is fully supported, just by the wrong document. According to its authors, Ragas’ answer relevance metric also explicitly ignores factual accuracy. A fluent, on-topic but wrong answer can score well. That is why you also compare against a reference answer fixed in advance.

Several typical failure types arise only after retrieval. A case study of three RAG systems describes seven failure points, and four of them sit after retrieval: the answer is in the context but is not extracted; it comes in the wrong format; it is too general or too specific; it is incomplete.21 Position in the context matters too. In a Stanford study, GPT-3.5-Turbo answered best when the right passage came first and worst when it sat in the middle of 20 documents. With 20 or 30 documents it sometimes did worse than with no document at all, where it answered 56.1 percent correctly.22 Incidentally, this also shows that a correct answer does not prove good retrieval. The model may have known it from memory.

An important case is when the answer is not in the knowledge base. Then “I don’t know” is correct, and models struggle with it. In one test, the only documents provided fit the topic but did not contain the answer. GPT-3.5-Turbo declined in only a quarter to just under half of cases, depending on how responses were scored.23 Meta’s CRAG benchmark therefore scores a wrong answer at minus 1 and “I don’t know” at 0.24 Adopt that logic: questions without an answer in the base belong in the test set, and a made-up answer counts worse than none.

Instead of retrieving, you can also hand the model whole documents. In a 2024 study this scored better on average but cost considerably more,25 and with 32,000-token texts, 11 of 13 models tested dropped below half their score on short texts.26 Here too: measure, don’t assume.

What does the agent do with the results?

An intern is handed exactly the right files and still adds up the numbers wrong. The files were right, the work was not. With AI agents, this is a separate area to test.

An agent is a language model that decides for itself what to do next: whether to search, what for, whether to search again, whether to calculate or call another tool. Many company assistants now work this way. That brings failures a simple RAG chain does not have. What retrieval delivered correctly and what the agent does with it are two different questions, and they need two measurements.

The Google example from the start shows the first half: with every right article in context, the model failed mostly at calculation and further processing.2 The same study shows the second. With a multi-step search pipeline and additional planning instructions, the model reached 66 percent, against 40.8 percent with no retrieval at all. But the researchers also saw it head off in the wrong search direction and never correct itself. For the well-known agent method ReAct, an error analysis traced 47 percent of failed runs to reasoning errors, including loops the agent could not get out of.27

So check two things separately:

  • The outcome. Does the final answer match the reference answer? That is the same check as in the previous section.
  • The path. Which searches did the agent run, which tools did it call, in what order? Did it use the results it got? Did it stop too early or search more often than needed? A typical path error: retrieval returns the right price table, but the agent carries on calculating with a value from an older result.

The major vendors now separate these in their tools. Microsoft distinguishes evaluation of the system outcome from evaluation of the process, and an evaluator called Tool Output Utilization measures whether the agent “correctly understood and used” tool results.28 Google evaluates, alongside the final response, the trajectory, including precision and recall of the tools called against a reference path.29 The vendors have not yet shown how well these automatic evaluators agree with human judgment. So read runs by hand, especially at the start. If an agent can also write, for example create tickets or change data, every write action needs an approval check on top. How an agent is put together and what control it needs is covered in our guide What is an agent harness?.

Where do test questions come from, and who grades them?

Your users’ questions, or synthetic ones

The best questions are the ones your users actually ask: from the inbox, the ticket system, the logs of a pilot. For each question, a subject expert fixes the correct answer and source in advance. When experts disagree, a named person decides. Hamel Husain and Shreya Shankar, two well-known practitioners in AI evaluation, recommend a single domain expert as the deciding voice for most small and medium-sized companies.30

Often such questions don’t exist yet, or expert time is too expensive. Our research found no reliable general figure for the cost per test question. For a sense of scale: for a well-known dataset of hard expert questions, the authors estimated their experts’ average pay at about $95 an hour.31 In that situation, synthetic questions are a legitimate option. A language model reads your documents and writes questions with answer and source.

To make that work, it needs steering. In an IBM experiment, a simple generator produced the same kind of question 95 percent of the time: a single-fact question.32 The DataMorgana method instead specifies question types, such as single or multi-document, specific or abstract. That brought it close to the variety of human questions in wording and sentence structure. In meaning, a gap remained, and predefined personas added little, according to the authors.33 Three rules help:

  • Specify question types, including questions on tables and charts, questions across several documents, contradictory cases, questions with no answer in the base, and permission tests.
  • Rewrite synthetic questions to be shorter and less explicit. Real questions are shorter. On a university information system, real students’ questions averaged 6.8 words, synthetic ones 15.7. On the real questions, the share with the right source in the top five results fell by 29 to 37 percentage points.34
  • Check a sample by hand before you trust the set. For a system’s logged runs, Husain and Shankar advise grading at least the first 30 of 100 yourself.30 A similar amount is a sensible start here too.

A 2025 study shows what synthetic questions are good for. They ranked different retrieval settings much like human questions did, that is, which setting is better. For comparing different answer models they were of little use, and the systems consistently scored worse on human questions than on synthetic ones.35 So use synthetic sets first to compare retrieval settings, and expect them to overestimate quality. The study, however, tested only one simple way of generating them. Whether they also compare answer models reliably is something you need to check separately. As soon as real questions come in, add them.

AI as judge: a double-edged sword

Grading hundreds of answers by hand, again after every change, is beyond most teams. So language models often grade the answers of other language models, known as LLM-as-a-judge. That cuts both ways.

On the plus side, good judges are fast, cheap and surprisingly accurate. A small, purpose-trained checker model with 770 million parameters reached almost the same fact-checking accuracy as GPT-4, at about one four-hundredth of the cost.36 A model that small can also run in your own data center.

On the minus side, there is plenty. In one test, GPT-4-turbo detected whether RAG answers contained hallucinations with an F1 score of only 63.4, worse than a smaller, purpose-trained model.37 Judges favor text they wrote themselves, and more so the better they recognize their own text.38 Single superficial words can fool judges. In a test with math problems, they caused false positive rates of up to 80 percent.39 And vendors replace models without notice. A judge that was reliable yesterday has to be revalidated again and again.40

How to use AI judges responsibly:

  • Pass or fail rather than a scale. A clear question like “Is every statement in the source?” is easier to verify than a grade from 1 to 5.
  • Calibrate against people. Have a subject expert grade a sample and compare. Husain advises working with about 100 examples per failure mode; below 60, the uncertainty is usually too wide.41
  • Report two rates separately. How often does the judge catch a real error, and how often does it let a correct answer through? A judge that always says “pass” reaches 95 percent agreement when 95 percent of answers are correct, and finds not a single error.
  • Use a different model from the one answering, with a pinned version, and revalidate whenever either one changes.
  • Know where the data goes. A cloud-hosted judge sees questions, answers and source texts. The same data-sharing rules apply to it as to the assistant itself.

How precise is the number?

An opinion poll of 50 people tells you less than one of 1,000. Test questions are no different. Every measured rate has an uncertainty that depends on the number of questions. The usual way to compute it is the 95 percent Wilson confidence interval.42 It assumes the questions are independent and reflect the questions people actually ask. A one-sided test set does not become representative by adding more questions.

Measured50 questions100 questions200 questions500 questions
90 percent78.6 to 95.782.6 to 94.585.1 to 93.487.1 to 92.3
80 percent67.0 to 88.871.1 to 86.773.9 to 85.076.3 to 83.3

A difference of 92 versus 88 percent on 50 questions therefore does not prove a reliable lead. If you compare two variants on the same questions, use a paired comparison that looks question by question at where the variants answer differently. Anthropic recommends exactly that.43 Questions about the same document are also not independent of each other, and Anthropic advises computing the uncertainty grouped by document in such cases (clustered standard errors). That widens the ranges. More important than the total is that every stage and every question type has enough questions. Ten table questions show a trend, not a reliable rate.

Does everyone see only what they are allowed to see?

The salary list sits in HR’s locked cabinet. An assistant that has read everything still must not read it out to anyone who asks.

Permissions are not an average but a test that must pass every time. The security community OWASP, which maintains a list of the top risks for AI applications, recommends fine-grained access controls and permission-aware vector stores.44 Technically there are two approaches: each chunk carries the permissions of its source document, or retrieval checks against the source system on every request. Microsoft points out for its search service that a revoked permission does not take effect in the index immediately.45

So test it like this. Ask the same question as two roles, one with access and one without. With access, you expect the correct answer and its source. Without access, neither content nor sources from the restricted document may appear. Then revoke the permission from the authorized role and ask again, right away and after the sync is confirmed. Measure how long it takes for the block to take effect. A vendor’s refresh interval does not guarantee a maximum delay.

A second question is who may add documents. In the PoisonedRAG experiment, five crafted texts per target question, among about 2.7 million clean texts, were enough to force the intended wrong answer in 97 percent of cases. The attacker knew the target question, and the authors name company insiders as possible attackers.46 Who may add or change documents is therefore one of the permissions you need to control and log. What technical safeguards can and cannot do is the subject of The Painted Guardrail.

What score is good enough, and who decides?

A search that misses the right passage in the top five results for one question in ten may be fine for internal research. For telling customers about contract deadlines, it is not. The right threshold depends on what a mistake costs, and whoever is accountable for the consequences sets it.

Distinguish two kinds of criteria. Blocking cases must pass every time. They include permission tests, questions with no answer in the base, and answers with legal or financial consequences, such as notice periods, warranties or prices. Everything else gets averages with a threshold. How to scale checks to the possible damage is covered in our guide to AI hallucinations. Compare against today’s way of working too: how often does an employee find the answer without AI, and how long does it take?

Every stage needs an owner. The business team is responsible for the content, the team that builds or runs it for the pipeline from parsing to retrieval. Answers and agent behavior also need a named owner, who does the subject-matter sign-off together with the business team. The threshold is set by the team responsible for the system, usually together with product management.

When a vendor quotes you a number, ask: which questions, how many, which documents, who graded them, and when? The CRAG benchmark shows how easily a number misleads. It states that the best industry system answers “63% of questions without any hallucination”. That is the share of perfect answers with all questions weighted equally. The five systems tested hallucinated on 16 to 25 percent of questions.24 The rest were acceptable answers with minor errors and missing answers, including abstentions, follow-up questions and system errors. Both are correct numbers, but they say different things.

What changes after launch?

Documents, models and questions change all the time. A test set that fit at launch measures something different six months later.

  • Re-test after every change. That covers the model, the prompt, the parser, chunking, the search index and the documents. OpenAI recommends running evals on every change.47 If a score drops, the change stops until someone has looked.
  • Account for randomness. Language models don’t always give the same answer to the same question, and AI judges don’t always grade the same way. Run important questions several times and look at the share of passing runs, not a single run.
  • Add user questions to the set. Questions from production become new test questions with a checked reference answer and source, failed ones first.
  • Read samples by hand. Automatic judges find what they look for. New kinds of errors are found by people.
  • Update reference answers. When a document changes, the correct answer changes. Otherwise the set measures the past.

The US standards agency NIST recommends reviewing and verifying the sources and citations of generative AI before deployment and during ongoing monitoring. It explicitly warns against extrapolating performance from narrow, non-systematic and anecdotal assessments.48

Frequently asked questions

Is a tool like Ragas enough? Ragas offers metrics for retrieval, answers and agents. Checking the knowledge base, parsing and permissions is something you need to design yourself. See Is the answer grounded in its source?

Do I need real questions? Not to start with. Synthetic questions are mainly useful for comparing retrieval settings. For sign-off, real questions should be added. See Where do test questions come from?

How many test questions do I need? Enough per question type to make the uncertainty acceptable. With 100 questions, the 95 percent interval around a measured rate of 90 percent runs from 82.6 to 94.5 percent. See How precise is the number?

How often should we measure? After every change and regularly in production. See What changes after launch?

Is a long-context model an alternative to RAG? For small knowledge bases sometimes, but it costs more, and long contexts have their own weaknesses. See Is the answer grounded in its source?

How this article was made

Research and drafting were done with AI agents that gathered more than 350 sourced claims. Because AI judges make mistakes, we read every figure supporting a central claim in the original text ourselves and recomputed the confidence intervals and the nDCG example. A second language model from a different vendor checked 36 core claims and both language versions independently against the sources. Oliver Borchers commented on the outline and text over several rounds.

Sources and footnotes

  1. Zhang et al.: OCR Hinders RAG: Evaluating the Cascading Impact of OCR on Retrieval-Augmented Generation, ICCV 2025, arXiv:2412.02592, section 4 and table 2; models from 2024 and 2025. https://arxiv.org/abs/2412.02592 ↩ ↩2

  2. Krishna et al.: Fact, Fetch, and Reason: A Unified Evaluation of Retrieval-Augmented Generation (FRAMES), arXiv:2409.12941, table 3 and section 3; Gemini-Pro-1.5-0514. https://arxiv.org/abs/2409.12941 ↩ ↩2

  3. Jin et al.: Long-Context LLMs Meet RAG: Overcoming Challenges for Long Inputs in RAG, ICLR 2025, section 3 and figure 2; Gemma-2-9B-Chat on Natural Questions. https://arxiv.org/abs/2410.05983 ↩

  4. Wu, Wu and Zou: ClashEval: Quantifying the tug-of-war between an LLM’s internal prior and external evidence, NeurIPS 2024 Datasets and Benchmarks, table 2. https://arxiv.org/abs/2404.10198 ↩

  5. AWS Well-Architected Agentic AI Lens, AGENTREL05-BP03, accessed November 29, 2026. https://docs.aws.amazon.com/wellarchitected/latest/agentic-ai-lens/agentrel05-bp03.html ↩

  6. Ouyang et al.: OmniDocBench: Benchmarking Diverse PDF Document Parsing with Comprehensive Annotations, CVPR 2025, section 5.1 and table 5. https://arxiv.org/abs/2412.07626 ↩

  7. Qiu et al.: TQA-Bench: Evaluating LLMs for Multi-Table Question Answering, arXiv:2411.19504, section IV-B. https://arxiv.org/abs/2411.19504 ↩

  8. Faysse et al.: ColPali: Efficient Document Retrieval with Vision Language Models, ICLR 2025, table 2 and section 5.1. https://arxiv.org/abs/2407.01449 ↩

  9. Microsoft Azure Architecture Center: RAG preparation phase, updated November 5, 2026. https://learn.microsoft.com/en-us/azure/architecture/ai-ml/guide/rag/rag-preparation-phase ↩

  10. Poznanski et al.: olmOCR: Unlocking Trillions of Tokens in PDFs with Vision Language Models, arXiv:2502.18443. https://arxiv.org/abs/2502.18443 ↩

  11. Qu, Tu and Bao: Is Semantic Chunking Worth the Computational Cost?, Findings of NAACL 2025; compares fixed-length chunks with two semantic methods. https://arxiv.org/abs/2410.13070 ↩

  12. Chroma: Evaluating Chunking Strategies for Retrieval, technical report, July 3, 2024; precision at the token level, vendor data. https://www.trychroma.com/research/evaluating-chunking ↩

  13. Anthropic: Introducing Contextual Retrieval, September 19, 2024; failure rate for the top 20 chunks, vendor figures. https://www.anthropic.com/news/contextual-retrieval ↩

  14. Voorhees: The TREC-8 Question Answering Track Report, NIST, conference 1999, published 2000. https://www.nist.gov/publications/trec-8-question-answering-track-report ↩

  15. Järvelin and Kekäläinen: Cumulated gain-based evaluation of IR techniques, ACM Transactions on Information Systems 20(4), 2002. https://doi.org/10.1145/582415.582418 ↩

  16. Thakur et al.: BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Models, NeurIPS 2021 Datasets and Benchmarks, tables 2 to 4; models from 2021. https://arxiv.org/abs/2104.08663 ↩ ↩2

  17. Microsoft Learn: Create a vector query in Azure AI Search, sections “Number of ranked results” and “Set thresholds”, accessed November 29, 2026; vendor documentation. https://learn.microsoft.com/en-us/azure/search/vector-search-how-to-query ↩ ↩2

  18. Cormack, Clarke and Büttcher: Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods, SIGIR 2009. https://plg.uwaterloo.ca/~gvcormac/cormacksigir09-rrf.pdf ↩

  19. Bruch, Gai and Ingber: An Analysis of Fusion Functions for Hybrid Retrieval, ACM Transactions on Information Systems 2024. https://arxiv.org/abs/2210.11934 ↩

  20. Es et al.: Ragas: Automated Evaluation of Retrieval Augmented Generation, EACL 2024 System Demonstrations, section 3. https://arxiv.org/abs/2309.15217 ↩

  21. Barnett et al.: Seven Failure Points When Engineering a Retrieval Augmented Generation System, arXiv:2401.05856. https://arxiv.org/abs/2401.05856 ↩

  22. Liu et al.: Lost in the Middle: How Language Models Use Long Contexts, TACL 2024, section 2.3 and table 1; GPT-3.5-Turbo-0613. https://arxiv.org/abs/2307.03172 ↩

  23. Chen et al.: Benchmarking Large Language Models in Retrieval-Augmented Generation, AAAI 2024, table 3; GPT-3.5-Turbo, English questions. https://arxiv.org/abs/2309.01431 ↩

  24. Yang et al.: CRAG: Comprehensive RAG Benchmark, NeurIPS 2024 Datasets and Benchmarks, section 4 and table 6; systems as of 2024. https://arxiv.org/abs/2406.04744 ↩ ↩2

  25. Li et al.: Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach, EMNLP 2024 Industry Track. https://arxiv.org/abs/2407.16833 ↩

  26. Modarressi et al.: NoLiMa: Long-Context Evaluation Beyond Literal Matching, ICML 2025. https://arxiv.org/abs/2502.05167 ↩

  27. Yao et al.: ReAct: Synergizing Reasoning and Acting in Language Models, ICLR 2023, section 3.3 and table 2; PaLM-540B on HotpotQA. https://arxiv.org/abs/2210.03629 ↩

  28. Microsoft Learn: Agent evaluators in Microsoft Foundry, accessed November 29, 2026. https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/evaluation-evaluators/agent-evaluators ↩

  29. Google Cloud: Evaluate agents, accessed November 29, 2026. https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/evaluation-agents ↩

  30. Husain and Shankar: Frequently Asked Questions (And Answers) About AI Evals, as of September 18, 2026. https://hamel.dev/blog/posts/evals-faq/ ↩ ↩2

  31. Rein et al.: GPQA: A Graduate-Level Google-Proof Q&A Benchmark, arXiv:2311.12022, section 2.1; estimated pay. https://arxiv.org/abs/2311.12022 ↩

  32. Teixeira de Lima et al.: Know Your RAG: Dataset Taxonomy and Generation Strategies for Evaluating RAG Systems, arXiv:2411.19710, section 6; Llama-3-70b. https://arxiv.org/abs/2411.19710 ↩

  33. Filice et al.: Generating Diverse Q&A Benchmarks for RAG Evaluation with DataMorgana, arXiv:2501.12789, tables 4 and 5. https://arxiv.org/abs/2501.12789 ↩

  34. Kucia and Gawlik: Beyond Benchmark Scores: How Synthetic and Authentic Query Distributions Diverge in RAG Evaluation, arXiv:2609.14579, September 13, 2026; one university information system, real questions from a survey. https://arxiv.org/abs/2609.14579 ↩

  35. van Elburg et al.: Can we Evaluate RAGs with Synthetic Data?, arXiv:2508.11758v2, sections 5 and 6; about 100 questions per set. https://arxiv.org/abs/2508.11758 ↩

  36. Tang, Laban and Durrett: MiniCheck: Efficient Fact-Checking of LLMs on Grounding Documents, EMNLP 2024, tables 2 to 4; 2024 prices. https://arxiv.org/abs/2404.10774 ↩

  37. Niu et al.: RAGTruth: A Hallucination Corpus for Developing Trustworthy Retrieval-Augmented Language Models, arXiv:2401.00396, table 5; detection at the level of whole answers. https://arxiv.org/abs/2401.00396 ↩

  38. Panickssery, Bowman and Feng: LLM Evaluators Recognize and Favor Their Own Generations, arXiv:2404.13076; summaries, GPT-3.5, GPT-4, Llama-2. https://arxiv.org/abs/2404.13076 ↩

  39. Zhao et al.: One Token to Fool LLM-as-a-Judge, arXiv:2507.08794; verification of math answers. https://arxiv.org/abs/2507.08794 ↩

  40. Dietz et al.: LLM-Evaluation Tropes: Perspectives on the Validity of LLM-Evaluations, arXiv:2504.19076. https://arxiv.org/abs/2504.19076 ↩

  41. Husain: Using LLM-as-a-Judge For Evaluation: A Complete Guide, as of September 1, 2026. https://hamel.dev/blog/posts/llm-judge/ ↩

  42. NIST/SEMATECH e-Handbook of Statistical Methods, section 7.2.4.1; our calculation. https://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm ↩

  43. Anthropic: A statistical approach to model evaluations, November 19, 2024, sections “Analyze paired differences” and “Cluster standard errors”. https://www.anthropic.com/research/statistical-approach-to-model-evals ↩

  44. OWASP Top 10 for LLM Applications 2025, LLM08: Vector and Embedding Weaknesses. https://genai.owasp.org/llmrisk/llm082025-vector-and-embedding-weaknesses/ ↩

  45. Microsoft Learn: Document-level access control in Azure AI Search, accessed November 29, 2026; vendor documentation. https://learn.microsoft.com/en-us/azure/search/search-document-level-access-overview ↩

  46. Zou et al.: PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models, USENIX Security 2025, section 1; Natural Questions. https://arxiv.org/abs/2402.07867 ↩

  47. OpenAI: Evaluation best practices, accessed November 29, 2026. https://developers.openai.com/api/docs/guides/evaluation-best-practices ↩

  48. NIST AI 600-1: Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile, July 2024, MEASURE 2.5. https://nvlpubs.nist.gov/nistpubs/AI/NIST.AI.600-1.pdf ↩

Dr. Oliver Borchers

Dr. Oliver Borchers

Executive AI and Automation Partner

If you want to know what that means for your company, let's talk.

Book a call