---
title: Agentic Disaster Tracker
emoji: ๐
colorFrom: red
colorTo: blue
sdk: gradio
sdk_version: 4.44.1
app_file: app.py
pinned: false
license: mit
---
# ๐ Agentic Disaster Tracker
### AI-Powered Natural Disaster Intelligence
**Ask questions about global earthquakes and wildfires in natural language โ driven by autonomous AI agents.**
[](https://python.org)
[](https://gradio.app/)
[](https://huggingface.co/Qwen)
[](LICENSE)
[Features](#-features) ยท [How It Works](#-how-it-works) ยท [Installation](#-installation) ยท [Tech Stack](#-tech-stack)
---
## โ What is Agentic Disaster Tracker?
Agentic Disaster Tracker is an intelligent, autonomous agent designed to fetch real-time global disaster data. By seamlessly integrating **Tool Calling (Function Calling)** capabilities, the system bridges the gap between Large Language Models (LLMs) and real-world Public APIs.
Ask the AI about recent earthquakes or active wildfires, and the underlying **Agentic Loop** will autonomously decide which API to call, fetch the live data, and synthesize a comprehensive, natural language response.
> **Transparent Intelligence:** Watch the AI think! Every tool call, parameter, and raw JSON response is displayed in real-time, offering a completely transparent view into the model's decision-making process.
---
## โจ Features
| Feature | Description |
|---|---|
| ๐ค **Autonomous Tool Calling** | The assistant intelligently decides whether to query the Earthquake API or the Wildfire API based purely on your conversational input. |
| ๐ **Transparent Execution** | The UI explicitly reveals the AI's internal monologue, the exact API functions it triggers, the parameters sent, and the raw data received. |
| ๐ง **Powerful Qwen 2.5 LLM** | Powered by `Qwen/Qwen2.5-7B-Instruct`, a state-of-the-art open-source model highly optimized for complex function calling tasks. |
| โก **ZeroGPU Serverless Execution** | Seamlessly deployed on Hugging Face Spaces using the `@spaces.GPU` decorator, ensuring efficient, serverless inference for a 7B model. |
| ๐ **Live Public API Integration** | Directly connected to USGS (United States Geological Survey) and NASA EONET for up-to-the-minute global disaster data. |
---
## ๐ง How It Works
```mermaid
flowchart LR
A["๐ค User Query
'List recent earthquakes'"] --> B["๐ง Qwen 2.5 Agent
Analyzes Intent"]
B --> C{"๐ ๏ธ Tool Selection"}
C -->|Earthquakes| D["USGS API
get_earthquakes()"]
C -->|Wildfires| E["NASA EONET API
get_wildfires()"]
D --> F["๐ Raw JSON Data"]
E --> F
F --> G["๐ค Synthesize Response"]
G --> H["๐ฌ Final Answer provided to User"]
style A fill:#0d8a6a,color:#fff,stroke:none
style B fill:#10a37f,color:#fff,stroke:none
style G fill:#10a37f,color:#fff,stroke:none
style H fill:#0d8a6a,color:#fff,stroke:none
```
**Pipeline in detail:**
1. **Input** โ You ask a natural language question (e.g., "Were there any magnitude 5.5+ earthquakes in the last 3 days?").
2. **Analysis** โ The Qwen 2.5 model parses your request and identifies the need for external data.
3. **Execution** โ The Agentic Loop triggers the appropriate python function (Tool Call) with the correct parameters (dates, magnitude).
4. **Data Retrieval** โ Live data is fetched from public USGS or NASA endpoints.
5. **Synthesis** โ The model ingests the raw JSON output and formulates a human-readable, conversational summary.
---
## ๐ ๏ธ Installation
Run the Agentic Disaster Tracker locally on your machine.
### 1. Clone the Repository
```bash
git clone https://github.com/MertAlii/Agentic-Disaster-Tracker.git
cd Agentic-Disaster-Tracker
```
### 2. Install Dependencies
> โ ๏ธ Note: Running a 7B parameter model locally requires adequate RAM and ideally a dedicated GPU.
```bash
pip install -r requirements.txt
```
### 3. Start the Application
```bash
python app.py
```
The Gradio web interface will launch and be available at `http://127.0.0.1:7860/`.
---
## ๐๏ธ Tech Stack
| Layer | Technology | Role |
|---|---|---|
| **Frontend UI** | Gradio 4.44.1 | Interactive Chat Interface |
| **LLM Engine** | Qwen/Qwen2.5-7B-Instruct | Intent parsing, Tool Calling & Synthesis |
| **Inference Hardware** | Hugging Face ZeroGPU | Serverless GPU acceleration |
| **Earthquake Data** | USGS Earthquake API | Real-time seismic event tracking |
| **Wildfire Data** | NASA EONET API | Active global wildfire monitoring |
---
**Built with โค๏ธ for the Tool Calling Assignment.**