ProofRAG
Python CLI · Agent skill · GitHub Action
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.
ProofRAG runs on Python 3.11+ and keeps its core install dependency-free. The same workflow is available through three interfaces.
- Recall at k
- Precision at k
- Normalized discounted gain
- Mean reciprocal rank
- Groundedness
- Correctness
- Completeness
- Citation quality
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.
- 01Generategoldenset.jsonl
Build corpus-grounded questions and expected contexts.
- 02Validatevalidation.json
Check coverage, duplicates, sources, and corpus drift.
- 03Runpredictions.jsonl
Call the RAG app through HTTP or a Python callable.
- 04Evaluateresults.json
Score retrieval and generation with a pinned judge.
- 05Reportscorecard.html
Package the run into a static, reviewable scorecard.
$ 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
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.

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
Useful when the team already knows the lowest acceptable score for a release.
Useful while changing the pipeline, when the direction of a metric matters more than a universal threshold.
› 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
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.
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 judge | DeepEval | Ragas | |
|---|---|---|---|
| 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 |
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