All Insights
Engineering
Nov 30 2026 12 min read

How to Evaluate a Production RAG System

A vendor-neutral playbook for evaluating production RAG: measure retrieval and answers separately, build a regression set from real queries, calibrate automated judges against human review, and set release gates — without invented scores.

Abhilash Sahoo
Written byAbhilash Sahoo
How to Evaluate a Production RAG System

To evaluate a production RAG system, measure retrieval and generation separately, then decide in advance what "good enough to ship" means. If the right passages never reach the model, answer-quality scores will mislead you. Build a Regression set from real user queries, including questions the system should refuse. Score retrieval with Recall@k, MRR, nDCG, and Context relevance. Score answers for Faithfulness — also called groundedness — Relevance, Completeness, and Citations. Calibrate any automated judge against human review before you treat the score as a Release gate.

The path below is a four-step loop: a Regression set, Automated metrics, Human calibration, and a Release gate. Add failing queries back into the set.

Why does a production RAG system need its own evaluation discipline?

A fluent demo is not evidence that a RAG system is ready to ship. Retrieval and generation are two moving parts; a failure in one is easy to misread as a failure in the other. The RAGAS paper treats those parts as separate dimensions: whether retrieval finds focused context, whether the model uses that context faithfully, and whether the answer itself is good. The TruLens RAG triad does the same along three edges: context relevance, groundedness, and answer relevance.

"It seems like it's working" is an evaluation anti-pattern. OpenAI's evaluation guidance uses that wording and tells teams to combine metrics with human judgment and to calibrate automated scoring with human feedback. The existing production RAG architecture post already argues that evaluation is non-negotiable; this article shows how to do it. Whether RAG is the right approach at all is covered in RAG vs. fine-tuning.

How do you separate retrieval failures from generation failures?

If relevant evidence is missing from the top-k you actually send to the model, you cannot fairly judge the generator for Completeness or correctness. A faithful answer can still be wrong if the retrieved context was wrong. RAGAS Faithfulness only checks claims against the retrieved context. TruLens is explicit that the triad shows the application is "hallucination free up to the limit of its knowledge base."

The rows below are qualitative, not score cutoffs.

  • Answer misses a fact that is in the corpus. First place to look: Retrieval / recall. What to measure: Recall@k, context recall.
  • Answer is on-topic but invents a detail. First place to look: Generation / grounding. What to measure: Faithfulness or groundedness versus retrieved context.
  • Retrieved chunks are off-topic or padded. First place to look: Retrieval / Context relevance. What to measure: Precision@k, context precision, Context relevance.
  • Relevant documents are in the list but ranked low. First place to look: Ranking. What to measure: nDCG, MRR, context precision.
  • Answer is grounded but does not address the question. First place to look: Generation / Relevance. What to measure: Relevance.
  • Answer cites the wrong passage, or cites nothing. First place to look: Attribution. What to measure: Citations.
  • The system answers when it should abstain. First place to look: Refusal / coverage of the knowledge base. What to measure: Unanswerable labels; abstention checks.

What retrieval metrics should you use?

If the needed evidence never reaches the model, answer scores will not tell you the system works. Choose k from your prompt budget, and set thresholds on your Regression set.

Recall@k and precision@k. NIST TREC defines recall as "the ability of a system to present all relevant items" and precision as "the ability of a system to present only relevant items." For ranked RAG, compute both at k: the chunks you actually pass to the model. TREC evaluates ranked lists at document cutoffs, which is the idea behind precision@k. RAGAS Context Precision also tests whether relevant chunks rank above irrelevant ones.

MRR and nDCG. Official NIST trec_eval scores the first relevant document as 1/r at rank r, "most useful for tasks in which there is only one relevant doc, or the user only wants one relevant doc." Mean reciprocal rank (MRR) is that value averaged over queries. The BEIR paper chose nDCG@10 as its comparable metric because nDCG works for both binary and graded relevance, and it computed the score with the official TREC evaluation tool. Normalizing DCG also lets you compare ranking lists of different lengths; values closer to 1 are better.

Context relevance and context recall. TruLens Context relevance checks whether each retrieved chunk is relevant to the query, because irrelevant context can be "weaved into a hallucination." RAGAS Context Recall "always requires a reference to compare against" and can use a reference answer as a proxy for labeled contexts. These labeled retrieval metrics need qrels: queries with known relevant document or chunk IDs.

What answer and grounding metrics should you use?

Faithfulness asks whether every claim in the answer is supported by the retrieved context. RAGAS defines a response as faithful "if all its claims can be supported by the retrieved context," scored as supported claims divided by total claims (0 to 1). The paper says those claims should be inferable from the context. TruLens uses the same claim-and-evidence test under the name groundedness.

Relevance asks whether the answer addresses the question. RAGAS: it "directly and appropriately addresses the original question," without scoring factual accuracy, and it penalizes incomplete or padded answers. TruLens requires that the response "helpfully answer the original question."

Completeness, when you have a reference, asks whether the answer covers what the reference requires. Correctness, when you have a reference, asks whether the answer is actually right. Both differ from Faithfulness: an answer can be faithful to bad context and still be incomplete or incorrect.

Citations. When the system shows sources, check whether cited passages actually support the answer, and whether supporting passages are missing. Source-cited answers you can check are what production RAG and knowledge systems should show.

Abstention. The system should say it does not know when the corpus does not support an answer. Put unanswerable items in the Regression set.

Library names differ; the checks line up as follows.

  • Claims supported by retrieved context. RAGAS: Faithfulness. TruLens RAG triad: Groundedness.
  • Answer addresses the question. RAGAS: Answer / response relevancy. TruLens: Answer relevance.
  • Retrieved context is on topic. RAGAS: Context relevance / precision. TruLens: Context relevance.
  • Nothing important was missed in retrieval. RAGAS: Context recall. TruLens: not a named triad metric.
Two-column diagram of RAG evaluation. Retrieval metrics on the left and answer metrics on the right connect to an orange production gate labeled evidence in top-k, grounded answers, and human-calibrated judges.
Retrieval metrics and answer metrics meet a production gate: Evidence in top-k, Grounded answers, and Human-calibrated judges. No scores are shown.

How do you build a regression set from real queries?

The first step in the loop is a Regression set of real queries, including questions the system should refuse. Do not evaluate only on synthetic or textbook questions. OpenAI tells teams to design task-specific evals that "reflect model capability in real-world distributions," to log as they develop, and to avoid datasets that "don't faithfully reproduce production traffic patterns."

Anthropic's evaluation guidance is written for agents, but the dataset advice is usable here. Start early: "20-50 simple tasks drawn from real failures is a great start." Convert user-reported failures and pre-release checks into test cases. A good task is one "where two domain experts would independently reach the same pass/fail verdict." That is Anthropic's starting point, not a required set size.

ARES is a published method for lowering annotation cost. It evaluates context relevance, answer faithfulness, and answer relevance, and uses "a human preference validation set of approximately 150 annotated datapoints or more," plus a few-shot seed and prediction-powered inference "to mitigate potential prediction errors." Treat 150 as a method in that paper, not a promise that 150 labels suffice for every corpus.

When you can provide it, each item should include the raw query, labeled relevant passage or document IDs (qrels), and a reference answer or an explicit "unanswerable" label. For enterprise RAG, also record the user role or permission context, so a document the user must not see is never counted as a fair retrieval. The internal AI copilot article covers why authorization has to happen before documents reach the model.

Cover the query types you will actually see: exact lookups, multi-hop questions, typoed or abbreviated queries, time-sensitive questions, and questions the corpus cannot answer. Version the set and rerun it on every change to chunking, embeddings, indexes, rerankers, prompts, or models.

How should you use automated judges without being misled?

Automated metrics — retrieval scores and answer scores, run on every change — are useful when labels are scarce. Reference-free LLM judges such as RAGAS and the TruLens triad are not a substitute for human agreement. OpenAI tells teams to "combine metrics with human judgment" and to use human feedback to calibrate automated scoring. Vibe-based evals are an anti-pattern.

Human calibration is the step where reviewers check the judges. Anthropic describes model-based graders as "non-deterministic" and says they "require calibration with human graders for accuracy." Human graders are the "gold standard." Combine deterministic checks, model-based rubrics, and human review. Frameworks, Anthropic notes, are "only as good as the eval tasks you run through them." ARES finetunes lightweight judges and uses a small human set with prediction-powered inference to correct judge error.

The working rule: use deterministic IR metrics (Recall@k, MRR, nDCG, and ID-based context recall or precision) as the stable backbone; use LLM judges for Faithfulness and Relevance; and spot-check disagreements with humans before a release. Do not let the same model grade its own answers without Human calibration.

Four-step diagram of a RAG evaluation loop: a regression set of real queries, automated retrieval and answer metrics, human calibration of judges, and an orange release gate, with failing queries added back to the set.
From a Regression set to a Release gate: Automated metrics, Human calibration, then ship or hold. Add failing queries back to the set.

What production gates should you set before you ship?

A Release gate is a pre-agreed rule on a versioned Regression set, not a feeling after a demo. You set the thresholds; this article will not invent percentages. Because model-based graders are nondeterministic, treat a score as a range to hold, not a single cutoff.

The production gate in the diagram is three core checks: Evidence in top-k, Grounded answers, and Human-calibrated judges. Add the other checks your rollout needs.

  • Evidence in top-k. Required evidence appears in the top-k sent to the model (Recall@k or context recall). Ranking quality is visible (nDCG or MRR).
  • Grounded answers. No claims absent from retrieved context (Faithfulness or groundedness). Citations, when shown, point at supporting passages.
  • Human-calibrated judges. Automated metrics are checked against human review before the score can pass or fail a release.
  • Usefulness. Answers address the question (Relevance) and, where a reference exists, cover the required points (Completeness or correctness).
  • Abstention. Unanswerable or out-of-scope items are refused or deferred, not guessed.
  • Permission (light touch). Documents the user is not allowed to see must not appear in the retrieved context. See the internal AI copilot article; a later filter does not fix a retrieval leak.
  • Change control. Rerun the suite on the change and inspect failures per query, not only as an average. Add failing queries back to the Regression set.
  • Operational watch-outs (not service-level promises). Log retrieved chunks, the answer, and Citations. Watch index freshness and ingestion failures. If you track latency or cost, set your own budgets.

What should you keep measuring after launch?

OpenAI describes evaluation as "a continuous process": grow the eval set over time. Anthropic: "The most effective teams combine these methods: automated evals for fast iteration, production monitoring for ground truth, and periodic human review for calibration." Add failing live queries to the Regression set. Watch for new question types, stale or missing documents, and drops in retrieval or Faithfulness after an embedding or model upgrade. Production RAG is not only a better average score; it is a system you can audit, including the Citations and access controls that should already be part of the design.

FAQ

Do we need a labeled golden set, or are reference-free metrics enough?

No. Reference-free judges help when labels are scarce, but RAGAS context recall always needs a reference, and Recall@k, MRR, and nDCG need qrels. Keep a labeled subset for retrieval, Human calibration, and Release gate decisions.

What is the difference between Faithfulness and correctness?

Faithfulness (groundedness) checks claims against retrieved context. Correctness, when you have a reference, checks whether the answer is actually right. An answer can be faithful to the wrong passages and still be incorrect. Completeness, also against a reference, checks whether required points are covered.

Can we just install RAGAS or TruLens and trust the scores?

No. Those libraries define metrics. They are not a substitute for a Regression set or Human calibration.

How large does the evaluation set need to be?

There is no single required size. Use Anthropic's 20–50 real-failure tasks and ARES's ~150+ human validation set as published starting points, then cover the query types you actually see.

How do you evaluate hybrid or vectorless retrieval with the same gates?

The same way. Qrels and answer labels do not depend on a vector database. Vector, hybrid, or vectorless / PageIndex retrieval still need the right evidence in context, faithful answers, and abstention when the corpus cannot support a reply.

When should we hold a release?

When a pre-agreed Release gate fails — including Evidence in top-k, Grounded answers, or Human-calibrated judges — or when a change drops quality on real query types even if the average still looks acceptable. Inspect the failing items first.

If you have a corpus and a set of real questions, and want a straight conversation about how to evaluate a production RAG system, email sales@accentel.com. The RAG and knowledge systems page describes the work. We respond within 24 hours.

Sources

Sources checked on 30 November 2026, Asia/Calcutta. Cloud-vendor evaluation docs are listed here only; the body stays vendor-neutral.

Abhilash Sahoo
About the authorAbhilash Sahoo

Abhilash leads all technology at Accentel, from system architecture and AI model development to infrastructure and deployment. He is focused on building production-grade AI that works reliably at scale.

View profile