hitgate
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.
Measured results
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.
Install
pip install "hitgate[hybrid]" # harness plus the bundled hybrid retriever; the core has no dependencies
Quickstart
hitgate-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 points
The gate loop (run, freeze, compare) and how to point it at your own retriever (--retriever mypkg:retrieve) are in docs/byo-retriever.md.
Agent context: does your skill or memory edit still reach its target?
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 hit
Cases 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).
What it does, and does not
- 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).
Documentation
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
License
MIT, see LICENSE.
Metadata
Release files for hitgate 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hitgate-0.2.0.tar.gz | 106.8 kB | With provenance | Details for hitgate-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hitgate-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for hitgate-0.2.0-py3-none-any.whl |
Total release size: 185.0 kB
Release files / hitgate-0.2.0.tar.gz
| Download URL | hitgate-0.2.0.tar.gz |
|---|---|
| Size | 106.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6aa87bc7b2bef02568a4e4efd966ac7f3b3d1903db2f7ca91fec640cbfd08f7
|
|
BLAKE2b-256 checksum How to use checksums |
67a8388fae9fe681a98a8a93c545aff1342809c16e63fe27dd4e16248237d794
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / hitgate-0.2.0-py3-none-any.whl
| Download URL | hitgate-0.2.0-py3-none-any.whl |
|---|---|
| Size | 78.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
333dec6aa222f608cb1e64a94c1036365f783a4bd118572708595a5a402e57c0
|
|
BLAKE2b-256 checksum How to use checksums |
40e49f7f36ccd0d11425570db13a6ad62159b81a1f84602a25537921ca843bf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logSecurity for hitgate 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for hitgate-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.