Inspiration

We've all seen it: garbage piling up on streets, overflowing bins nobody empties, and waste dumped in public spaces for days.

The real problem is not just the mess. It is the helplessness.

Who do I contact? What should I write? Will anyone even respond?

Most people give up before reporting the issue because the process is slow, unclear, and manual. Sanitation problems are visible and solvable, but they persist because reporting them is difficult and accountability is weak.

That is why we built CivicLens — to make civic action as simple as taking a photo.


What it does

CivicLens is a visual sanitation reporting platform that turns a photo or video into a complete civic action workflow.

A resident uploads a sanitation fault, and CivicLens automatically:

  • Detects the issue using Gemini VLM
  • Classifies the fault, such as overflowing bins, illegal dumping, or uncollected waste
  • Estimates severity
  • Adds GPS location, street address, and timestamp
  • Finds the responsible sanitation authority
  • Drafts a formal complaint email
  • Generates a social media post
  • Logs the case in MongoDB with a unique Case ID
  • Tracks the resolution status
  • Sends follow-ups if the issue remains unresolved

If multiple residents report the same issue, CivicLens deduplicates and bundles the reports into one stronger complaint, such as:

14 residents affected.

Sanitation officers also get a dashboard with heatmaps of open cases ranked by severity and report volume.


How we built it

CivicLens uses a multi-agent pipeline where each agent has one clear responsibility.

Step 1 — Vision Agent

Gemini VLM analyzes the uploaded photo or video, detects the sanitation fault, classifies the issue, estimates severity, and generates a short fault description.

Step 2 — Context Agent

The system collects GPS coordinates, timestamp, and user context. Google Maps API converts the coordinates into a readable street address.

Step 3 — Authority Lookup Agent

Based on the location and fault type, CivicLens identifies the responsible sanitation department, including contact email, working hours, and jurisdiction details.

Step 4 — Communications Agent

The platform generates a formal complaint email and a social media post using the full case context. The resident only reviews and sends.

Step 5 — Tracking Agent

Every report receives a unique Case ID and is stored in MongoDB. The system tracks status and triggers follow-up emails or social posts if the case remains unresolved.

Step 6 — Deduplication Layer

Every new report is checked against existing open cases using a MongoDB geo-query.

Two reports are treated as the same issue if the distance between them is within a defined radius.

$$ d = \sqrt{(\Delta lat)^2 + (\Delta lon)^2} \times 111000 $$

Where:

  • d = distance between two reports in meters
  • Delta lat = difference in latitude
  • Delta lon = difference in longitude
  • r = duplicate detection radius

Duplicate condition:

$$ d \le r $$

If true, CivicLens bundles the reports into one stronger case. Repeated unresolved issues are automatically escalated with previous complaint history.


Tech Stack

  • Gemini VLM — image understanding, fault classification, and severity estimation
  • Google Cloud Agent Builder — multi-agent orchestration
  • MongoDB MCP — case logging, tracking, and deduplication
  • Elastic MCP — historical search and geographic clustering
  • Google Maps API — geocoding and location context
  • MongoDB — database for users, reports, cases, and resolution status
  • Dashboard — heatmap and case management for sanitation officers

Challenges we ran into

Authority matching

Sanitation departments differ from city to city, so finding the correct authority instead of a generic helpline required careful lookup logic.

Duplicate detection

Two reports near each other may refer to the same bin or two separate issues. We tuned the distance threshold and used image-based confirmation to reduce false merges.

Simple user experience

The pipeline has many moving parts, but the resident experience had to feel like one tap. We kept the interface clean and showed only useful progress updates.

Demo reliability

Because multiple APIs are involved, we added fallback logic to prevent the demo from failing due to timeouts or missing data.


Accomplishments that we're proud of

  • Built an end-to-end pipeline from photo upload to complaint generation and case tracking
  • Added deduplication so multiple reports strengthen one civic case
  • Created both resident and sanitation officer interfaces
  • Built automatic follow-ups for unresolved issues
  • Used MongoDB MCP and Elastic MCP as core parts of the system, not just add-ons

What we learned

Clear agent boundaries are important. Each agent needs one responsibility and a strict input-output contract.

We also learned that Gemini VLM can handle sanitation triage well, including waste type detection and severity estimation from a single image.

Most importantly, we learned that formal complaints and public social pressure work better together. Email creates an official record, while social posts create urgency.


What's next for CivicLens

  • Direct integration with municipal sanitation CRMs
  • WhatsApp and SMS-based reporting
  • Predictive sanitation fault mapping using historical data
  • Cross-city benchmarking for resolution times
  • NGO and journalist API access for identifying neglect patterns

Final vision

Every city faces sanitation problems.

CivicLens turns scattered complaints into structured civic action. It gives residents a voice, gives authorities useful data, and creates an accountability loop from report to resolution.

We built CivicLens to make sanitation reporting faster, smarter, and impossible to ignore.

Built With

Share this project:

Updates