Spaces:
Runtime error
Runtime error
| title: Data Analyzer Agent | |
| emoji: π | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: gradio | |
| sdk_version: 5.29.0 | |
| python_version: "3.10" | |
| app_file: app.py | |
| pinned: false | |
| # Data Analyzer Agent | |
| AI-powered data analysis assistant that generates and executes Python code to analyze data and create visualizations. | |
| [](https://davidleocadio94dlai-data-analyzer-agent.hf.space) | |
| ## Features | |
| - **AI-Powered Analysis** β Describe what you want in natural language, get executable Python code and results | |
| - **Secure Code Execution** β E2B sandbox isolates code execution for safe, reliable operation | |
| - **Data Visualizations** β Generate matplotlib and seaborn charts displayed directly in chat | |
| - **Statistical Analysis** β Compute distributions, correlations, descriptive statistics, and more | |
| ## Tech Stack | |
|  | |
|  | |
|  | |
|  | |
|  | |
| - **AI Model:** OpenAI GPT-4 | |
| - **Code Execution:** E2B Code Interpreter | |
| - **Interface:** Gradio | |
| - **Deployment:** HuggingFace Spaces | |
| ## Getting Started | |
| ### Local Development | |
| ```bash | |
| # Clone the repository | |
| git clone https://github.com/davidleocadio94/data-analyzer-agent.git | |
| cd data-analyzer-agent | |
| # Install dependencies | |
| pip install -r requirements.txt | |
| # Set up environment variables | |
| export OPENAI_API_KEY=your-openai-key | |
| export E2B_API_KEY=your-e2b-key | |
| # Run the application | |
| python app.py | |
| ``` | |
| Visit `http://localhost:7860` to use the chat interface. | |
| ## Example Queries | |
| Try these prompts to explore the agent's capabilities: | |
| - *"Generate 100 random numbers from a normal distribution and plot a histogram"* | |
| - *"Calculate the mean, median, and standard deviation of [23, 45, 67, 89, 12, 34, 56]"* | |
| - *"Create a scatter plot showing the relationship between x and y where y = 2x + noise"* | |
| - *"Analyze the correlation between two random variables and visualize it"* | |
| ## Project Structure | |
| ``` | |
| data-analyzer-agent/ | |
| βββ app.py # Gradio chat interface | |
| βββ src/ | |
| β βββ agent.py # OpenAI agent with tool execution | |
| β βββ tools.py # E2B code interpreter tool | |
| βββ requirements.txt # Python dependencies | |
| βββ README.md | |
| ``` | |
| --- | |
| Built as part of [DeepLearning.AI](https://www.deeplearning.ai/) coursework | |