An AI-powered agent that helps people find essential resources during disaster situations, including shelter, food, medical aid, and government assistance.
- Multi-Agent Architecture: Planner, Worker, and Evaluator agents work together to process requests
- Resource Discovery: Find shelters, food distribution points, medical stations, and government aid
- Context Understanding: Analyzes urgency and disaster type from user input
- Session Memory: Maintains conversation history and caches resource data
- Real-time Observability: Tracks agent activities and performance metrics
app.py (Gradio Interface)
↓
main_agent.py (Orchestrator)
├── agents/
│ ├── planner.py (Creates execution plans)
│ ├── worker.py (Executes resource discovery)
│ └── evaluator.py (Validates and ranks results)
├── core/
│ ├── context_engineering.py (Analyzes user context)
│ ├── observability.py (Logging and metrics)
│ └── a2a_protocol.py (Agent-to-agent messaging)
├── memory/
│ └── session_memory.py (Session and cache management)
└── tools/
└── tools.py (Resource data)
- Fork this repository to your GitHub account
- Go to Hugging Face Spaces
- Click "Create new Space"
- Select:
- Owner: Your Hugging Face username
- Space name:
disaster-resource-connector - License: OpenRAIL (or your choice)
- Space SDK: Docker
- Connect your GitHub repository
- Click "Create Space"
The app will automatically deploy using the Dockerfile.
- Create a new Space on Hugging Face with Gradio SDK
- Clone this repository
- Push the code to the Space repository
- The app will auto-deploy
- Python 3.8+
- pip or conda
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtpython app.pyThe application will launch at http://localhost:7860
- Open the Gradio interface
- Enter your situation in the text box (e.g., "I need shelter after the hurricane")
- Click "Find Resources" or press Enter
- View the recommended resources with locations and descriptions
- "I need shelter after the hurricane"
- "Where can I find food and water?"
- "Medical assistance needed urgently"
- "How do I apply for FEMA aid?"
The code automatically adapts to Hugging Face environment:
- Port: Uses port 7860 (Hugging Face default)
- Logging: Only writes to console (file logging disabled on Spaces)
- Server: Binds to 0.0.0.0 (accessible from web)
project/
├── app.py # Gradio interface (main entry point)
├── main_agent.py # Agent orchestrator
├── requirements.txt # Python dependencies
├── README.md # This file
├── agents/
│ ├── __init__.py
│ ├── planner.py # Request planning
│ ├── worker.py # Resource discovery
│ └── evaluator.py # Result evaluation
├── core/
│ ├── __init__.py
│ ├── context_engineering.py # User context analysis
│ ├── observability.py # Logging and metrics
│ └── a2a_protocol.py # Agent communication
├── memory/
│ ├── __init__.py
│ └── session_memory.py # Session and cache management
└── tools/
├── __init__.py
└── tools.py # Resource data and tools
- gradio: Web UI framework
- transformers: NLP models (for future enhancements)
- torch: Deep learning framework
- numpy/pandas: Data processing
- requests: HTTP requests
Currently, the application works without environment variables. All configuration is hardcoded for demo purposes. To extend with real APIs:
- Add
.envfile with API keys - Update
tools/tools.pyto fetch from real APIs - Update requirements.txt with API client libraries
Run test cases:
python run_demo.pyThis will test the agent with sample queries and display results.
- Ensure you're in the project root directory
- Check that all relative imports are used (no
project.prefix) - Verify Python path:
echo $PYTHONPATH
- Hugging Face Spaces automatically handles port mapping
- Locally, the app uses port 7860
- Update all packages:
pip install --upgrade -r requirements.txt - Check Python version:
python --version(should be 3.8+)
- Integration with real disaster resource APIs
- Real-time location-based filtering
- Multi-language support
- User authentication and preferences
- SMS integration for emergency alerts
- Offline support
This project is provided as-is for educational and humanitarian purposes.
For issues or questions:
- Check the Hugging Face Spaces documentation
- Review logs in the Hugging Face Space interface
- Test locally before deploying
title: Disaster Resource Connector emoji: 🌖 colorFrom: gray colorTo: pink sdk: gradio sdk_version: 6.0.2 app_file: app.py pinned: false
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference