All work
192025SCAD

Prompt & RAG Evaluation Harness

Stop shipping prompts on vibes: 400+ graded queries and a CI gate that blocks retrieval and answer-quality regressions.

Before

Every prompt or retrieval tweak on the RAG and NL-to-SQL systems was shipped on intuition. There was no way to know whether a change quietly regressed quality until users noticed.

After

An evaluation harness with ~400 graded queries, judge-LLM scoring, and a CI step that blocks regressions. It caught 6 regressions before production and made prompt iteration data-driven instead of guesswork.

Challenge

Every prompt or retrieval tweak was being shipped on vibes — there was no way to measure regressions on the RAG and NL-to-SQL systems.

Approach

Open-source-flavoured eval harness with ~400 graded queries, judge-LLM scoring, and a CI step that blocks regressions in retrieval recall and answer quality.

How it was built

  1. 1

    Gold-standard sets

    Phase 1

    Assembled ~400 graded queries across the RAG and NL-to-SQL systems — the fixed yardstick every future change is measured against.

  2. 2

    Judge-LLM scoring

    Phase 2

    Added an LLM judge to score answer quality and a retrieval-recall metric, so 'better' becomes a number instead of an opinion.

  3. 3

    CI gate

    Phase 3

    Wired the harness into CI so any prompt or retrieval change that drops recall or answer quality below threshold fails the build before it can merge.

  4. 4

    Adoption

    Phase 4 — Present

    Made the harness the mandatory gate on every RAG/NL-to-SQL change. It caught 6 regressions that would otherwise have shipped.

Key architecture decisions

Fixed gold-standard sets over ad-hoc spot checks

Why · A stable, graded set is the only way to compare two versions honestly. Ad-hoc testing hides regressions rather than surfacing them.

Judge-LLM plus a hard retrieval metric

Why · Answer-quality judging is fuzzy; retrieval recall is not. Pairing a soft judge with a hard metric catches both reasoning and retrieval regressions.

Block in CI, not in review

Why · Regressions caught by a human reviewer are caught inconsistently. A CI gate makes quality non-negotiable and removes it from opinion.

Impact

  • Caught 6 regressions before they hit production
  • Made prompt iteration data-driven instead of intuition-driven
  • Adopted as the gate on every RAG/NL-to-SQL change
2
suites
400+
queries
6 caught
regressions

What I'd tell someone building this

  • 01 · Evaluation infrastructure is the highest-leverage thing you can build for a RAG system — build it early.
  • 02 · You can't improve what you don't measure, and 'the answers feel better' isn't a measurement.
  • 03 · A judge-LLM plus one hard metric beats either alone.
  • 04 · The moment quality lives in CI, prompt iteration stops being scary.

Tech stack

GPT-4 (judge)PythonGitHub ActionsDVC

Ask anything about Prompt & RAG Evaluation Harness

AI scoped to this project · GPT-OSS 120B