Skip to content

AI-powered data analysis assistant using E2B Code Interpreter and Gradio

Notifications You must be signed in to change notification settings

https-deeplearning-ai/data-analyzer-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Analyzer Agent

AI-powered data analysis assistant that generates and executes Python code to analyze data and create visualizations.

Live Demo

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

Gradio OpenAI E2B Python HuggingFace

  • AI Model: OpenAI GPT-4
  • Code Execution: E2B Code Interpreter
  • Interface: Gradio
  • Deployment: HuggingFace Spaces

Getting Started

Local Development

# 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 coursework

About

AI-powered data analysis assistant using E2B Code Interpreter and Gradio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages