Skip to content
All work

Agentic AI · Civic · Live

Samadhan

Reporting a pothole is easy. Getting it fixed is the problem — so the agent files the complaint, watches the legal clock, and drafts the appeal when it lapses.

Built

2026 · built for Vibe2Ship (Coding Ninjas × Google for Developers)

Stack

  • Next.js 16
  • Genkit
  • Gemini 2.5 Flash
  • Firebase
  • Cloud Run
  • Maps

01 — The problem

Every civic app takes the report and then goes quiet.

The citizen has no idea whether anyone is obliged to act, by when, or what to do when the deadline passes — and in most Indian cities a published municipal charter says exactly that, in a document almost nobody reads.

Samadhan does the reading. It knows a pothole in this category carries a 24-hour window and a garbage clearance carries twelve, it watches that clock, and it drafts the next legal step on the citizen’s behalf. Nothing is ever sent without the citizen pressing send — the drafting is autonomous, the sending is not.

The Samadhan dashboard showing filed issues, their SLA state and the agent trace.
The live dashboard. · docs/images/dashboard.png
Pipeline steps
5
one photo to a filed complaint
Escalation rungs
3
reminder → appeal → RTI
Tests
36
across 4 files, green CI on Node 24
Service categories
9
each with its own SLA window
02 — The agent

What actually runs when you send a photo.

Five steps, in this order, taken from the pipeline definition in source rather than from a diagram. One of them is not a model call, and that is the one worth looking at.

  1. 01

    Perceive

    Gemini 2.5 Flash

    Reads the photo and decides whether this is a civic issue at all, what kind, and how severe. Below 0.5 confidence, or not civic, and the report is rejected before anything else runs.

  2. 02

    Locate

    Google Maps

    Turns the coordinates into an address and a ward, so the complaint can name a municipal officer rather than a pin.

  3. 03

    De-duplicate

    Gemini Vision

    Compares the photo against open reports within 50 metres and links to an existing issue rather than filing a second one. Falls back to a tighter 20-metre radius when the vision compare is unavailable.

  4. 04

    Route

    Deterministic

    Picks the responsible authority from the service catalogue. Not a model call — the file header says so, because who is legally responsible for a pothole is a lookup, not a judgement.

  5. 05

    File

    Gemini 2.5 Flash

    Drafts the formal complaint in the language the citizen wrote in, and starts the statutory clock for that category.

Three more steps exist outside this run: a transcription pre-step that only fires when a voice note is attached, a verification step that runs when an officer marks the issue resolved, and the escalation step that runs inside the scheduled sweep. The console shows the five that make up filing.

03 — The clock

The deadline is the product.

Each category carries an SLA drawn from a published charter — 24 hours for a pothole under the GHMC citizen charter, 12 for garbage clearance, 48 for a carcass. The clock is seeded with concrete timestamps at creation, not a server-side placeholder, so it cannot drift. A breach is strict: the deadline instant itself is still on track.

When the sweep finds a breached issue it drafts the next rung. Which rung, and who it is addressed to, are decided in code; the model only writes the words.

  1. 01

    Reminder

    Rung 1 · deterministic

    Addressed to the authority’s grievance cell. Drafted the first time the deadline passes.

  2. 02

    Appeal to a higher authority

    Rung 2 · deterministic

    Addressed to the authority’s own named second-level contact, or to the zonal engineer if none is listed.

  3. 03

    RTI request

    Rung 3 · deterministic

    Addressed to the Public Information Officer, with a numbered four-item information request and the 30-day statutory period. The model is told it may not invent a name or a number.

What it deliberately does not do

  • No points, no badges, no leaderboard. A reward attached to reporting changes what gets reported — you would get whatever scores well, not whatever is broken. There is no scoreboard anywhere in the product.

  • The AI never closes an issue. Verification compares before and after photos and records a verdict, but it is advisory and marked as such. An auto-verified resolution is stored with a different marker from a citizen-confirmed one, and the two are never counted as the same thing.

  • Installable, not offline. It is a PWA you can add to a home screen. The service worker has no fetch handler and builds no log records, so it is a deliberate choice rather than an unfinished one.

What it gets wrong

The SLA windows come from published municipal charters, and four of the nine categories — sewer overflow, water leak, power outage, and the general “other” bucket — are marked approximate in the seed data because no citable published norm was found. The flag is in the data, not in a footnote, so anyone reading the catalogue sees which numbers are sourced and which are estimates.