Your voice, written in the language of the law (Place: Bangalore, India).

There's a specific kind of helplessness that doesn't get talked about enough - the moment you notice something broken in your neighborhood, feel the frustration for a second, and then just... move on. Not because you don't care. Because you don't know who to tell, or how to say it in a way that gets taken seriously.

We kept circling back to that exact moment. A broken streetlight isn't a technology problem. It's a language problem - the language of institutions versus the language of ordinary people. Filing a real complaint means knowing which department owns the issue, writing in a formal register most people were never taught, and trusting that one voice, alone, will be enough to matter.

For most people, it isn't. So the complaint never gets filed, and the problem never gets fixed.

We wanted to build the translator that sits in that gap.


What we built

NagarikAI takes a citizen's plain-language description of a local problem - typed or spoken, in their own language - and turns it into a structured, formally-worded, correctly-addressed complaint, automatically.

The pipeline runs end to end:

  • Input - a citizen describes a problem via text or voice (Web Speech API), with zero formatting requirements. "There's no water again" is a valid input.
  • Classification - the report is analyzed and mapped onto an issue taxonomy (water, electricity, roads, safety, sanitation) with an assigned urgency level.
  • Location enrichment - the browser's Geolocation API paired with OpenStreetMap's Nominatim reverse-geocoding service tags the report with a precise, human-readable location, with no manual address entry and no API key required.
  • Authority routing - the classified category is mapped to the correct real-world civic authority. This isn't generic - it's ground-truthed per city (BWSSB for Bangalore water, DJB for Delhi water, BMC for Mumbai, CMWSSB for Chennai, KMC for Kolkata, and their electricity/roads equivalents), because a complaint addressed to the wrong department is functionally the same as no complaint at all.
  • Letter generation - a complete, formally-structured complaint letter is drafted automatically, in the tone and register that administrative authorities expect - the exact skill most people don't have and shouldn't have to learn.
  • Clustering & Community Pressure Score - when multiple reports describe the same issue in the same geographic area within a time window, they're merged into a single aggregated case. A pressure score reflects how many independent citizens are affected. One complaint is easy to file away. Fifty geotagged, clustered, identical complaints are a structured signal an authority is far less able to ignore.
  • Status tracking & escalation - every case moves through a visible pipeline (Submitted → Acknowledged → Under Review → Resolved), with stalled cases automatically flagged for a generated follow-up escalation letter.

The interface is multilingual by design - not as a checkbox feature, but because a tool built for people excluded from formal civic processes cannot assume they read the institutional language of the country they live in. Full right-to-left support was built in for languages that require it, from the component layer up, not bolted on afterward.


How it's built

We made a deliberate architectural bet early on: build a fully self-contained frontend application with zero infrastructure overhead, so the entire product is instantly demoable and deployable with no backend, no API keys, and no setup friction - while keeping every "intelligence" module cleanly isolated so it can be swapped for live generative reasoning without a rewrite.

App.jsx        → orchestration and UI
i18n.js        → full translation layer, RTL-aware
categories.js  → issue taxonomy, authority mapping per city
lib/classify.js → multilingual classification + urgency scoring
lib/letters.js  → formal letter generation, tone-aware per language
lib/storage.js  → persistence, seed data, clustering algorithm
lib/geo.js      → geolocation + reverse-geocoding utilities

The classification and letter-generation modules are the parts we cared most about getting right architecturally. In the current build, they run on carefully engineered multilingual heuristic logic - which means the app works completely offline, with no dependency on an external model, and demos flawlessly regardless of network conditions. But both modules are structured as clean, swappable interfaces specifically so they can be upgraded to live LLM-backed reasoning behind a serverless function without touching anything else in the system.

The clustering logic in storage.js was the hardest problem to get right conceptually: how do you decide that two reports - possibly worded differently, possibly in different languages, from nearby but non-identical coordinates - describe the same underlying issue? We group by category, geographic proximity, and time window to collapse noisy, independent reports into one coherent community case.

The map layer runs on Leaflet with OpenStreetMap tiles, seeded with realistic multi-city demo data spanning five metros - because a civic tool that only proves itself in one city hasn't proven the idea at all.


What we ran into

Real people don't describe problems the way databases expect them to. Nobody writes "water infrastructure outage" - they write "no water again," in whatever language they think in. Getting a classification layer to map informal, multilingual, emotionally-worded input onto a structured taxonomy - without requiring a paid API call just to function - took more iteration than any other part of the build.

Formality isn't universal either. A "formal tone" in one language's administrative writing is structurally different from another's, so the letter templates couldn't just be translated - they had to be rebuilt per language to actually read as legitimate to the institution receiving them.

And geolocation had to degrade gracefully. Plenty of the citizens this is built for won't grant location permissions, or will be on low-end devices with limited browser support. The system enriches a report when location is available and never blocks submission when it isn't - because the person least likely to have a flagship device is often the person least likely to have institutional access, and the product cannot punish that.


What we're proud of

That this isn't a slide deck describing a future product - it's a working pipeline, live, today: a citizen can describe a real problem and walk away, in seconds, with a structured, classified, correctly-addressed, formally-written complaint letter.

That accessibility wasn't retrofitted. Multilingual support and right-to-left layout shaped the codebase from the first component, not the last one.

That the Community Pressure Score is a genuinely new idea in this space - turning isolated, ignorable complaints into an aggregated, statistically harder-to-dismiss civic signal, which is the actual mechanism by which individual frustration becomes institutional accountability.

That zero-infrastructure wasn't a limitation - it was a decision. Anyone, on any device, can open the link and use the complete product with nothing to install and nothing to configure.


Where this goes next

The architecture was built with its own upgrade path in mind:

  • Swapping the heuristic classifier and letter templates for live generative model calls via serverless functions, enabling true context-aware reasoning instead of rule-based matching
  • Migrating from local storage to a shared Postgres/PostGIS backend so community pressure scores are real-time and visible across every user, not just the local device
  • A hosted multilingual speech-to-text layer for full offline-capable voice input
  • A verified, real authority directory - actual department names, emails, and escalation contacts, built city by city
  • Scheduled automatic escalation for stalled cases, generating follow-up letters without a human in the loop

The long-term goal hasn't changed since the first sketch of this idea: every citizen, regardless of language, literacy, or technical familiarity, should be able to turn "something is wrong here" into a formal, trackable, collectively-amplified civic action - in seconds, for free.

NagarikAI - your voice, written in the language of the law.

Built With

  • css-in-js
  • geolocation-api
  • ibm-plex-mono
  • ibm-plex-sans
  • javascript
  • leaflet-js
  • localstorage
  • openstreetmap
  • openstreetmap-nominatim
  • phosphor-icons
  • react-18
  • vite
  • web-speech-api
Share this project:

Updates