Outcomes, not hours. See your project next to a traditional agency.Get your estimate
Insights · AI engineering

How to evaluate a RAG system before it reaches users

Updated 26 October 2026 · Animux

SHORT ANSWER

Evaluate a RAG system in two layers. First, retrieval: does it find the right passages for real questions (measure recall and ranking quality)? Second, generation: is each answer faithful to those passages, relevant, and correctly cited? Build a golden set of real user questions with known sources, run it on every change, and keep monitoring after launch.

Build a golden question set first

Collect 100 to 300 real questions from the people who will use the system, and record which documents or passages contain each answer. Include hard cases: questions with no answer in the documents, ambiguous wording and questions that need two sources.

Measure retrieval

If retrieval fails, no prompt can rescue the answer. Check:

  • Recall at k: how often the right passage appears in the top results.
  • Ranking quality: whether the best passage comes first, not fifth.
  • Coverage: which questions find nothing relevant, often a sign of missing or badly split documents.

Measure generation

  • Faithfulness: every claim in the answer is supported by the retrieved text.
  • Relevance: the answer addresses the question asked.
  • Citation accuracy: the cited source really contains the claim.
  • Refusal quality: when the documents do not contain the answer, the system says so.

Common failure modes

  • Chunking that splits tables or definitions away from their context.
  • Keyword-only or vector-only search; hybrid search with re-ranking is usually more robust.
  • A stale index that misses recent documents.
  • Prompt injection hidden inside documents.
  • Every query sent to the largest model, raising cost without improving accuracy.

Keep evaluating after launch

Run the golden set on every change to prompts, models, chunking or data. In production, track user feedback, escalation rate, cost and latency per query, and add newly failed questions to the golden set.

A minimal evaluation pipeline

  • Store the golden set as data: question, expected source passages and a reference answer.
  • On every change, run retrieval and record recall at k for each question.
  • Generate answers and score faithfulness, relevance and citation accuracy, with human review of a sample.
  • Compare against the last accepted run and block the release if key scores drop.
  • Track cost and latency per question alongside accuracy, so savings never quietly reduce quality.

Frequently asked questions

How many test questions do I need?

Start with about 100 real questions covering your main topics and edge cases, then grow the set with every failure you find in production.

Can an LLM grade a RAG system’s answers?

Yes, as a first pass for faithfulness and relevance, but calibrate it against human judgements on a sample, and keep humans reviewing high-risk answers.

What accuracy is good enough?

It depends on the cost of a wrong answer. Agree the target with the business owner before launch, and require citations so people can verify answers that matter.

Related guides

YOUR NEXT CHAPTER

Start with the outcome
you need.

See your outcome, timeline and investment next to a traditional agency, or talk to Irfan Khan, our Senior Technical Architect.

Get my project estimateOr book an Architect’s Review