Back to Portfolio

πŸ›οΈ CivicLens AI β€” Case Study

AI-Powered Civic Complaint Classification & Routing Engine

Overview

CivicLens AI is a civic issue reporting platform developed for hackathons. It uses a React frontend, FastAPI backend, and Google Gemini AI to automatically categorize, evaluate severity, and route infrastructure issues (potholes, sanitation, power outages) to municipal departments.

Live Demo App GitHub Repository

🎯 Problem & Motivation

Municipal complaint systems face backlogs due to manual triage. Citizens submit unstructured complaints without category tags or urgency scores, delaying dispatch teams.

βš™οΈ Technical Constraints

External LLM API calls add latency and financial cost during traffic spikes. Repeated submissions of similar issues (e.g. power outages in the same area) shouldn't re-trigger full AI parsing.

πŸ—οΈ Architecture & Caching Strategy

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Citizen β”‚ ────► β”‚ React Dashboard β”‚ ────► β”‚ FastAPI Backend β”‚ β”‚ Complaint Input β”‚ β”‚ (Form & Image Upload) β”‚ β”‚ (Request Pipeline) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Route to Dept β”‚ ◄──── β”‚ Gemini AI Classifier β”‚ ◄──── β”‚ In-Memory Semantic β”‚ β”‚ & Priority Queueβ”‚ β”‚ (Category & Urgency) β”‚ β”‚ Cache Check (Hit/Missβ”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

βš–οΈ Challenges & Trade-offs

Trade-off: Cache lifetime settings must balance latency savings with accuracyβ€”overly aggressive caching risks miscategorizing unique complaints with similar wording.

πŸ’‘ Lessons Learned

1. Implementing basic caching on AI endpoints is essential for hackathon scalability.
2. Structuring LLM outputs with JSON mode enforces reliable frontend rendering.

πŸ“Œ Planned Improvements