DEV Community

Prasiddh Naik
Prasiddh Naik

Posted on

BharatZero

Gemma 4 Challenge: Build With Gemma 4 Submission

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

What I Built

BharatZero is an India-focused legislative explorer that aggregates parliamentary data spanning 1947 to the present into a unified, searchable platform. The app solves a critical transparency problem: India's legislative information is scattered across dozens of government portals (Sansad, PRS Legislative Research, Parliament Digital Library, Data.gov.in), hidden in PDFs, and nearly impossible to navigate comprehensively.

BharatZero brings it all together:

  • 4,708 bill records from three different official sources
  • 7,253 timeline events tracking parliamentary activity
  • 2,560 sitting days with chronological browsing
  • Prime Minister term filtering—see what legislation passed during any PM's tenure
  • Complete source attribution for data provenance

The platform features eight sections: Overview, Houses (with Lok Sabha power charts), Timeline, Bills, Committees, Debates, Acts, and Sources. Every record shows exactly where it came from—critical for democratic transparency.

Demo

Code

BharatZero

BharatZero is an India-focused legislative explorer for bills, Acts, Parliament timelines, House power, Prime Minister terms, and official source coverage. It is built as a Vite/React frontend with a small Node API server, Prisma, and PostgreSQL/Neon.

The current app is no longer just a static prototype. It uses generated legislative datasets plus a Prisma-backed repository path for runtime data.

Current Coverage

Generated local datasets currently include:

  • 4,708 Bill records
  • 7,268 Bill action records
  • 7,253 timeline events
  • 2,560 sitting days
  • 217 Act records
  • 15 Prime Minister profile records
  • 16 Lok Sabha power snapshots

Main source families:

  • Sansad legislation data, as of 2026-04-25
  • PRS historical bill data, 1992-2019
  • Parliament Digital Library bill/proceeding data, 1947-2003
  • Curated Prime Minister profile data from PM India
  • Curated Lok Sabha power snapshots from ECI/IPU-style election summaries

The PDL sync now covers older Prime Ministers, including Nehru, Shastri, Nanda, and Indira Gandhi-era windows where source records exist.

How I Used Gemma 4

I chose Gemma 4 31B Dense (gemma-4-31b-it) via the Gemini/OpenAI-compatible API for bill analysis generation. Legislative bills are dense, technical documents—often 50+ pages of legal language. Citizens, journalists, and researchers need accessible summaries, but manual summarization doesn't scale across 4,700+ bills.

BharatZero uses Gemma 4 to generate plain-language summaries, economic impact analysis, key provisions extraction, and social implications analysis. The model handles the bilingual nature of Indian legislation seamlessly—bill titles and summaries work in both English and Hindi contexts without separate model tuning.

Analysis is expensive, so BharatZero implements a persistent cache layer. Once a bill is analyzed, results are stored in PostgreSQL. Subsequent requests serve cached results instantly.

Why Gemma 4 31B Dense was the right fit:

  • Long context: Bills are lengthy documents; Gemma 4 handles full text input
  • Structured output: Returns consistent JSON for parsing into the UI
  • Factual accuracy: Critical for legislative analysis—hallucinations are dangerous
  • Cost efficiency: More economical than alternatives for high-volume batch analysis <!-- Don't forget to add a cover image if you want! -->

Top comments (0)