ProofRAG

Python CLI · Agent skill · GitHub Action

A reproducible evaluation loop for RAG systems: generate golden sets, run predictions, score retrieval and generation, then gate regressions in CI.
RAG EvaluationLLM-as-JudgePython CLIAgent SkillsGitHub ActionsDeepEvalRagas

ProofRAG started from a practical RAG problem: teams can change a chunker, retriever, reranker, prompt, model, or context-packing strategy, but without a stable evaluation set they are mostly comparing impressions. The hard part is not only running metrics; it is producing a useful golden set from the actual corpus and keeping the evaluation loop repeatable.

The tool packages that loop as both a Python CLI and an agent skill. It reads a corpus, generates and validates corpus-grounded test cases, calls the user's RAG system through HTTP or a Python callable, judges answers with a pinned LLM-as-judge, computes retrieval metrics, and emits a self-contained HTML scorecard.

One dependency-light evaluation package.

ProofRAG runs on Python 3.11+ and keeps its core install dependency-free. The same workflow is available through three interfaces.

Command lineAgent skillGitHub Action
MIT licensedPackage: proofrag
Retrievalevidence coverage
Did the system find the evidence?
  • Recall at k
  • Precision at k
  • Normalized discounted gain
  • Mean reciprocal rank
Generationanswer quality
Did the answer use it well?
  • Groundedness
  • Correctness
  • Completeness
  • Citation quality
The evaluation keeps retrieval and generation separate so an answer cannot hide weak evidence behind fluent prose.

From Corpus to Gate

The workflow is intentionally explicit. Every stage leaves behind an artifact that can be reviewed, committed, compared, or uploaded by CI.

  1. 01
    Generategoldenset.jsonl

    Build corpus-grounded questions and expected contexts.

  2. 02
    Validatevalidation.json

    Check coverage, duplicates, sources, and corpus drift.

  3. 03
    Runpredictions.jsonl

    Call the RAG app through HTTP or a Python callable.

  4. 04
    Evaluateresults.json

    Score retrieval and generation with a pinned judge.

  5. 05
    Reportscorecard.html

    Package the run into a static, reviewable scorecard.

proofrag@local: evaluation-loop
$ proofrag generate --corpus ./docs --out goldenset.jsonl --n 20
20 grounded cases · 14 sources · corpus fingerprint saved
$ proofrag validate --goldenset goldenset.jsonl --corpus ./docs
validation passed · coverage and source references are consistent
$ proofrag run --goldenset goldenset.jsonl --endpoint http://localhost:8000/ask
predictions written to predictions.jsonl
$ proofrag evaluate --goldenset goldenset.jsonl --predictions predictions.jsonl
retrieval and generation scores written to results.json
$ proofrag report --results results.json --out scorecard.html
scorecard.html is ready to review
One continuous CLI run turns a source corpus into a reviewable evaluation report; each command can also run independently.

Golden Set Design

A benchmark is only useful when its cases stay grounded in the material the RAG system is meant to serve. ProofRAG therefore treats the golden set as a versioned evaluation asset, not temporary prompt output.

Corpus-grounded

Questions come from the evaluated corpus, with source and chunk metadata kept alongside every expected context.

Coverage-aware

Single-document, multi-document, and unanswerable cases expose different failure modes instead of collapsing quality into one prompt shape.

Drift-detecting

Validation catches duplicate cases, missing contexts, weak source coverage, and a corpus fingerprint that no longer matches.

Reports You Can Review

Reports are static HTML files with no external assets. They can be opened locally after an agent run, sent to a teammate, or retained as a CI artifact without a hosted dashboard.

ProofRAG HTML scorecard showing RAG evaluation metrics
The same evaluation data can be read as a complete scorecard or as a blind side-by-side comparison.

CI Gates

The GitHub Action turns the same evaluation into a merge gate. An absolute mode enforces a score floor; a regression mode compares the candidate run with a committed baseline and fails only when a metric moves beyond the configured tolerance.

Gate Modes

Absolute
--fail-under
Regression
proofrag diff
Artifacts
html + json
Summary
markdown
Absolute gateProtect a minimum quality bar.

Useful when the team already knows the lowest acceptable score for a release.

Regression gateProtect the current baseline.

Useful while changing the pipeline, when the direction of a metric matters more than a universal threshold.

github@actions: regression-gate
› uses: unshDee/proofrag@v0
goldenset: eval/goldenset.jsonl
predictions: predictions.jsonl
baseline: eval/baseline.json
fail-under: 0.7
› proofrag diff --baseline eval/baseline.json --candidate results.json
checking score floors and tolerated metric deltas
gate passed · no metric regressed beyond tolerance
The GitHub Action runs the same diff and threshold logic as the local CLI, then publishes the report and machine-readable result.

Three Ways In

ProofRAG exposes one evaluation model through three entry points. The interface changes, but the data contracts, metrics, reports, and gates do not.

Direct control
Use each stage independently.

The command line is the clearest surface for local experiments, scripts, and inspecting intermediate JSON or JSONL artifacts.

Scoring Backends

The default path uses ProofRAG's pinned LLM judge. DeepEval and Ragas can replace generation scoring while retrieval metrics, reporting, diffing, and CI behavior stay on the same shared surface.

Built-in judgeDeepEvalRagas
Generation scoring
Answer scorer Native Adapter Adapter
Shared evaluation surface
Retrieval metrics Included Included Included
Static scorecard Included Included Included
Diff and CI gates Included Included Included
Generation backends change the answer-scoring adapter, not the surrounding evaluation workflow.

Related RAG Utilities

I also maintain rag-utils[1], an intentionally loose collection of scripts I reach for while building RAG systems rather than a second end-to-end product.

Corpus preparation

  • DOCX chunks with media metadata
  • PDF to Markdown conversion
  • Chunk quality scoring
  • Overlap merging and semantic deduplication
  • SQLite embedding cache

Retrieval analysis

  • Offline retrieval evaluation
  • Context window packing
  • Query expansion and HyDE
  • Span-based RAG tracing
  • Hybrid retrieval with reciprocal rank fusion