Code by NikshithNikshith Nooka
← All work

02 / RAG · Public policy

GovReasonRAG

Evidence-contracted reasoning for Indian welfare schemes: an eligibility answer is only given when every required clause has a source.

Role
Design and development
Stack
FastAPI · Next.js 14 · LangGraph · BGE embeddings · BM25 · Ollama · LoRA
Context
Research-grade platform over 4,772+ central and state schemes
Code
GitHub
Illustration of the GovReasonRAG interface
Interface illustration, drawn from the project's documented features. Values shown are examples.

The problem

Ordinary RAG fails on public policy. It invents income limits, mixes superseded schemes with current ones, leaves out disqualifying conditions, and cites circulars that don't exist. For a citizen, a wrong eligibility answer has real cost.

What I built

  • An evidence contract: income, category, domicile, exclusion and gazette clauses must each be backed by a retrieved source.
  • A coverage gate that forces the system to abstain and ask for the missing fact when evidence is incomplete.
  • Hybrid retrieval that fuses dense BGE embeddings with BM25 keyword search.
  • A bi-temporal filter that drops superseded policy versions before reasoning.
  • A deterministic rule engine that does the threshold comparisons exactly, so the language model never does the arithmetic.

In numbers

4,772+welfare schemes indexed
5pipeline stages
98.6%accuracy in the full configuration
0.0%hallucination rate in the full configuration

Ablation results, as reported in the project README

Vanilla RAG (dense only)68.4% accuracy · 27.8% hallucination
Dense retrieval + re-ranker76.1% accuracy · 19.3% hallucination
Hybrid retrieval (BGE + BM25)84.7% accuracy · 12.6% hallucination
Evidence contract without the gate89.2% accuracy · 8.4% hallucination
Full GovReasonRAG98.6% accuracy · 0.0% hallucination

How it works

The five-stage pipeline, from the project figures
The five-stage pipeline, from the project figures

Takeaway

Each stage removes a specific failure. The largest single step comes from refusing to answer when the evidence isn't there.

Next project

GeoSick AI