Inspiration

Urban environments are becoming more complex, crowded, and unpredictable — especially during large events like the 2026 World Cup. Cities struggle with real-time monitoring of crowd surges, safety risks, infrastructure failures, and emergency response delays. I wanted to build an AI agent that doesn’t just “answer questions” but actually takes action to keep people safe.

CityGuard AI was inspired by the idea of a smart, autonomous urban guardian — an agent that can detect risks early, analyze them, and trigger the right response workflows automatically.

What it does

CityGuard AI is an autonomous multi-step agent built with Google Cloud Agent Builder and Elastic MCP. It continuously monitors real-time signals (crowd density, anomalies, logs, events) and:

  • Detects unusual patterns or risks using Elastic’s search and anomaly detection
  • Classifies incidents by severity
  • Logs structured incident data into a database
  • Automatically creates GitLab issues for response teams
  • Generates human-readable summaries and alerts
  • Provides a dashboard-ready output for city operators

The agent reasons, plans, and executes tasks — not just chat.

How I built it

  • Designed the agent using Google Cloud Agent Builder with multi-step reasoning
  • Integrated Elastic MCP to enable real-time anomaly detection and log analytics
  • Connected MongoDB MCP for structured incident storage
  • Used GitLab MCP to automatically create and track incident response tasks
  • Implemented a workflow where the agent:
    1. Monitors signals
    2. Detects anomalies
    3. Plans next steps
    4. Executes actions with human approval
    5. Logs and escalates incidents

Challenges I ran into

  • Understanding the MCP tool schemas and connecting them correctly
  • Designing a multi-step agent that can reason and not loop
  • Ensuring the agent takes safe actions with human-in-the-loop control
  • Structuring incident data for both Elastic and MongoDB
  • Creating a workflow that feels real-world and scalable

Accomplishments that I'm proud of

  • Built a fully functional autonomous agent, not just a chatbot
  • Successfully integrated Elastic MCP for real-time anomaly detection
  • Designed a complete incident response pipeline with GitLab and MongoDB
  • Created a system that can genuinely help cities, malls, stadiums, and events

What I learned

  • How to build production-grade agents using Google Cloud Agent Builder
  • How MCP servers extend agent capabilities with real-world tools
  • How to design multi-step reasoning workflows
  • How to integrate Elastic for anomaly detection and search
  • How to structure incident data for automation and dashboards

What's next for CityGuard AI

  • Add live map visualization for incidents
  • Integrate IoT sensor data for richer monitoring
  • Add predictive modeling for crowd flow forecasting
  • Deploy a full dashboard for city operators and event managers

Built With

Share this project:

Updates