FloodGuard
FloodGuard is an AI-powered flood intelligence platform designed to proactively monitor and assess flood risks. Instead of just displaying raw weather data, it ingests meteorological information, automatically detects threshold breaches, correlates them into evolving 'flood events,' and assigns a severity score. It also features a conversational AI assistant that can answer disaster preparedness questions using official guidelines.
Project Scope
Data Ingestion: Collects live observed conditions and 5-day forecasts (via OpenWeather) across districts, alongside mock IMD data. Event Generation (Trigger & Correlation): Trigger Engine fires when rainfall hits official IMD thresholds. Correlation Engine intelligently groups these triggers within a 6-hour window into a single event. Severity Scoring: Calculates a blended risk score (75% rule-based, 25% ML model). Interactive AI Preparedness: Provides grounded, cited answers using NDMA and IMD documents. Real-Time Dashboard: Instantly updates via Server-Sent Events (SSE) as new data lands.
Technology Stack
Architecture
FastAPI acts as the backend Gateway processing real-time OpenWeather data. It pushes data to the Correlation and ML Scoring engines. A separate RAG pipeline manages document embeddings in ChromaDB to power the Gemini AI. The Next.js frontend is updated instantly via Server-Sent Events (SSE).
- Fetch data from IMD, CWC, Weather APIs, RSS
- Normalize, validate, deduplicate
- Store processed data
- Read data from database
- Apply rules & correlation
- Detect flood-related events
- Generate alerts / notifications
- Read historical & live data
- Train / use models (e.g., XGBoost)
- Predict flood risk / water levels
- Store predictions
- Retrieve relevant documents (RAG)
- Combine with live FloodGuard data
- Use Gemini for final response
- Provide answers, recommendations
(events, thresholds)
Write events/alerts
Write predictions
Users • Alerts • Application data
(similarity search)
Response
(Vector Store)
(scheduled)
- Unstructured
- Tesseract (OCR)
- Llama (image → text)
- Hugging Face embeddings
Results & Validation
RAG Validation: Processed 8 official PDFs into 2,677 chunks. Overcame boilerplate vector search failures by implementing hybrid retrieval (vector + keyword) and near-duplicate filtering, guaranteeing strictly grounded answers. System: Verified end-to-end on a 60-second cycle.