Mūla Śākṣī (Sanskrit: Root Witness) — an AI-powered contradiction detection system that cross-references citizen-submitted evidence against government records to surface fraud, discrepancies, and systemic irregularities.
India's welfare systems lose billions annually to PDS grain diversion, pension siphoning, inflated tenders, ghost scholarship beneficiaries, and manipulated land records. Citizens who witness irregularities have no systematic way to verify or document them.
Mūla Śākṣī gives every citizen access to a forensic AI audit pipeline powered by Gemini 1.5 Pro:
- Extracts every verifiable claim from evidence using structured AI analysis
- Cross-references those claims against government records + 70-witness consensus dataset
- Generates a legal-grade audit report with contradiction score, risk score, integrity heatmap, and escalation path
Next.js Frontend → API Routes → Gemini 1.5 Pro (3-Stage Chain) → File-based JSON Store
│
Synthetic Dataset
(70 witness entries)
| Stage | Name | Description |
|---|---|---|
| 1 | Claim Extraction | Extracts entities, events, quantities, locations with confidence scores |
| 2 | Contradiction Engine | Cross-references against gov records + 70 witnesses; classifies by type/severity |
| 3 | Report Generator | Produces legal verdict, risk score, recommendation, legal notice |
mula-sakshi/
├── app/
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Landing page
│ ├── submit/page.tsx # Evidence upload + processing animation
│ ├── report/[id]/page.tsx # Animated report reveal
│ └── api/
│ ├── analyze/route.ts # POST — 3-stage Gemini pipeline
│ ├── submissions/route.ts # POST/GET — submission management
│ └── reports/[id]/route.ts # GET — fetch report
├── components/
│ ├── ui/
│ │ ├── ScoreMeter.tsx # SVG gauge (animated)
│ │ ├── IntegrityHeatmap.tsx # 9-domain heatmap
│ │ └── ProcessingAnimation.tsx # Pipeline stage animation
│ └── report/
│ ├── ContradictionCard.tsx # Expandable citizen vs official view
│ └── EscalationBanner.tsx # Auto-escalation trigger
├── lib/
│ ├── gemini.ts # Full 3-stage Gemini pipeline
│ ├── firebase-admin.ts # Thin shim → delegates to db.ts
│ ├── db.ts # File-backed JSON store (no external DB needed)
│ ├── demoData.ts # Pre-built demo report + 5 cases
│ └── utils.ts # Shared helpers
├── data/
│ └── witnesses.ts # 70 synthetic witness entries
├── types/index.ts # Full TypeScript types
├── styles/globals.css # Grain, cursors, gradients
└── render.yaml # Render deployment blueprint
git clone https://github.com/your-username/mula-sakshi.git
cd mula-sakshi
npm installcp .env.example .env.local
# Edit .env.local — add at minimum: GEMINI_API_KEYGet a free Gemini key at: https://aistudio.google.com/app/apikey
npm run dev
# Open http://localhost:3000http://localhost:3000/report/demo
Built for Google Solution Challenge 2026. "The root witness never lies."