CivicFix turns an unstructured citizen complaint into a routed municipal work order, rejects unsupported completion claims, and independently verifies resolution evidence before closure.
Application: https://civicfix-c13b.onrender.com/
CivicFix is a hackathon demonstration. Municipal departments and field crews are simulated; the AI reasoning, evidence verification, audit trail, and safety gates are implemented in the application.
Traditional complaint systems often stop at ticket creation. CivicFix focuses on what happens after the ticket is created:
- Citizen reports are unstructured and difficult to route.
- Departments can claim that work is complete without sufficient proof.
- A ticket can be marked resolved without independently checking the physical result.
- Citizens and operators need an auditable lifecycle rather than a black-box status change.
CivicFix is an autonomous community-resolution workflow that:
- Understands citizen reports with Gemini 3.6 Flash, including optional images.
- Plans the likely category, priority, department and remediation actions.
- Acts through deterministic CivicFix tools that create cases, assignments and work orders.
- Rejects blind trust when a department claims completion without evidence.
- Verifies multimodally by comparing the original problem, department claim, evidence description and post-repair image with Gemini.
- Fails safely when verification is unavailable or insufficient.
- Audits important lifecycle transitions in Firestore.
- Publishes events through Google Cloud Pub/Sub for asynchronous workflow integration.
CivicFix is not only a chatbot or a form. The system combines a Google ADK agent with Gemini reasoning and deterministic tools. The ADK agent performs an autonomous reasoning pass on intake, while state-changing operations remain behind explicit tools and a deterministic closure gate.
The architecture deliberately separates AI reasoning from state-changing actions so an AI/API failure cannot silently close a case.
REPORT
↓
UNDERSTAND
↓
PLAN
↓
ACT / DISPATCH
↓
WAIT FOR DEPARTMENT CLAIM
↓
VERIFY EVIDENCE
↓
RECOVER / REQUEST EVIDENCE
↓
ESCALATE WHEN NECESSARY
↓
RESOLVE ONLY AFTER VERIFIED PROOF
flowchart TD
A[Citizen Report] --> B[Google ADK Reasoning]
B --> C[Gemini Multimodal Analysis]
C --> D[Create Case]
D --> E[Assign Department]
E --> F[Create Work Order]
F --> G[Department Completion Claim]
G --> H{Evidence Attached?}
H -- No --> I[Reject Blind Trust]
I --> J[Request Evidence]
J --> G
H -- Yes --> K[Gemini Multimodal Verification]
K --> L{Verified + Sufficient?}
L -- No --> J
L -- Escalate --> M[Escalate Case]
L -- Yes --> N[Deterministic Closure Gate]
N --> O[Resolved + Audit Trail]
flowchart LR
U[Citizen / Judge] --> UI[CivicFix Web Dashboard]
UI --> API[FastAPI API]
API --> AG[Google ADK CivicFix Agent]
AG --> REASON[ADK Reasoning Pass]
REASON --> GEM[Gemini 3.6 Flash]
API --> GEM
AG --> TOOLS[Deterministic CivicFix Tools]
TOOLS --> FS[(Google Cloud Firestore)]
TOOLS --> PS[Google Cloud Pub/Sub]
PS --> SIM[Municipal Department Simulator]
SIM --> PS
API --> FS
The important closure path is:
Resolution evidence
↓
Gemini verification
↓
VerificationResult
↓
record_verification_tool
↓
close_case_tool
↓
RESOLVED only when verified=True,
SUFFICIENT evidence, and RESOLVE_CASE
A Gemini/API failure produces an unverified result and cannot be converted into a successful closure.
CivicFix uses the Google GenAI SDK and Part.from_bytes() for image inputs. Images can be attached during initial intake and during independent resolution verification.
For resolution verification, Gemini receives:
- the original problem;
- the department's completion claim;
- the evidence description; and
- the post-repair evidence image when available.
The verification result contains:
verified;confidence_score;reason;evidence_quality; andaction(RESOLVE_CASE,REQUEST_EVIDENCE, orESCALATE_CASE).
CivicFix follows one hard rule:
NO VERIFIED EVIDENCE = NO CASE CLOSURE.
The final close_case_tool is a deterministic safety gate. Even if another part of the application requests closure, it requires a successful verification result with sufficient evidence and the RESOLVE_CASE decision.
If Gemini verification fails, CivicFix returns an insufficient/unverified result and requests evidence instead of assuming success.
The built-in autonomous demonstration supports:
- Streetlight — broken streetlight near a school.
- Drainage — blocked storm drainage and flooding.
- Roads / Pothole — severe road crater affecting traffic.
- Waste — overflowing waste accumulation.
- Water Leak — high-pressure municipal water-main burst.
The municipal department responses are simulated so judges can reproduce the full lifecycle quickly.
Used for multimodal report understanding, categorization, prioritization, recommended actions, visual observations and independent resolution verification.
Used for the CivicFix root agent and its real Runner execution path. The ADK agent performs the autonomous reasoning pass while deterministic tools enforce state-changing actions and closure safety.
Used for persistent case state, evidence records and audit entries.
Used for workflow event publication and asynchronous municipal integration points.
The repository includes a Cloud Run-compatible Dockerfile with dynamic $PORT handling. A Google Cloud deployment should be configured for the final hackathon demonstration before submission if the selected submission video requires live Cloud Run proof.
civicfix/
├── app/
│ ├── agents/
│ │ ├── adk_agent.py
│ │ ├── civicfix_agent.py
│ │ └── tools.py
│ ├── api/
│ ├── frontend/
│ ├── models/
│ ├── services/
│ │ ├── gemini.py
│ │ ├── firestore.py
│ │ ├── pubsub.py
│ │ └── departments.py
│ ├── config.py
│ └── main.py
├── docs/
│ ├── architecture/
│ ├── screenshots/
│ ├── DEMO_SCRIPT.md
│ └── JUDGE_GUIDE.md
├── tests/
├── Dockerfile
├── requirements.txt
├── .env.example
└── README.md
- Python 3.11+
- Google Gemini API key
- Google Cloud project if using Firestore/Pub/Sub
git clone https://github.com/peterkehinde673/civicfix.git
cd civicfix
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCopy the example configuration:
cp .env.example .envSet the required values in .env. Never commit real credentials.
uvicorn app.main:app --host 0.0.0.0 --port 8000Then open http://localhost:8000.
See .env.example for the complete configuration. The important values include the Gemini API key/model and Google Cloud project configuration used by the application.
Do not put API keys, service-account JSON files or private credentials in Git.
The FastAPI application exposes health, case and orchestration endpoints used by the dashboard. The exact routes should be treated as the source of truth in app/api/ and the OpenAPI schema available from the running FastAPI application.
When running locally, FastAPI documentation is available at:
http://localhost:8000/docs
Run the test suite with:
pytest -qThe test suite covers health/API behavior, evidence requirements, verification safety and the autonomous demo scenarios.
Build the container:
docker build -t civicfix .Run it:
docker run --rm -p 8000:8000 --env-file .env civicfixThe container uses the platform-provided $PORT variable, making it suitable for Cloud Run-style execution.
The Dockerfile is prepared for Cloud Run. A typical deployment sequence is:
gcloud auth login
gcloud config set project YOUR_PROJECT_ID
gcloud services enable run.googleapis.com artifactregistry.googleapis.com cloudbuild.googleapis.com firestore.googleapis.com pubsub.googleapis.com
gcloud builds submit --tag REGION-docker.pkg.dev/YOUR_PROJECT_ID/civicfix/civicfix:latest
gcloud run deploy civicfix --image REGION-docker.pkg.dev/YOUR_PROJECT_ID/civicfix/civicfix:latest --region REGION --allow-unauthenticatedConfigure the Gemini API key and required Google Cloud environment variables using Cloud Run environment-variable or secret configuration. Do not place secrets in the image or repository.
The current public demonstration is hosted on Render:
https://civicfix-c13b.onrender.com/
Render remains useful for the public web demo, while Cloud Run can be used for the Google Cloud deployment required for the final judging demonstration.
Screenshots used for the project are stored under docs/screenshots/. Recommended judging views include:
- dashboard;
- report intake;
- Gemini analysis;
- autonomous workflow;
- blind-trust rejection;
- multimodal verification; and
- final audit trail.
Only screenshots that actually exist in the repository should be referenced in the final submission.
For a quick evaluation:
- Open the live demo.
- Select one of the five scenarios.
- Run the autonomous demonstration.
- Watch the citizen issue get analyzed and routed.
- Watch the department's unsupported completion claim get rejected.
- Watch CivicFix request evidence.
- Watch the submitted resolution evidence pass through Gemini verification.
- Watch the deterministic closure gate resolve the case.
- Inspect the case/audit history.
The key judging question is not whether CivicFix can create a ticket. It is whether an agent can move a real-world-style incident through reasoning, action, evidence verification and safe closure.
See docs/DEMO_SCRIPT.md for the short demonstration narrative and docs/JUDGE_GUIDE.md for the judge flow.
The final video should show the actual running application and, when required by the hackathon rules, the backend running on Google Cloud.
- Municipal departments are simulated for the hackathon.
- Field repair actions are simulated.
- Image storage is designed for hackathon demonstration and may use Base64 representations.
- AI verification is probabilistic, so deterministic safety gates remain in control of final closure.
- Cloud Run, Firestore and Pub/Sub require appropriate Google Cloud configuration and credentials.
- Real municipal department integrations.
- Citizen notifications and two-way communication.
- Geospatial clustering and duplicate-incident detection.
- SLA prediction and escalation analytics.
- Stronger evidence provenance and media storage.
- Production-grade authentication and role-based access control.
- Persistent ADK session/state infrastructure for larger deployments.
Built for the All Things Agentic Hackathon.
CivicFix focuses on autonomous task execution with a critical safety property: an agent may coordinate the resolution lifecycle, but it cannot close a case merely because a department says the work is finished.
See the repository for the project's current license and contribution information.