DEV Community

Muhammad Sufyan Jura
Muhammad Sufyan Jura

Posted on

🌿 CivicLens Mini: Bringing AI to the Streets, Not Just the Screen

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

🌿 CivicLens Mini: Bringing AI to the Streets, Not Just the Screen

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass.

What I Built

What if AI could help solve the problems we encounter on our streets instead of keeping us glued to our screens?

Meet CivicLens Mini, an open-source civic complaint intelligence app built for Hacktoberfest Islamabad 2026.

Think about the pothole on your daily commute, overflowing garbage near your home, a broken streetlight, or a water supply issue in your neighbourhood. Citizens can report these problems, but municipal complaint desks often struggle to organise incoming reports, identify urgent issues, and recognise when multiple people are reporting the same problem.

CivicLens Mini aims to make that process smarter.

Citizens can describe a civic issue in plain language, and an open-weight AI model transforms their complaint into a structured record that a human officer can review.

What makes it useful?

  • 🏙️ AI-powered complaint triage: Categorises complaints, generates short summaries, extracts reported duration and location, and identifies evidence mentioned by the citizen.
  • 🚦 Suggested priorities: Recommends a priority level with an explanation, always subject to human review.
  • 🔍 Duplicate detection: Flags potentially repeated complaints so officers can identify recurring neighbourhood problems.
  • 📊 Civic dashboard: Displays complaint metrics, recent reports, and editable complaint statuses.
  • 📋 Copyable reports: Generates a structured report containing the complaint, AI analysis, and a recommended next step.
  • 🔒 Local JSON storage: Stores complaint records locally without requiring a database server.

How does it help people touch grass?

The goal is to make digital tools serve real-world action.

Instead of spending hours manually sorting complaints, civic teams can use structured information to understand what residents are reporting and decide what needs attention. Citizens can report issues they encounter while walking through their neighbourhood, commuting, gardening, or spending time outdoors.

CivicLens Mini is a prototype, not an official municipal service. It does not resolve complaints automatically or replace public officials. It helps organise information so people can make better-informed decisions about problems in the physical world.

Demo

GitHub repository: Explore CivicLens Mini

Live demo: A public deployment link is not available yet. The app can be run locally using Streamlit, and its sample-data mode lets you explore the dashboard without an API key.

To try it:

  1. Clone the repository.
  2. Install the Python dependencies.
  3. Run streamlit run app.py.
  4. Load the three sample complaints to explore the dashboard, duplicate detection, status workflow, and report generation.
  5. Add an OpenRouter API key to enable live AI complaint analysis.

Full setup instructions are available in the project README.

Code

Repository: MuhammadSufyanJura47/civiclens-mini

The project is built with Python and Streamlit, with separate modules for AI analysis, duplicate detection, storage, and report generation.

Key files include:

  • app.py — dashboard and application workflow
  • ai_client.py — AI integration and response validation
  • duplicates.py — duplicate complaint detection
  • storage.py — local JSON storage
  • report.py — copyable report generation
  • test_core.py — offline tests for core functionality

The repository includes an MIT license.

How I Built It

I built CivicLens Mini as a focused hackathon MVP, with an emphasis on practical civic impact, open-weight AI, and a lightweight architecture that can run on a modest development machine.

1. Open-weight AI at the core

The project uses Qwen2.5-7B-Instruct, an open-weight, 7-billion-parameter language model, served through the OpenRouter API.

The model analyses free-text complaints and returns structured JSON containing fields such as:

  • Complaint category
  • Short summary
  • Reported duration
  • Location, when explicitly provided
  • Evidence mentioned
  • Suggested priority and reasoning

The selected model is within the challenge's 8-billion-parameter limit.

2. A validation layer for safer outputs

AI output is not treated as unquestionable truth. The application validates the response structure, restricts categories and priorities to supported values, handles malformed JSON, and avoids inventing missing details.

Every priority is presented as an AI suggestion requiring human review. The application also makes clear that complaints have not been officially verified.

3. Duplicate detection

CivicLens Mini supports semantic duplicate detection using the open-source sentence-transformers library and all-MiniLM-L6-v2 embeddings when installed.

If that dependency is unavailable, the app falls back to lexical matching and labels the active method clearly.

This distinction matters: matching similar words is not the same as understanding that two complaints describe the same underlying problem.

4. A lightweight application architecture

I used Streamlit for the dashboard and a local JSON file for persistent storage. This avoids the need to configure a database for the MVP.

OpenRouter provides access to the selected open-weight model without requiring a local GPU or large amount of RAM. The AI client is kept separate, making it easier to replace the inference endpoint with a local Ollama setup in a future version.

5. Testing and reliability

The project includes offline tests for response validation, malformed JSON handling, duplicate detection, storage, and report rendering.

The README documents an expected result of 19 passing tests. The test suite can be run with:

python test_core.py

Why Does Open Innovation Matter?

Civic technology should not depend on a single provider's closed ecosystem.

Open-weight models and open-source components give developers more control over how AI systems are built, evaluated, and adapted to local needs.

For CivicLens Mini, this matters in several ways.

Model flexibility: The AI integration is separated from the rest of the application. Developers can change the eligible model or move inference to a local endpoint without rebuilding the entire dashboard.

Accessibility: The app can run without a local GPU by using hosted inference. Its sample-data mode also allows people to explore the interface without configuring an AI key.

Transparency: The code shows how complaints are structured, how model responses are validated, how duplicates are detected, and where human review remains necessary.

Local adaptation: Civic categories, priority rules, and reporting workflows can be adapted to the needs of different cities and communities.

Privacy-conscious development: The application uses local JSON storage rather than requiring a hosted database. However, when live AI analysis is enabled, complaint text is sent to the configured inference provider. Local storage alone does not make the complete workflow private, so real deployments need an explicit data-handling policy.

Open innovation does not automatically make a system accurate, secure, or fair. It gives developers the freedom to inspect, improve, and adapt the system while remaining responsible for its limitations.

My long-term vision is to make civic technology more accessible to communities that need practical tools, not expensive infrastructure.

My Agent Session

I have not linked a DevRelay agent session yet.

The source code and project structure are available in the GitHub repository.

Prize Categories

  • Overall Hacktoberfest Open-Source AI Challenge: Eligible for consideration based on the project's compliance with the challenge rules.

No partner-specific prize category is claimed here. I will add a category only if the project genuinely uses that partner's technology in a qualifying way.


Built by Muhammad Sufyan Jura for Hacktoberfest Islamabad 2026.

The idea is simple: use AI to organise civic problems, so people can spend more time solving them in the real world. 🌱

hacktoberfest #hf26challenge #opensource #ai #python #civictech #buildinpublic

Top comments (0)