Inspiration
Tampa's Imagine 2040 Comprehensive Plan is nearly 400 pages of zoning codes, flood policies, transit goals, and housing strategies. City planners, residents, and developers all need answers from this document, but nobody has time to read it cover to cover. We asked: what if AI agents could read the entire plan and answer planning questions grounded in real policy — not hallucinations?
What it does
CivicPulse AI orchestrates 4 specialized AI agents that work like a relay race. You type a natural-language question like "What are the flood risks in Ybor City?" and within seconds you get a resilience score, policy-cited risk factors, trade-off analysis between competing goals (density vs. green space, development vs. displacement), and a full interactive dashboard with a 3D risk map of Tampa, sustainability charts, and transit visualizations.
How we built it
We extracted 390 pages from the Tampa 2040 PDF, split them into 708 overlapping chunks, embedded each chunk using Gemini's embedding model, and stored the vectors in Supabase pgvector. At query time, four agents execute in sequence: the Strategist parses user input into a structured mission, the Scout retrieves the most relevant policy chunks via cosine similarity search, the Analyst sends those chunks to Gemini 2.5 Flash for risk synthesis, and the Visionary generates a professional report with Plotly and Pydeck visualizations. The entire frontend runs on Streamlit with a chat interface, a 3D dashboard tab, and a downloadable report tab.
Challenges we ran into
Gemini's free tier rate limits hit us hard during ingestion — we had to batch 5 chunks at a time with 20-second delays to embed all 708 chunks without getting throttled. The google-generativeai Python package was deprecated mid-build, forcing a migration to google-genai with a completely different API surface. We also hit Windows AppLocker policies blocking numpy's DLL files, which required switching from Microsoft Store Python to a python.org installation.
Accomplishments that we're proud of
Every risk factor and recommendation CivicPulse produces is grounded in actual Tampa 2040 policy text — not fabricated. The system cites real ENV policies, MBY goals, and LU objectives from the comprehensive plan. We also built graceful fallbacks at every layer: if Supabase is down, Agent B uses cached data; if Gemini is rate-limited, Agent C falls back to rule-based analysis. The app never crashes — it degrades gracefully.
What we learned
Building a RAG pipeline from scratch taught us the full embedding lifecycle: PDF extraction, chunking strategy (why 500 tokens with 50-token overlap matters), vector indexing with IVFFlat, and the difference between RETRIEVAL_DOCUMENT vs RETRIEVAL_QUERY task types. We learned that multi-agent architectures need typed handoffs — Pydantic models act as contracts between agents so no data gets dropped in the relay.
What's next for CivicPulse AI
Integrate real-time FEMA flood zone data and NOAA heat index feeds so the risk analysis updates live instead of relying solely on static plan documents. Expand to other cities — any municipality with a publicly available comprehensive plan can be ingested in minutes. Add a community input layer where residents can flag concerns that feed back into the risk model, turning CivicPulse from an analysis tool into a civic engagement platform.
Built With
- gemini-2.5-flash
- gemini-embedding-api
- numpy
- pgvector
- plotly
- postgresql
- pydantic
- pydeck
- pypdf
- python
- streamlit
- supabase
Log in or sign up for Devpost to join the conversation.