--- 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.** [![Python](https://img.shields.io/badge/Python-3.10+-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://python.org) [![Gradio](https://img.shields.io/badge/Gradio-4.44.1-FF5A5F?style=for-the-badge&logo=gradio&logoColor=white)](https://gradio.app/) [![Qwen](https://img.shields.io/badge/LLM-Qwen_2.5_7B-blue?style=for-the-badge)](https://huggingface.co/Qwen) [![License](https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge)](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.**