RAG Evaluation Harness — retrieval and generation metrics

Insight

recall@5 and MRR = 1.00 over 20 questions and 0.00 on an 11-question control set of retrieval misses (MRR@all 0.12) — the metric can fall; correctness 0.37 for the offline baseline (faithfulness ≡1.00 is an extractive invariant); retrieval and generation scored separately

Interactive: every figure is computed from the project’s own data, so you can move the controls instead of taking the sentence on trust.

What the case measured

  • Synthetic data data
  • Live demo
  • Open code
  • 6 tools in the stack stack
Situation
A RAG demo is easy to show and hard to measure: you cannot tell whether the retrieval or the generation is failing, or whether the result reproduces at all
Task
Build a pipeline with an offline eval harness that separates retrieval from generation metrics and runs without API keys
Action
A TF-IDF index over the concept corpus, cosine top-k, a deterministic extractive answerer; Claude plugs in behind a --llm flag and the harness stays the same
Result
recall@5 and MRR = 1.00 over 20 questions and 0.00 on an 11-question control set of retrieval misses (MRR@all 0.12) — the metric can fall; correctness 0.37 for the offline baseline (faithfulness ≡1.00 is an extractive invariant); retrieval and generation scored separately
Stack
Pythonscikit-learnpandas / NumPyTF-IDFpytestuv
Source View on GitHub → Updated: Nov 1, 2026

▶ Data-flow diagram — self-contained HTML, opens in a browser — no install, no build

Situation

A RAG pipeline is easy to demo on one lucky question and almost impossible to measure. You cannot tell where quality is lost — in document retrieval or in answer generation — or whether the result reproduces at all without external services. Without an offline harness, any “it got better” stays an impression, not a number.

Task

I needed a RAG system built end-to-end, with each layer measured separately: retrieval metrics (recall@k, MRR, precision@k) over a labeled question set, and generation metrics (faithfulness, answer correctness). The harness has to run with zero API keys and stay unchanged when an LLM is plugged in.

Want an analyst who works like this?

Tell me the role and the problems in it — I reply within a day. Need this reasoning applied to your data rather than a hire? That works too.

Send a request