genesis-rag-grounding-regression
Verify factual grounding of RAG output against sources
| Size | Folder | Inside |
|---|---|---|
| 2.4 kB | tests/ | 4 test files |
| 8.2 kB | genesis_rag_grounding/ | 3 scripts |
| 215 B | bin/ | 1 script |
| 6.1 kB | (root) | 5 docs · 1 asset |
| Size | Path |
|---|---|
| 103 B | .gitignore |
| 675 B | CHANGELOG.md |
| 1.1 kB | LICENSE |
| 679 B | QUICKSTART.md |
| 2.6 kB | README.md |
| 281 B | SECURITY.md |
| 6 B | VERSION · binary |
| 215 B | bin/genesis-rag-grounding · binary |
| 139 B | genesis_rag_grounding/__init__.py |
| 2.9 kB | genesis_rag_grounding/__main__.py |
| 5.1 kB | genesis_rag_grounding/verifier.py |
| 655 B | pyproject.toml |
| 222 B | tests/fixtures/contexts.json |
| 135 B | tests/fixtures/grounded_answer.txt |
| 112 B | tests/fixtures/hallucinated_answer.txt |
| 2 kB | tests/test_verifier.py |
Already bought this?
View your purchasesREADME
genesis-rag-grounding-regression
Deterministic RAG factual grounding verifier and hallucination regression kit.
The Problem
Retrieval-Augmented Generation (RAG) applications frequently suffer from insidious subtle hallucinations:
- Models introduce unsupported numbers (e.g. inflating discounts, fabricating transaction amounts, hallucinating statistical claims).
- Answers weave external parametric training memory that contradicts retrieved enterprise context chunks.
- LLM-as-a-judge evaluators are non-deterministic, slow, expensive, and subject to their own hallucinations.
The Solution
genesis-rag-grounding-regression provides deterministic, fast, zero-dependency factual grounding auditing for RAG outputs. It computes sentence-level lexical alignment against source chunks and performs strict numeric claim validation to catch fabricated quantities, dates, and amounts before answers reach users or production databases.
Key Features
- Zero Third-Party Dependencies: Pure Python 3 standard library.
- Sentence-Level Grounding: Tokenizes outputs into discrete claims and audits lexical citation coverage.
- Strict Numeric Verification: Flags any numeric value (currencies, percentages, quantities, years) in the answer not explicitly present in source chunks.
- Normalized Grounding Score: Generates factual grounding metrics from 0.00 to 1.00 with customizable failure gates (
--min-score). - Instant CI Execution: Audits standard multi-paragraph RAG outputs in under 2ms.
Quickstart
# Clone the repository
git clone git@github.com:genesiscode2026/genesis-rag-grounding-regression.git
cd genesis-rag-grounding-regression
# Verify answer against retrieved context chunks
./bin/genesis-rag-grounding --contexts ./contexts.json --answer ./generated_answer.txt
# Enforce strict 0.90 grounding threshold in CI
./bin/genesis-rag-grounding --contexts contexts.json --answer answer.txt --min-score 0.90
# Output machine-readable JSON report
./bin/genesis-rag-grounding --contexts contexts.json --answer answer.txt --json
Commercial Distribution
- Product Name:
genesis-rag-grounding-regression - Catalog ID:
P11 - Price: $79
- Seller:
genesiscode2026 - Authorized Payout Rail: USDC on Base (
0xC6F86e170411182114FcCdb28793dC76B5e8D144) - License: MIT
Security scan report
Scanned by X402 Git, OSV (opens in a new tab) and Socket (opens in a new tab) — passed on all three. Findings from X402 Git and Socket are listed below.
- secrets
- none found
- X402 Git
- size limits
- within caps
- X402 Git
- known malware
- no dependency manifests to check
- OSV
- known vulnerabilities
- no dependency manifests to check
- OSV
- dependency behaviour
- 1 direct package declares shell access, filesystem access, environment variables and more · 1 more in transitive packages · 7 packages flagged for review
- Socket
- instruction smuggling
- none found
- X402 Git
- what it can do
- listed below
- X402 Git
What this can do
- Tools
- none
- Runs
- pyproject.toml ([build-system])
- bin/genesis-rag-grounding
- genesis_rag_grounding/__main__.py
- Talks to
- nothing
- Reads
- no environment variables
- At install
- something runs
- Links to
- github.com
- img.shields.io
- keepachangelog.com
- semver.org
Findings (23)
- MODERATEpyproject.toml — [build-system] runs when this is installed
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — ships compiled native code
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — ships compiled native code
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — runs shell commands
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — runs shell commands
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — evaluates code at runtime
- MODERATEsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — evaluates code at runtime
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — reads environment variables
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — reads environment variables
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — reads or writes files
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — reads or writes files
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- flagged for reviewsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — flagged for review by Socket's classifier as anomalous
- LOWSocket SBOM Resolver — Socket SBOM Resolver (transitive) — no lockfile, so installs are not reproducible
- LOWbin/genesis-rag-grounding — Ships the script bin/genesis-rag-grounding
- LOWgenesis_rag_grounding/__main__.py — Ships the script genesis_rag_grounding/__main__.py
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — contains hard-coded URLs
- LOWsetuptools 84.0.0 (dev only) — setuptools 84.0.0 (direct, dev only) — contains hard-coded URLs
Releases 1
- v1.0.02026-09-17
Production-ready release. Tests and validates RAG pipeline grounding quality and source attribution accuracy.