rag-ci
Regression testing and configuration sweeps for RAG pipelines.
Status: usable.
runandgatework end to end, including as a GitHub Action.sweepand golden-set generation are next; see the design document.
The problem
You changed the chunk size. Did retrieval get better?
Most teams cannot answer that. They ship a change, eyeball a few queries, and move on. The 2026 literature suggests this is expensive: Beyond the Reranker finds that many retrieval enhancements stop contributing anything once a strong reranker is present. People are stacking techniques that do nothing and paying for them in latency and tokens.
Existing evaluation tools do not close the gap. They report a bare score with no confidence interval — so a recall@10 moving from 0.71 to 0.74 on 200 questions looks like progress when it is indistinguishable from noise. None of them run as a gate on a pull request, and none of them sweep configurations.
Meanwhile the academic side settled this years ago: paired bootstrap tests with 10,000 resamples and 95% confidence intervals are standard in T2-RAGBench and HetDocQA. That rigor has not reached the tools practitioners actually run.
Commands
uvx rag-ci init # scaffold an adapter for your pipeline ✅
uvx rag-ci run # measure, with confidence intervals ✅
uvx rag-ci gate # fail the PR only on a real regression ✅
uvx rag-ci golden gen # generate candidate questions planned
uvx rag-ci golden review # accept / edit / reject, then commit planned
uvx rag-ci sweep # find the configuration that wins planned
Use it in CI
name: rag-ci
on: pull_request
permissions:
contents: read
pull-requests: write
jobs:
retrieval:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: Nokimalos/rag-ci@v0.1.0
with:
adapter: ragci_adapter.py
golden: tests/golden.jsonl
The gate exits 1 on a regression and 2 when it cannot make a trustworthy comparison —
an invalid run, or a baseline recorded against a different golden set. See
docs/github-action.md for recording your first baseline and tuning
min-effect.
A worked example lives in examples/reference/: an adapter, its
golden set, and a committed baseline. rag-ci gates it on every pull request to this
repository.
What makes it different
- Ground truth anchored to document passages, never to chunks. Change the chunk size and your golden set still works. This is what makes sweeping possible at all.
- Statistics as the core mechanism. Every metric carries a confidence interval. The gate uses a paired bootstrap test and blocks only when a regression is both statistically significant and large enough to matter.
- Built for real corpora. Stratified sampling for question generation, successive halving instead of grid search, index-time and query-time parameters separated so sweeps rebuild indexes as rarely as possible, and a recall-vs-pool-size curve so results measured on a sub-corpus are extrapolated honestly rather than quietly overstated.
- Agnostic by design. No RAG framework as a dependency. You write one adapter file; your stack stays yours. The adapter contract captures multi-step retrieval trajectories, so agentic and multi-hop pipelines are first-class.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rag_ci-0.1.0.tar.gz.
File metadata
- Download URL: rag_ci-0.1.0.tar.gz
- Upload date:
- Size: 34.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c7490d87f43199960462a2386b26584b212a0b8ebaa21df89458f53d1b928bc
|
|
| MD5 |
7216b9788f75e4a4aec35f450303d8ec
|
|
| BLAKE2b-256 |
5a2cc40f288534a8fb6cdaeba7e20a23cfca891d958c12d28b37e86504bc09d2
|
Provenance
The following attestation bundles were made for rag_ci-0.1.0.tar.gz:
Publisher:
release.yml on Nokimalos/rag-ci
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rag_ci-0.1.0.tar.gz -
Subject digest:
1c7490d87f43199960462a2386b26584b212a0b8ebaa21df89458f53d1b928bc - Sigstore transparency entry: 2394540205
- Sigstore integration time:
-
Permalink:
Nokimalos/rag-ci@695c2bbf165244f87ede3c0cf49ceaa7ced24e46 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Nokimalos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@695c2bbf165244f87ede3c0cf49ceaa7ced24e46 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rag_ci-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rag_ci-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba568ee0718ee94200506b50657ddb5ae7406bd3c46301a0a0ddc78ddd414b37
|
|
| MD5 |
be275bcc0ec84612a743558e78c94282
|
|
| BLAKE2b-256 |
f88b115c996695cc384df9579512a9ca7a35d4ab1e6106f3710ac27171c262f9
|
Provenance
The following attestation bundles were made for rag_ci-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Nokimalos/rag-ci
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rag_ci-0.1.0-py3-none-any.whl -
Subject digest:
ba568ee0718ee94200506b50657ddb5ae7406bd3c46301a0a0ddc78ddd414b37 - Sigstore transparency entry: 2394540701
- Sigstore integration time:
-
Permalink:
Nokimalos/rag-ci@695c2bbf165244f87ede3c0cf49ceaa7ced24e46 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Nokimalos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@695c2bbf165244f87ede3c0cf49ceaa7ced24e46 -
Trigger Event:
push
-
Statement type: