A multi-agent AI architecture built with Agent Development Kit (ADK), Python, Firestore MCP, and Google AI Technologies for smart city intelligence and citizen experience enhancement.
Namma AI/
โโโ agents/ # AI Agents
โ โโโ base_agent.py # Base agent class
โ โโโ orchestrator_agent.py # Main orchestrator
โ โโโ report_analysis_agent.py # Report processing agent
โ โโโ alerts_query_agent.py # Query handling agent
โโโ tools/ # MCP Tools
โ โโโ firestore_tool.py # Firestore database operations
โ โโโ maps_tool.py # Google Maps APIs
โ โโโ search_tool.py # Google Search API
โโโ templates/ # Web UI
โ โโโ index.html # Main interface
โโโ app.py # Flask application
โโโ requirements.txt # Dependencies
โโโ config.env # Environment variables
โโโ README.md # This file
- Multimodal Analysis: Uses Gemini AI to analyze text, images, videos, and audio
- Smart Categorization: Automatically categorizes events into 15 predefined categories
- Sentiment Analysis: Analyzes sentiment (sad, happy, neutral, angry, fear)
- Event Clustering: Groups similar reports and generates unified summaries
- Duration Forecasting: Predicts event duration based on category and context
- Actionable Advice: Provides specific recommendations for citizens
- Real-time Traffic: Google Maps traffic API integration
- Route Optimization: Best routes with public transport options
- Contextual Search: Google Search integration for additional context
- Intelligent Responses: Gemini-powered comprehensive answers
- Location-based Queries: Geospatial event retrieval
- Cultural Events & Celebrations
- Traffic + Events Impact
- Power Outages
- Monsoon-Related Issues (Flooding, Potholes, Tree Falls, Drainage)
- Lane Closures & Road Works
- Traffic Congestion & Incidents
- Sports Events
- Safety & Network Issues
- News & Emergencies
pip install -r requirements.txtCopy your API keys to config.env:
GOOGLE_API_KEY=your_gemini_api_key
GOOGLE_SEARCH_API_KEY=your_search_api_key
GOOGLE_CSE_ID=your_custom_search_engine_id
GOOGLE_MAPS_API_KEY=your_maps_api_key
# Firebase credentials...python app.pyOpen your browser and go to: http://localhost:5000
{
"Description": "Heavy traffic congestion at Silk Board Junction",
"Location Name": "Silk Board Junction, Bangalore",
"Exact Latitude": 12.9279,
"Exact Longitude": 77.6271,
"Media (Image)": "present"
}{
"query": "What's the traffic situation around Marathalli?",
"user_location": {
"lat": 12.9279,
"lng": 77.6271
},
"origin": "Marathalli",
"destination": "Electronic City"
}GET /- Web interfacePOST /submit_report- Submit incident reportPOST /submit_query- Ask questionsGET /health- Health check
- Python 3.8+
- Flask - Web framework
- Google Generative AI (Gemini) - AI analysis
- Google Cloud Firestore - Database
- Google Maps APIs - Traffic & routing
- Google Custom Search - Web search
- Agent Development Kit (ADK) - Multi-agent architecture
- Routes requests to appropriate sub-agents
- Manages agent coordination
- Handles request validation
- Processes user reports
- Analyzes media content
- Categorizes events
- Generates forecasts
- Provides actionable advice
- Handles user queries
- Retrieves relevant events
- Provides real-time information
- Generates intelligent responses
- API keys stored in environment variables
- Firebase service account authentication
- Input validation and sanitization
- Secure HTTPS endpoints (in production)
python app.py# Using Gunicorn
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 app:app
# Using Docker
docker build -t namma-ai .
docker run -p 5000:5000 namma-ai- Agent activity logging
- API response monitoring
- Error tracking
- Performance metrics
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation
- Real-time notifications
- Mobile app integration
- Advanced analytics dashboard
- Machine learning model improvements
- Integration with more city services
- Voice interface support