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.
π― 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
- FastAPI Pipeline: Asynchronous backend router managing complaint submissions and status queries.
- Semantic Cache: Designed to intercept recurring issue descriptions, significantly reducing redundant external Gemini API calls.
- Gemini AI Classification: Assigns category, severity (Low/Medium/Critical), and department routing tags.
βοΈ 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
- Planned Map view integration for municipal issue clusters.
- Planned Automated status notifications via Webhooks.