Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available: 6.13.0
GAIA AI Agent - Hugging Face Space Setup
This directory contains an optimized GAIA AI agent designed for the Hugging Face Unit 4 final assignment.
π― Goal
Score 30+ on GAIA Level 1 questions to earn certification.
π Quick Setup
1. Create a Hugging Face Space
- Go to Hugging Face Spaces
- Click "Create new Space"
- Choose "Gradio" as the SDK
- Upload all files from this
hf_spacedirectory
2. Set up API Keys
- Get a free Groq API key from console.groq.com
- (Optional) Get a Tavily API key from tavily.com
- In your Space settings, add these as secrets:
GROQ_API_KEY: Your Groq API keyTAVILY_API_KEY: Your Tavily API key (optional)
3. Run the Evaluation
- Open your Space
- Login with your Hugging Face account
- Click "Run Evaluation & Submit All Answers"
- Wait for results (usually 2-5 minutes)
π§ Agent Features
- Fast LLM: Uses Llama 3.1 70B via Groq for quick responses
- Web Search: Real-time information via Tavily API
- Math Tools: Built-in calculator for numerical problems
- Optimized: Streamlined for speed and accuracy
- Error Handling: Robust error management
π Files Overview
app.py: Main Gradio applicationagent.py: Core GAIA agent implementationrequirements.txt: Python dependenciessystem_prompt.txt: Agent instructionsREADME.md: Space documentation.env.example: Environment variable template
π§ Technical Details
The agent uses a multi-step approach:
- Analysis: Determines if tools are needed
- Tool Usage: Applies calculations or web search
- Reasoning: Combines information for final answer
- Formatting: Ensures proper "FINAL ANSWER:" format
π― Optimization for GAIA
- Focused on Level 1 questions (basic reasoning)
- Fast model selection (70B for capability, Groq for speed)
- Minimal tool overhead
- Direct answer extraction
- Error recovery mechanisms
π Expected Performance
Target: 30%+ accuracy on GAIA Level 1 questions
- Mathematical problems: High accuracy
- Web search questions: Good accuracy with Tavily
- Reasoning tasks: Moderate to high accuracy
- Overall: Should achieve certification threshold
π οΈ Customization
You can improve the agent by:
- Adjusting the system prompt
- Adding more specialized tools
- Fine-tuning the answer extraction
- Implementing caching mechanisms
- Adding more robust error handling
Good luck with your certification! π