Live demo · free open-source stack

RAG that knows which law is still in force.

Ask about Indian income tax and LexRAG answers from the current Income-tax Act, 2025 — instead of confidently quoting a section that was repealed years ago.

25%100%
stale-law correctness · naive RAG → LexRAG
+49%
retrieval precision over baseline
held-out ✓
validated on unseen test cases
The problem

The same question, two answers —
one of them no longer the law.

India replaced the Income-tax Act, 1961 with the Income-tax Act, 2025 (in force April 2026). Section numbers everyone memorised changed — but most documents an assistant ingests still describe the old law.

✕ stale source · 2020 booklet

“Claim your life-insurance & PPF deduction under Section 80C of the Income Tax Act, 1961.”

Confident. Well-written. Wrong as current law.

✓ authoritative source · 2025 Act

The deduction is under Section 123, read with Schedule XV, capped at ₹1,50,000.

“80C” has zero operative hits in the 2025 Act.

Why naive RAG fails here

Retrieval has no idea what’s out of date.

Grabs the nearest text

A plain-English query matches the friendly old booklet better than dense legalese — so it retrieves “80C” and answers 80C.

No notion of authority

Booklet vs statute look identical to an embedding. Nothing flags one as repealed education and the other as governing law.

Exact tokens get blurred

Vector search smears rare anchors like “Schedule XV” or “Section 123” — it misses the very thing that makes the answer correct.

Why “better” RAG still fails

Faithfulness ≠ correctness.

Most RAG scores (like RAGAS faithfulness) only check that the answer is grounded in the retrieved text. A system that retrieves the stale booklet and answers “80C” scores 0.9+ on faithfulness — perfectly grounded, in the wrong source.

That’s why LexRAG also scores a separate correctness gate: did the answer cite a repealed Act or section as current? Faithfulness can’t catch that — the gate can.
Our solution

Currency-aware retrieval.

Prefer the authoritative & current statute on points of law — without throwing away the plain-language source for everything else.

Provenance on every chunk

Each chunk is tagged — statute: authoritative · 2026; booklet: explanatory · 2020.

Authority-weighted selection

When a stale explainer and the statute both match, the statute leads — on points of law. Booklet-only questions still answer from the booklet.

Hybrid dense + keyword

BM25 nails exact anchors that embeddings blur (Schedule XV, section numbers), fused with dense recall via RRF.

Currency-aware generation

The model is told the statute governs and must never present a repealed section as current — and to decline cleanly when the answer isn’t in the docs.

Under the hood

The pipeline, end to end.

Query-expansion (old→new terms) → HyDE → Weaviate hybrid (BM25 + Jina vectors + RRF) → currency-aware selection → grounded generation with refusal.

Ingest · offline
IT-Act 2025authoritative SEBI Bookletexplanatory Chunk + D1 tags Weaviate CloudBM25 · Jina · RRF
Query · online
User query Expandold → new HyDEGroq Hybrid search Currency selectD1 GenerateGroq Answer / refuse
Open interactive diagram ↗
Results

Measured — and validated on held-out data.

STALE-LAW CORRECTNESS

25% 100%

held on a fresh held-out set it was never tuned on

RETRIEVAL PRECISION

0.41 0.61

+49% — less irrelevant context in the prompt

Naive baseline LexRAG

32 cases (19 tuning + 13 held-out). Correctness gate judged by GPT-4o (cross-validated against Gemini); grounding metrics by RAGAS. Ties on the easy categories (simple lookup, refusal) — as expected.

Try it

Ask LexRAG.

It answers only from the Income-tax Act, 2025 and the SEBI investor-education booklet. Off-topic questions are declined.

LexRAG · grounded in 2 documents
About this demo: the benchmark numbers above were measured with GPT-4o-mini + a CrossEncoder reranker. This live demo runs a free open-source stack — Groq (Llama 3.3), Jina embeddings, Weaviate hybrid search — so quality is a notch below the benchmark, but the currency-aware behaviour is identical.
LexRAG · github.com/vivek314/LexRag
Built to show that legal RAG must know what’s current — not just what’s grounded.