Skip to content

muskangupta1906/NammaAI-AIAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Namma AI - Smart City Intelligence System

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.

๐Ÿ—๏ธ Architecture Overview

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

๐ŸŽฏ Features

Report Analysis Agent

  • 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

Alerts Query Agent

  • 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

Categories Supported

  1. Cultural Events & Celebrations
  2. Traffic + Events Impact
  3. Power Outages
  4. Monsoon-Related Issues (Flooding, Potholes, Tree Falls, Drainage)
  5. Lane Closures & Road Works
  6. Traffic Congestion & Incidents
  7. Sports Events
  8. Safety & Network Issues
  9. News & Emergencies

๐Ÿš€ Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. Environment Setup

Copy 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...

3. Run the Application

python app.py

4. Access the Web Interface

Open your browser and go to: http://localhost:5000

๐Ÿ“ Usage Examples

Submitting a Report

{
  "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"
}

Asking a Query

{
  "query": "What's the traffic situation around Marathalli?",
  "user_location": {
    "lat": 12.9279,
    "lng": 77.6271
  },
  "origin": "Marathalli",
  "destination": "Electronic City"
}

๐Ÿ”ง API Endpoints

  • GET / - Web interface
  • POST /submit_report - Submit incident report
  • POST /submit_query - Ask questions
  • GET /health - Health check

๐Ÿ› ๏ธ Technologies Used

  • 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

๐Ÿ›๏ธ Agent Architecture

Orchestrator Agent

  • Routes requests to appropriate sub-agents
  • Manages agent coordination
  • Handles request validation

Report Analysis Agent

  • Processes user reports
  • Analyzes media content
  • Categorizes events
  • Generates forecasts
  • Provides actionable advice

Alerts Query Agent

  • Handles user queries
  • Retrieves relevant events
  • Provides real-time information
  • Generates intelligent responses

๐Ÿ”’ Security & Privacy

  • API keys stored in environment variables
  • Firebase service account authentication
  • Input validation and sanitization
  • Secure HTTPS endpoints (in production)

๐Ÿš€ Deployment

Local Development

python app.py

Production Deployment

# 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

๐Ÿ“Š Monitoring & Logging

  • Agent activity logging
  • API response monitoring
  • Error tracking
  • Performance metrics

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ†˜ Support

For support and questions:

  • Create an issue in the repository
  • Contact the development team
  • Check the documentation

๐Ÿ”ฎ Future Enhancements

  • Real-time notifications
  • Mobile app integration
  • Advanced analytics dashboard
  • Machine learning model improvements
  • Integration with more city services
  • Voice interface support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors