Skip to content

Harshxth/UrbanMind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UrbanMind - Tampa 2050 City Intelligence

Multi-agent AI platform for urban planning that analyzes solar potential, flood risk, EV infrastructure, traffic, and cybersecurity to design Tampa's optimal future.

Inspiration

Cities are growing faster than planners can keep up. Tampa alone faces rising flood risk, aging infrastructure, and a booming population that demands smarter energy, mobility, and land use. Traditional urban planning is siloed -- solar analysts don't talk to traffic engineers, flood modelers work separately from cybersecurity teams. We wanted to build a system where AI agents handle each domain simultaneously and present a unified, defensible city plan in seconds.

What it does

UrbanMind is a multi-agent AI platform that generates optimal city layouts for Tampa 2050. Users ask natural language questions through a chat interface overlaid on a Google Maps 3D view of Tampa. Four specialized AI agents run in parallel:

  • CityRAG retrieves context from Tampa planning documents using vector search
  • GeoSense analyzes 4 zones across solar potential, flood risk, traffic congestion, EV infrastructure, and accident rates
  • Visionary generates top-down city layout maps using Google Imagen showing building footprints, solar arrays, green corridors, and road networks
  • GridShield scans proposed smart city infrastructure for SCADA and IoT cybersecurity vulnerabilities

The AI highlights the recommended zone on the 3D map, defends its choice with specific data comparisons, and generates a city masterplan layout. Users can then dive into close-up views of solar arrays, EV networks, green corridors, and smart roads.

How we built it

  • Frontend: React 19 + TypeScript + Vite, Tailwind CSS, Framer Motion, Google Maps Photorealistic 3D Tiles, Recharts
  • Backend: FastAPI with WebSocket streaming for real-time agent status updates
  • AI: Google Gemini 2.5 Flash for reasoning and synthesis, Google Imagen for city layout generation, ChromaDB for RAG vector search
  • Architecture: Async multi-agent orchestration -- CityRAG and GeoSense run sequentially to establish context, then Visionary and GridShield run in parallel, followed by a Gemini synthesis step that produces a persuasive, data-backed response

Challenges we ran into

  • Agent coordination: Getting 4 agents with different latencies to stream status updates to the frontend in real-time without blocking each other required careful async orchestration with WebSocket chunked responses
  • Making the AI persuasive: Early responses were generic. We had to engineer the synthesis prompt to include zone-by-zone data comparisons so the AI could defend recommendations with specific metrics like congestion indices and accident rates
  • 3D map integration: Google Maps 3D Tiles require a specific Map ID configuration and the alpha Maps3D API. Getting the camera to fly smoothly to recommended zones took iteration on the coordinate and tilt parameters

Accomplishments that we're proud of

  • The AI genuinely defends its recommendations -- ask "why not Ybor City?" and it will zoom to Ybor, acknowledge its strengths (8/10 solar), then explain why its flood risk of 5/10 and congestion index of 5.4 make it inferior to New Tampa's 3/10 and 3.2 respectively
  • Real-time multi-agent orchestration with live status streaming -- users watch each agent activate, process, and complete
  • Top-down city layout generation that shows actual building footprints, solar placement, green corridors, and road networks as a professional urban planning visualization
  • The entire 4-agent pipeline completes in under 30 seconds

What we learned

  • Multi-agent systems are powerful but coordination is the hard part -- knowing which agents can run in parallel vs sequentially is critical for perceived performance
  • Geospatial AI needs structured data grounding, not just LLM generation -- combining RAG with hard-coded zone metrics prevented hallucinated coordinates and scores
  • Users trust AI recommendations significantly more when they can see the 3D map zoom to the location AND read the data-driven justification side by side
  • Prompt engineering for image generation is fundamentally different from text -- getting Imagen to produce consistent top-down layout maps required very specific style directives

What's next for UrbanMind

  • Real sensor integration: Connect to Tampa's live IoT sensor network for real-time solar irradiance, traffic flow, and flood gauge data instead of mock data
  • Google Solar API: Overlay real per-building solar potential data directly on the 3D map
  • 3D layout generation: Use AI to generate interactive 3D city models rather than 2D top-down images
  • Multi-city expansion: The agent architecture is city-agnostic -- swap the zone data and RAG documents for any city
  • Community feedback: Let residents vote on AI-proposed layouts and feed preferences back into the optimization
  • Woolpert integration: Connect to Woolpert's LiDAR point cloud data and GIS platforms for production-grade geospatial accuracy

Built with

Python, TypeScript, React, FastAPI, Google Gemini 2.5 Flash, Google Imagen, Google Maps 3D Tiles API, Google ADK, ChromaDB, WebSocket, Tailwind CSS, Framer Motion, Vite, Recharts, Leaflet, Lucide React, Supabase

Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.10+
  • Google Cloud API key with Gemini API + Maps JavaScript API + Map Tiles API enabled

Backend

cd backend
pip install -r requirements.txt

# Create .env file
echo "GOOGLE_API_KEY=your_gemini_api_key" > .env

python main.py

Server starts on http://localhost:8000

Frontend

cd frontend
npm install

# Create .env file
echo "VITE_GOOGLE_MAPS_API_KEY=your_maps_api_key" > .env

npm run dev

App opens on http://localhost:5173

Architecture

User Query --> WebSocket --> Orchestrator
                              |
                    +---------+---------+
                    |         |         |
                 CityRAG  GeoSense  (parallel)
                    |         |     GridShield + Visionary
                    |         |         |
                    +---------+---------+
                              |
                         Gemini Synthesis
                              |
                    Frontend (3D Map + Chat)

API Endpoints

Endpoint Method Description
/ws/chat WebSocket Real-time agent orchestration
/zones GET GeoJSON zone boundaries
/zones/scores GET Zone analysis scores
/api/generate-feature POST Generate close-up AI images
/health GET Health check

Google Cloud Setup

  1. Enable these APIs in Google Cloud Console:
    • Generative Language API (Gemini)
    • Maps JavaScript API
    • Map Tiles API
  2. Create an API key under Credentials
  3. Create a Map ID under Maps Platform > Map Management (Vector type)

License

MIT

About

hack they bay 2026

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors