Inspiration
During emergencies like fires, crimes, or accidents, people often post or report incidents in free-text — vague, emotional, or incomplete. Dispatchers spend critical time interpreting these messages before help can be sent. We wanted to change that. SafeCity AI was born from the idea that artificial intelligence can instantly understand natural language, identify the incident type, and locate nearby responders — saving lives through faster awareness and action.
What it does
SafeCity AI converts unstructured text like “There’s smoke near MG Road” into structured emergency insights in seconds.
- Detects the incident type (fire, accident, crime, etc.) using Google Gemini.
- Provides a confidence score and summarized understanding of the situation.
- Finds the nearest police and fire stations using Google Maps Places API.
- Returns everything in a clean, real-time response via a Cloud Run API endpoint.
How we built it
- We started in Google AI Studio, using Gemini 1.5 Flash to generate and refine the incident classification logic.
- The backend service was built in Python (FastAPI) to handle requests to /incident.
- Deployed the service to Google Cloud Run for a fully serverless, scalable setup.
- Integrated Google Maps Places API to fetch and rank nearby police and fire stations.
- Responses are formatted as JSON for easy integration with frontends or mobile apps.
Challenges we ran into
- Keeping response times fast while chaining multiple APIs (Gemini + Maps).
- Handling edge cases where no nearby stations exist within a reasonable radius.
Accomplishments that we're proud of
- Successfully generated working backend code directly from Google AI Studio and deployed to Cloud Run in a short span of time.
- Created a real-world, socially impactful AI solution for emergency awareness.
- Achieved sub-2-second API responses combining AI reasoning and location intelligence.
What we learned
- Building serverless backends with Cloud Run can drastically simplify deployment.
- Combining AI + geospatial APIs can create surprisingly effective real-world solutions without heavy infrastructure.
What's next for SafeCity AI
We’re planning to:
- Maintain and log incidents in Firebase for persistence and analytics.
- Build dashboards for past incident analysis, trends, and city-level heatmaps.
- Use historical data to forecast high-risk zones or times using AI-based prediction.
- Add multilingual and voice reporting support for inclusive public use.
- Integrate directly with municipal safety systems or community alert networks.
Built With
- gemini-api
- google-ai-studio
- google-cloud-run
- typescript

Log in or sign up for Devpost to join the conversation.