← All Engineering Notes/WHATS NOW BUILDABLE // CITATION-VERIFIED RAG· 2026-11-22

100% Citation Provenance in Legal Discovery with FAISS, BM25, and Post-LLM Stripping

Prompting an LLM not to hallucinate fails legal and compliance review if even one source ID is invented. Here is how hybrid RRF retrieval and deterministic post-processing enforce hard provenance.

Why 95% Citation Accuracy Is Unusable in Discovery

When an attorney searches tens of thousands of exported SMS records for a matter, a single fabricated message ID or misattributed timestamp invalidates confidence in the entire report.

Prompt instructions cannot enforce a hard invariant. Only deterministic code sitting between the model output and the UI can guarantee that every rendered citation exists in the retrieved matter corpus.

Hybrid Retrieval Plus Deterministic Post-Processing

Building TextTimeline on Google Cloud, three mechanisms drove retrieval quality and provenance:

  • ▸FAISS + BM25 via Reciprocal Rank Fusion (RRF): Dense embeddings (text-embedding-005) surface semantic intent while BM25 catches exact names, dollar figures, dates, and slang. Across my 90-query evaluation harness, RRF lifted free-form P@10 from 0.42 (single-mode) to 0.70.
  • ▸Deterministic citation verifier: Every synthesized claim must carry structured message IDs. A post-processor checks every ID against the retrieved set, strips any unverified ID, drops claims left without valid backing, and fails closed if nothing survives.
  • ▸Eval-driven iteration: Running the 90-query LLM-as-judge suite before every retrieval change revealed where hard metadata filters hurt recall across 6 of 9 query categories, preventing silent regressions.

// VERIFIED PROOF & NEXT STEP

Inspect the Shipped System or Drop a Sanitized Brief

I partner with consultancies under MNDA and directly with operator leadership teams to build these systems inside your own Azure or Google Cloud tenant.