Reproducible, evidence-led Python/FastAPI system upgrading lexical-only PDF QA into a 4-stage Hybrid Retrieval pipeline
(SQLite FTS5 BM25 + 384-d Dense Vectors + Reciprocal Rank Fusion k=60 + Cross-Encoder Reranking),
fail-closed pre-retrieval RBAC & freshness gating, passage-level NLI claim verification, and cryptographic SHA-256 digest-bound HITL review.
Evaluated across 12 in-scope lexical/code queries, 14 zero-overlap semantic paraphrase queries, 8 RBAC-restricted queries,
8 stale-source governance queries, and 8 unanswerable abstention queries as of 2026-10-27.
| Retrieval Mode | Recall@5 | MRR@10 | NDCG@10 | Passage Claim Support | RBAC Leakage | Abstention Acc | Lexical Slice R@5 | Semantic Slice R@5 |
|---|
Reciprocal Rank Fusion (k=60) bridges lexical and semantic recall, while Cross-Encoder Reranking resolves rank ties in top-12 candidates.
All evaluation metrics in artifacts/rag_eval_report.json are cryptographically bound to dataset, corpus, and ONNX weight digests.
Compare how SQLite FTS5 BM25, 384-d Dense Vectors, Hybrid RRF (k=60), and Cross-Encoder Reranking score passages—and see how changing the user's RBAC role filters restricted documents before index scoring.
Synthesized answers are split into atomic sentences. Each sentence is checked for exact [DOC-ID#P#] citation containment in the authorized retrieval window and scored by the local ONNX NLI Cross-Encoder.
Under policy HITL-DIGEST-801, human reviewer sign-off is bound to
SHA256(normalized_query || sorted_chunk_sha256_digests || answer_sha256).
Simulate approving the queued item below and then editing 1 byte of the upstream policy document to observe automatic invalidation.