AI-powered data analysis assistant that generates and executes Python code to analyze data and create visualizations.
- 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
- AI Model: OpenAI GPT-4
- Code Execution: E2B Code Interpreter
- Interface: Gradio
- Deployment: HuggingFace Spaces
# 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.pyVisit http://localhost:7860 to use the chat interface.
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"
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 coursework