Spaces:
Sleeping
Sleeping
title: GAIA Agent Space | |
emoji: "🔥" | |
colorFrom: indigo | |
colorTo: red | |
sdk: gradio | |
sdk\_version: 5.29.0 | |
app\_file: app.py | |
pinned: false | |
license: mit | |
hf_oauth: true | |
# GAIA Agent Space | |
A reproduction‑ready **Retrieval‑Augmented Generation (RAG) agent** built with **LangChain** and **Gradio** for the [GAIA benchmark](https://arxiv.org/abs/2311.12983). The Space exposes both an interactive web UI *and* a programmatic `/predict` endpoint, making it easy to test single GAIA tasks or to batch‑evaluate whole splits with the Inspect‑AI runner. | |
## ✨ Demo | |
> Click **<Run>** above ⬆️ and paste a GAIA JSON task – or just try something like: | |
> | |
> ```json | |
> {"question": "How many studio albums were published by Mercedes Sosa between 2000 and 2009 (included)?"} | |
> ``` | |
The agent decides which tool chain to invoke (Wikipedia search, table parser, etc.) and returns the numeric answer in the GAIA `SUBMIT:` format. | |
## 🚀 Quick start (local) | |
```bash | |
# 1 ‑ clone | |
git clone https://huggingface.co/spaces/Acecross/GAIA_agent_space | |
cd GAIA_agent_space | |
# 2 ‑ create env | |
conda env create -f environment.yml # or: python -m venv .venv && pip install -r requirements.txt | |
conda activate gaia‑agent | |
# 3 ‑ run UI | |
python app.py # Gradio launches at http://127.0.0.1:7860 | |
``` | |
## 🛠️ Environment variables | |
| Variable | Purpose | | |
| ---------------- | ----------------------------------------------------------------------------------------------- | | |
| `HF_API_TOKEN` | *Optional* – needed only if you hit the Hugging Face Inference API or gated models. | | |
| `OPENAI_API_KEY` | *Optional* – set to use OpenAI models for LLM or vision tasks. | | |
| `TAVILY_API_KEY` | API key for web search (used by the `TavilySearchTool`). | | |
| `STOCKFISH_PATH` | Path to the Stockfish binary for chess‑position questions (defaults to `stockfish` in `$PATH`). | | |
Create a `.env` file with any keys you need; `app.py` loads it on start‑up. | |
## 📁 Project layout | |
``` | |
├─ app.py # Gradio interface + agent bootstrap | |
├─ agent/ | |
│ ├─ chains.py # LangChain boiler plate (router, retriever, etc.) | |
│ ├─ tools/ # Custom tool classes (spreadsheet, chess, video counter…) | |
│ └─ prompts/ | |
├─ requirements.txt # runtime deps | |
└─ environment.yml # conda lock (optional) | |
``` | |
## 📝 License | |
This project is released under the **MIT License** – see [`LICENSE`](./LICENSE) for details. | |
--- | |
### 🔗 Useful links | |
* GAIA paper: [https://arxiv.org/abs/2311.12983](https://arxiv.org/abs/2311.12983) | |
* LangChain docs: [https://python.langchain.com](https://python.langchain.com) | |
* Hugging Face Spaces: [https://huggingface.co/docs/hub/spaces](https://huggingface.co/docs/hub/spaces) | |
Feel free to open an issue or a pull request if you spot a bug or want to add a new GAIA‑specific tool! 🎉 | |