This project has been upgraded to a cutting-edge Agentic AI System for disaster response in Jammu & Kashmir. It employs a multi-agent architecture to predict disaster risks, allocate resources optimization, and visualize data via a conversational interface and a live dashboard.
The system is built on a custom Agent Framework with specialized agents:
- Master Agent: The central coordinator that routes user queries to the appropriate sub-agent.
- Resource Agent: Responsible for Machine Learning predictions, resource allocation planning, and weather analysis.
- Analytics Agent: Handles data aggregation, statistical summaries, and interactive map visualizations.
- Notification Agent: Manages Smart Alerts via Email and SMS (Twilio).
- Live Weather Integration: Fetches real-time weather data for J&K districts using the OpenMeteo API.
- Risk Prediction: Uses a Random Forest Classifier to predict risk levels (1-5) based on weather parameters (Precipitation, Wind, etc.).
- Dynamic Resource Allocation: Automatically generates plans to deploy NDRF teams, medical staff, and food supplies to high-risk areas.
- Specific Threat Detection: Automatically identifies specific threats:
- Cloud Burst (Precipitation ≥ 100mm)
- Heavy Rain (Precipitation ≥ 50mm)
- Severe Storm (Wind ≥ 80km/h)
- Intelligent Deduplication: Prevents spam by ensuring only one alert is sent per district/threat-type session.
- Multi-Channel Support: Supports Email (SMTP) and SMS (Twilio).
- Chat Assistant: Natural language interface to ask queries like "Run allocation" or "Show risk map".
- Live Dashboard: Real-time monitoring view with Risk Maps, Alert Feeds, and Resource Tables.
- Python 3.10+
- An active internet connection (for OpenMeteo API and Alerts).
Clone the repository and install dependencies:
git clone <repository_url>
cd <repository_folder>
pip install -r requirements.txtCreate a manual_keys.txt file (or .env) in the root directory with your API credentials:
TWILIO_SID=your_sid
TWILIO_AUTH_TOKEN=your_token
TWILIO_PHONE=your_twilio_number
TO_PHONE=target_phone_number
EMAIL_USER[email protected]
EMAIL_PASSWORD=your_app_password
RECEIVER_EMAIL[email protected]Run the training script to generate dummy models if you haven't already:
python scripts/train_dummy_models.pyLaunch the Agent App with Streamlit:
streamlit run agent_app.pyThe application features two main modes reachable via the sidebar:
Interact using natural language commands:
- "Run resource allocation": Triggers the full pipeline (Live Weather -> Prediction -> Allocation -> Alerts).
- "Show risk map": Ask the Analytics Agent to render an interactive map.
- "Send test alert": Trigger a manual test of the notification system.
A dedicated view for HQ monitoring:
- Risk Map: Visualizes safe vs. high-risk districts.
- Alert Feed: Shows the latest active alerts.
- Resource Table: Detailed list of deployed teams and supply shortages.
Note: You must run an allocation in Chat Mode first to populate the dashboard data.
agent_app.py: Main entry point (Streamlit UI).agents/: Core logic for Master, Resource, Notification, and Analytics agents.scripts/:train_dummy_models.py: Model training script.resource_allocation.py: Allocation logic.test_deduplication.py: Verification script for smart alerts.
results/: Stores generated prediction CSVs and allocation JSONs.data/: Configuration and static data files.
- Harshit Pathak
- Nitesh Kumar
- Akash Kumar Chaurasiya