An evaluation harness for hybrid RAG retrieval (BM25 + dense + RRF): label-free evals and a CI gate that fails when ranking regresses.
Real run, outputs captured with timestamps. The ~10 s eval waits are sped up and labeled.
99 golden cases over this repo, pure retrieval, no reranker. Reproduce with the commands in docs/benchmarks.md.
| Retriever | Hit@1 | Hit@5 | MRR |
|---|---|---|---|
| BM25 only | 0.747 | 0.909 | 0.804 |
| Dense only | 0.646 | 0.899 | 0.744 |
| Hybrid (BM25 + dense + RRF) | 0.616 | 0.990 | 0.765 |
Hybrid is the only mode that keeps Hit@5 near 1.0 (+8 to +9 points). BM25 still wins Hit@1 and MRR on this identifier-heavy corpus, and that stays in the table on purpose. On six external corpora with zero tuning, Hit@5 ranges from 0.741 to 1.0 (benchmarks). Self-indexed sets are optimistic by construction: use them to compare two configurations, not to certify quality.
pip install "hitgate[hybrid]" # harness plus the bundled hybrid retriever; the core has no dependencieshitgate-demo . # index this repo, mine a golden set, measure Hit@K and MRR
hitgate-init . --output eval/golden.jsonl # keep the golden set, curate it, freeze a baseline
hitgate-compare ci.json baseline.json # exit 1 when any gated metric drops more than 5 pointsThe gate loop (run, freeze, compare) and how to point it at your own retriever (--retriever mypkg:retrieve) are in docs/byo-retriever.md.
The same gate runs over a context directory (skills, memory notes, agents) with no index and no extra dependencies:
hitgate-context ~/.claude/skills --label before # freeze
# edit a skill description, add a skill, rewrite a memory note
hitgate-context ~/.claude/skills --label after --baseline context.before.json # exit 1 if any case lost its hitCases are mined from the corpus itself: each skill's trigger phrases must rank that skill's description first; each note's description must rank its own body first. The shadowing report names the document that won instead. It is a lexical proxy for discoverability, not a judgement of the model's choice (ADR-0015).
- Detects retrieval regressions between two runs, with zero labeled data to start.
- Gates Hit@1/3/5, MRR and a per-intent breakdown. Plugs into any callable
(query, top, scope) -> [results]. - Does not measure absolute quality, and is not a framework, a hosted service or a maintained product.
- Complements answer-level tools such as RAGAS and DeepEval. It gates the retrieval layer, label-free (comparison).
Everything else lives in docs/:
- Bring your own retriever, CLI reference, use cases
- Benchmarks, methodology and ablations, comparisons
- Langfuse guide, LangChain and LlamaIndex adapters, CI template
- Decisions, roadmap, ADRs, consolidation plan
MIT, see LICENSE.
