UrbanNexus is an enterprise-grade AI agent system designed to automate the complex decision-making process for smart city infrastructure deployment. It demonstrates advanced AI Engineering patterns by using a governed multi-agent architecture to balance innovation (value generation) with responsibility (risk mitigation).
AI Engineering Showcase: This project highlights the implementation of Google's Agent Development Kit (ADK), Vertex AI Agent Engine, RAG (Retrieval-Augmented Generation), and Constitutional AI governance patterns.
UrbanNexus moves beyond simple chatbots by implementing a Supervisor-Worker agentic workflow.
We utilize the Google Agent Development Kit (ADK) to manage agent state, tool execution, and reasoning loops.
- Old Architecture: Manual state machine / LangGraph (Deprecated).
- New Architecture:
LlmAgent(Supervisor) orchestrating a suite ofFunctionTools.
The central brain is the City Planner Agent, powered by Gemini 3.0 Flash. It does not guess; it follows a strict plan:
- Assess: Calls the
SiteViabilitytool to fetch GIS/physical data. - Propose: Delegates to "Advocate" agents (
Sustainability,Connectivity) to generate solution proposals. - Critique: Delegates to "Critic" agents (
Privacy,PublicSafety,OTSecurity) to attack the proposals with risk analysis. - Synthesize: Makes a final
GO / MITIGATE / HOLDdecision based on the combined evidence.
A key feature of UrbanNexus is its adversarial governance protocol, designed to prevent hallucinated benefits and ignored risks.
| Role | Agents | Responsibility |
|---|---|---|
| Advocates | Sustainability Specialist Connectivity Specialist |
Their goal is to maximize value. They use RAG to find product features (e.g., "WiFi 6 capability", "40% energy savings") that align with the city's strategic goals. |
| Critics | Privacy Counsel Public Safety Specialist OT Security Engineer |
Their goal is to minimize risk. They use RAG to find compliance documents (e.g., "CJIS Security Policy", "Surveillance Ordinances") and flag violations. |
| Judge | City Planner (Supervisor) | The supervisor must weigh the Value Proposals against the Risk Findings to render a final verdict. |
Agents do not rely on internal knowledge for facts. They utilize Vertex AI Search to query a curated corpus of:
- Vendor Specifications (Ubicquia hardware specs)
- Regulatory Standards (NIST, GDPR, Local Sunshine Laws)
We wrap deterministic Python logic into ADK Tools.
- Example: The
assess_site_toolconnects to a mock GIS database. The LLM cannot "hallucinate" the zone's dimensions; it must call the tool to get the ground truth.
To bridge the gap between the sophisticated ADK event stream (reasoning steps, tool calls) and the user interface, we implemented a Protocol Adapter in the orchestration layer.
- Raw Event:
ToolOutput(tool_name='assess_site', output={...}) - Adapted Event:
{"step": "assessment", "agent": "SiteViability", "data": {...}} - This ensures the Frontend (Next.js) receives a clean, predictable stream of JSON events via Server-Sent Events (SSE).
- Python 3.12+
- Google Cloud SDK (
gcloud) google-adk
- Install Dependencies:
make install
- Configure Environment:
Ensure you have
GOOGLE_API_KEYorGOOGLE_CLOUD_PROJECTset. - Run API Locally:
The API will start at
make run.api
http://localhost:8000.
- Navigate:
cd urbannexus-ui - Install & Run:
Open
npm install npm run dev
http://localhost:3000to interact with the map and agent panel.
We deploy the core agent logic to Vertex AI Agent Engine for managed scalability and tracing.
make deploy.agentThe FastAPI wrapper (which serves the frontend stream) is deployed to Cloud Run.
make deploy.apiBuilt with ❤️ by the UrbanNexus Engineering Team