--- title: JARVIS Gaia Agent emoji: 🐢 colorFrom: indigo colorTo: green sdk: docker pinned: false license: mit short_description: Enhanced JARVIS AI agent for GAIA benchmark --- # Evolved JARVIS Gaia Agent An advanced Python-based AI agent combining `langchain`, `smolagents`, SERPAPI, and OCR for web searches, file parsing, and data retrieval. Deployed as a Hugging Face Space for GAIA benchmark evaluation. #### Directory Structure ``` jarvis_gaia_agent/ ├── app.py # Main application with Gradio interface and agent logic ├── state.py # Defines JARVISState for state management ├── retriever.py # Guest info retriever tool ├── tools/ # Directory for all tools │ ├── __init__.py # Exports all tools │ ├── search.py # Web search tools (SERPAPI-based) │ ├── file_parser.py # File parsing tool (CSV, TXT, PDF, Excel) │ ├── image_parser.py # Image parsing tool (OCR) │ ├── calculator.py # Calculator tool │ ├── document_retriever.py # Document retrieval tool │ ├── duckduckgo_search.py # DuckDuckGo search tool (from smolagents) │ ├── weather_info.py # Weather info tool (OpenWeatherMap) │ ├── hub_stats.py # Hugging Face Hub stats tool │ ├── guest_info.py # Guest info retriever tool (moved from retriever.py) ├── requirements.txt # Python dependencies ├── Dockerfile # Docker configuration ├── README.md # Project documentation ├── .env # Environment variables (not committed) ``` ## Features - **Web Search**: SERPAPI and DuckDuckGo for robust searches. - **File Parsing**: Handles CSV, TXT, PDF, and Excel files. - **Image Parsing**: OCR with `easyocr` for image-based questions. - **Data Retrieval**: Guest info retriever for structured data. - **External APIs**: Weather (OpenWeatherMap), Hugging Face Hub stats. - **State Management**: `langgraph` for multi-step reasoning. - **Exact-Match Answers**: Optimized for GAIA Level 1 questions. ## Prerequisites - Python 3.11 - Tesseract OCR (`brew install tesseract` on macOS) - API keys in `.env`: - `HUGGINGFACEHUB_API_TOKEN` - `SERPAPI_API_KEY` - `OPENWEATHERMAP_API_KEY` - `SPACE_ID` ## Setup 1. **Clone the Repository**: ```bash git clone https://huggingface.co/spaces/onisj/jarvis_gaia_agent cd jarvis_gaia_agent ``` 2. **Set Up Environment Variables**: Create a `.env` file with your API keys. 3. **Run Locally**: ```bash pip install -r requirements.txt python app.py ``` 4. **Deploy to Hugging Face Space**: - Push code to your Space. - Set environment variables in Space settings. - Run evaluation via Gradio interface.