File size: 2,951 Bytes
2705160
315f4fc
62ad9da
 
 
2705160
 
 
 
d123508
 
 
2705160
 
315f4fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
title: JarvisAgent for GAIA Benchmark
emoji: πŸ•΅πŸ»β€β™‚οΈ
colorFrom: indigo
colorTo: indigo
sdk: gradio
sdk_version: 5.25.2
app_file: app.py
pinned: false
hf_oauth: true
# optional, default duration is 8 hours/480 minutes. Max duration is 30 days/43200 minutes.
hf_oauth_expiration_minutes: 480
---

# πŸš€ GAIA Solver Agent - Optimized & Production Ready

A highly optimized AI agent for the GAIA benchmark with robust error handling, parallel processing, and graceful API key management.

## ✨ Key Features

### πŸš€ **Performance Optimizations**
- **⚑ Parallel Processing**: Process multiple questions concurrently using ThreadPoolExecutor
- **πŸ’Ύ Smart Caching**: File-based JSON cache to avoid reprocessing questions
- **πŸ”„ Async Operations**: Non-blocking UI with real-time progress updates
- **πŸ“¦ Batch Processing**: Questions processed in configurable batches for optimal performance

### πŸ›‘οΈ **Robust Error Handling**
- **πŸ”§ Graceful API Key Management**: Works with or without API keys
- **πŸ”„ Smart Fallbacks**: Automatic fallback to free alternatives (DuckDuckGo vs Google Search)
- **πŸ›‘οΈ Error Recovery**: Individual question failures don't stop the entire process
- **πŸ“Š Comprehensive Logging**: Detailed status updates and error reporting

### 🧰 **Enhanced Tools**
- **πŸ” Google Search** (with DuckDuckGo fallback)
- **πŸ“Š Math Solver** (SymPy-based calculations)
- **βœ‚οΈ Text Preprocesser** (with enhanced reversal handling)
- **πŸ“– Wikipedia Access** (title finder + content fetcher)
- **πŸ“ File Analysis** (Gemini-powered document processing)
- **πŸŽ₯ Video Analysis** (YouTube/video content analysis)
- **🧩 Riddle Solver** (pattern analysis for logic puzzles)
- **🌐 Web Page Fetcher** (HTML to markdown conversion)

## πŸ”§ Quick Start

### 1. **Installation**
```bash
git clone <your-repo>
cd GAIA-Solver-Agent
pip install -r requirements.txt
```

### 2. **Run the Agent**
```bash
python app.py
```

## πŸ”‘ API Key Setup

### **Required for Full Functionality**

#### **Google/Gemini API (Recommended)**
```bash
# Get your key: https://makersuite.google.com/app/apikey
export GOOGLE_API_KEY="your_key_here"
export GEMINI_API_KEY="your_key_here"  # Can be same as GOOGLE_API_KEY
```

#### **Google Custom Search (Optional)**
```bash
# Get search key: https://developers.google.com/custom-search/v1/introduction
# Create search engine: https://programmablesearchengine.google.com/
export GOOGLE_SEARCH_API_KEY="your_search_key"
export GOOGLE_SEARCH_ENGINE_ID="your_engine_id"
```

### **Graceful Fallbacks**

| Feature | With API Key | Without API Key |
|---------|-------------|-----------------|
| **Web Search** | Google Custom Search | DuckDuckGo (free) |
| **File Analysis** | Gemini-powered | Error message with setup guide |
| **Video Analysis** | Gemini-powered | Error message with setup guide |
| **Math/Text/Wikipedia** | βœ… Always available | βœ… Always available |

---