๐ก Inspiration
Every year, municipal city councils receive hundreds of thousands of 311 service tickets for potholes, water line disruptions, fallen trees, and streetlight outages. However, up to 40% of public works field dispatches fail or get delayed due to incomplete or ambiguous initial reports:
- A ticket marked "small pothole" turns out to be an active 6-foot sinkhole swallowing water lines.
- A report of a "fallen branch" hides the fact that it is entangled in energized 12,000-volt power lines.
- Repair crews arrive on scene only to find locked gates with missing access codes.
Traditional 311 systems are strictly passiveโrelying on static web forms or unmonitored voicemails. Human call-backs are cost-prohibitive and slow. We asked ourselves:
What if code could pick up the phone, have an intelligent, natural conversation with the citizen, validate official permits mid-call, extract actionable telemetry, and orchestrate emergency multi-agent handoffs across city departments in real time?
That inspiration led to CivicScout.
๐ What It Does
CivicScout is a proactive public works voice intelligence agent powered by CALL-E, FastMCP, Google Cloud Run, and Firestore:
- Proactive Outbound Verification: As soon as a citizen files a 311 ticket or a field sensor alerts the system, CivicScout retrieves pending tickets from Firestore and initiates an outbound voice call to the reporter.
- Context-Aware Municipal Dialogue: CivicScout introduces itself as the appropriate department representative (e.g. Urban Forestry, Roads & Infrastructure, Water Reclamation) and engages in a natural, multi-turn dialogue to confirm ground reality.
- Mid-Call FastMCP Tool Invocations: While speaking, the CALL-E agent directly invokes FastMCP tools:
query_authorization_code: Validates municipal contractor permits or employee security credentials.update_ticket_status_midcall: Updates work order progress and severity live during the call.trigger_department_escalation: Escalates the case when multi-agency coordination is required.
- Structured JSON Extraction: Upon call completion, CALL-E enforces a strict Pydantic JSON schema that extracts verified cross streets, specific hazard dimensions, access codes, and actionable crew instructions into Firestore.
- Multi-Agent Departmental Escalation: If a road defect reveals a high-pressure water main rupture or electrical hazard, CivicScout automatically triggers an inter-departmental escalation, dynamically spinning up a Secondary CALL-E Agent (e.g., Emergency Utility & Multi-Agency Dispatch) with fresh emergency context to coordinate immediate rapid response.
๐ ๏ธ How We Built It
CivicScout was designed from the ground up for high reliability, low latency, and cloud scalability:
- Voice & Telephony Engine (CALL-E SDK / API): Manages outbound calling, natural conversational flow, prompt template injection, and structured schema enforcement.
- Tool Protocol (FastMCP): Built with the Model Context Protocol (MCP) using
FastMCP, exposing database verification and ticket manipulation tools directly to the voice model with sub-second execution. - Compute & Serverless Backend (Google Cloud Run & FastAPI): Asynchronous FastAPI application running in a lightweight container on Cloud Run, handling webhook events and orchestrator loops.
- State Management & Audit Trail (Google Cloud Firestore): Stores work orders, ticket severity history, citizen contacts, contractor authorization codes, and full call transcripts.
- Multi-Agent Orchestrator (Python): Orchestration engine that monitors ticket state transitions, evaluates structured results, and dynamically generates specialized secondary voice agents.
๐ง Challenges We Ran Into
- Real-Time Mid-Call Tool Latency: Voice conversations require instantaneous feedback. When an agent queries an authorization code, any delay causes awkward pauses. We optimized FastMCP tool lookups with optimized asynchronous queries and in-memory caches to keep responses under 200ms.
- Handling Ambiguous Citizen Explanations: Callers often use informal descriptions ("the big puddle near the old bakery"). We engineered CALL-E prompt instructions that politely ask callers for nearest cross streets, landmarks, and gate numbers without sounding robotic.
- Seamless Multi-Agent Context Handoff: Passing state from a primary triage agent (Roads) to an emergency secondary agent (Water/Power) required designing a clean context-injection pipeline so the secondary agent knows all previous findings without repeating basic questions to the citizen.
๐ Accomplishments That We're Proud Of
- True End-to-End Voice Orchestration: Building a system where Python code actually triggers real phone calls, executes tools during the call, and parses structured data back into a cloud database.
- Zero-Friction Local & Cloud Execution: Created a dual-mode architecture that runs seamlessly on Google Cloud Run with Firestore while providing a complete local mock and interactive rich CLI runner for instant verification.
- Sophisticated Multi-Agent Dynamic Escalation: Successfully proving that an AI voice agent can detect inter-departmental emergencies and immediately spin up specialized secondary agents.
- 100% Automated Test Coverage: All critical flows (FastMCP tool calls, webhooks, structured parsing, escalation, and CRUD) pass automated pytest verification.
๐ What We Learned
- How powerful the Model Context Protocol (MCP) and FastMCP are for giving voice agents real-time programmatic superpowers during live phone calls.
- The nuance of voice agent prompt engineering: voice agents require concise turn-taking and conversational anchoring compared to text chatbots.
- How combining serverless Google Cloud Run with CALL-E creates a resilient, cost-effective infrastructure for municipal governments.
๐ฎ What's Next for CivicScout
- Multilingual Real-Time Voice Translation: Supporting over 30 languages to ensure non-English-speaking residents receive equal access to municipal services.
- Direct Integration with City 911/CAD & GIS Systems: Connecting CivicScout directly to municipal Computer Aided Dispatch (CAD) and ESRI ArcGIS maps for real-time truck routing.
- Citizen SMS Live Follow-Up: Automatically sending SMS links with live repair tracking and photos directly after the phone call concludes.
Built With
- call-e-api-/-sdk
- fastapi
- fastmcp
- google-cloud-firestore
- google-cloud-run
- pydantic
- pytest
- python
- uvicorn
Log in or sign up for Devpost to join the conversation.