AidFlow is a robust Multi-Agent AI pipeline designed to transform unstructured disaster/emergency reports into actionable response plans. By leveraging the Gemini Flash model family, the system autonomously analyzes severity, prioritizes needs, and allocates volunteer resources with realistic NGO mapping.
WhatsApp.Video.2026-04-27.at.8.38.29.PM.mp4
The system uses a sequential orchestration of five specialized agents to ensure high precision:
- Input Agent: Sanitizes raw unstructured text and extracts critical entities (location, people count).
- Classification Agent: Categorizes the emergency type (Healthcare, Food, Shelter, etc.).
- Priority Agent: Calculates a severity score (0–100) and urgency levels.
- Matching Agent: Logic-driven volunteer selection based on NGO specializations.
- Controller Agent: The final validation layer that enforces scaling rules and resource distribution.
- Automatic Retries: Built-in 3-attempt retry logic for all Gemini API calls to handle transient network errors.
- Intelligent Fallback: In case of persistent API failure, the system falls back to a deterministic Mock API to ensure the service remains responsive.
- CORS Enabled: Ready-to-go for frontend integration via standard browser security headers.
- Cloud-Ready: Native support for
PORTenvironment variables and containerization.
- Python 3.10+
- Google Gemini API Key
-
Initialize Environment:
python -m venv .venv .venv\Scripts\activate # Windows # source .venv/bin/activate # Linux/Mac
-
Install Dependencies:
pip install -r requirements.txt
-
Configure
.env: Create a.envfile in the root:GOOGLE_API_KEY=your_gemini_key_here GEMINI_MODEL=give_gemini_model_of_your_choice MOCK_API=False
-
Run the API:
python api.py
Access the interactive docs at:
http://127.0.0.1:8080/docs
Built for Google Cloud Run using a lightweight Python-slim image.
docker build -t aidflow-backend .gcloud run deploy aidflow-backend \
--image gcr.io/[PROJECT_ID]/aidflow-backend \
--set-env-vars GOOGLE_API_KEY=[KEY],MOCK_API=FalseReturns the status of the service and current operating mode (Mock vs Live).
Main entry point for situation analysis. Payload:
{
"text": "Severe landslide in Wayanad, multiple houses destroyed, medical help needed."
}Standard health-check endpoint.