DEV Community

Sudhir Sharma
Sudhir Sharma

Posted on

CivicPulse Tricity: Multilingual AI Digital Public Infrastructure Platform for Chandigarh

What I Built

CivicPulse Tricity (NagrikSetu AI) is an open-source, multilingual Digital Public Infrastructure (DPI) platform built for the Code for Communities Chandigarh hackathon (supported by Google for Developers and GDG Cloud Chandigarh).

It unifies grassroots citizen feedback across Chandigarh, Mohali, and Panchkula by accepting natural voice notes, WhatsApp messages, and web tickets in Punjabi (ਪੰਜਾਬੀ), Hindi (हिंदी), and English, standardizing them through Google Gemini 1.5, geocoding complaints into Le Corbusier sector grids, and generating executive Detailed Project Reports (DPRs) for municipal commissioners.

🌐 Live Demo Portal: shivysidinfo.tech/civicpulse
📊 7-Slide Pitch Deck: shivysidinfo.tech/civicpulse/deck
🐙 GitHub Repository (MIT): github.com/satanic47/civicpulse-tricity

The Problem It Solves

Governments across Indian urban centers struggle with fragmented citizen feedback loops. In the Chandigarh Tricity region:

Linguistic Barrier: Over 70% of grassroots citizens verbally communicate in Punjabi or Hindi, but traditional municipal portals force rigid, English-only dropdown forms.
Data Fragmentation: Grievances sit isolated across WhatsApp messages, call center logs, and social media without spatial clustering. Municipal engineers cannot distinguish isolated complaints from systemic infrastructure failures.
Budget Misalignment: Multi-crore municipal capital budgets are often allocated based on historical inertia rather than real-time demand hotspots and citizen safety urgency.
How Open-Source & Google AI Powers the Solution
[Citizen Voice / WhatsApp (Punjabi / Hindi / English)]
↓
[Google Gemini 1.5 Multilingual Normalization Engine]
↓
[Canonical Schema: Urgency (1-10) + Municipal Dept Routing]
↓
[Le Corbusier Sector Grid Centroid Geocoding (Sectors 1-60)]
↓
[Spatial Clustering & Sector Health Scoring]
↓
[Gemini Municipal Capital DPR & Budget Generator]

  1. Dialect Normalization & Urgency Scoring

When a citizen speaks or texts in colloquial Punjabi ("ਸਾਡੇ ਸੈਕਟਰ 22 ਸ਼ਾਸਤਰੀ ਮਾਰਕੀਟ ਕੋਲ ਪਾਣੀ ਦੀ ਮੁੱਖ ਪਾਈਪ ਫਟ ਗਈ ਹੈ"), the Gemini 1.5 engine extracts the canonical intent, scores the hazard urgency (9/10), and assigns the municipal wing:

python

app/core/gemini_engine.py

prompt = f"""
Analyze this citizen civic report from Chandigarh Tricity:
Input: "{raw_input}"
Extract the following JSON:

  • language_detected: (e.g., "Punjabi (Gurmukhi)", "Hindi", "English")
  • category: ("Roads & Infrastructure", "Water Supply & Sewage", "Electricity & Lighting", "Public Safety", "Sanitation")
  • summary: (Canonical 1-sentence English description)
  • urgency_score: (Integer 1-10 based on immediate safety hazard)
  • routed_department: (MCC Division: B&R Roads, Water Supply, Electricity, Sanitation)
  • location_extracted: (Sector, Phase, or landmark) """
  1. Le Corbusier Sector Grid Geocoding

Colloquial landmarks (e.g., Shastri Market, Patel Market, Kiran Cinema, PU Gate 2) are resolved against pre-computed polygon centroids for Chandigarh Sectors 1–60, Mohali Phases, and Panchkula:

python

app/core/geocoding.py

def resolve_sector(text: str) -> Dict[str, Any]:
# Regex extraction of sector numbers and Tricity landmarks
match = re.search(r'(?:sector|sec|ਸੈਕਟਰ|सेक्टर)\s*(\d{1,2})', text, re.IGNORECASE)
if match:
sec_num = int(match.group(1))
return SECTOR_CENTROIDS.get(f"Sector {sec_num}", DEFAULT_CENTROID)
return match_landmark(text)

  1. Capital DPR Copilot

Rather than leaving issues as open complaint tickets, CivicPulse groups incident clusters and synthesizes municipal Detailed Project Reports (DPRs) with estimated costs in Lakhs:

json
{
"dpr_id": "DPR-2026-001",
"title": "Sector 22 Shastri Market Underground Water Conduit Overhaul",
"sector_or_ward": "Sector 22 (Ward 14)",
"urgency_level": "CRITICAL",
"estimated_cost_lakhs": 42.5,
"priority_score": 94,
"roi_metric": "Prevents chronic road foundation waterlogging across 1.2 km commercial zone."
}

Validation & Automated Testing

The entire system is containerized with Docker and verified with 21/21 passing automated unit tests:

test_gemini_engine.py: Validates multilingual dialect triage and fallback handling.
test_geocoding.py: Verifies sector boundary and landmark resolution.
test_api.py: Tests REST endpoints, voice upload pipelines, and hotspot clustering.

What's Next

We are expanding CivicPulse Tricity with WhatsApp webhook integration via Twilio and offline local Gemma 2 inference for air-gapped municipal data centers.

Built with open weights, open APIs, and open-source civic pride for Hacktoberfest 2026!

Top comments (0)