MU
← All Projects4.1
AI Data Analysis Agent
AI-PoweredAI-Powered Tools
A production AI agent that enables conversational data analysis with real-time code execution. Users upload CSV/Excel files and ask questions in natural language. The agent writes and executes Python code in a secure E2B sandbox, generating visualizations and insights streamed back in real-time via SSE.
Technology Stack
matplotlib
System Architecture
Loading diagram...
Specifications
- ▸Natural Language Queries: Ask questions about your data in plain English
- ▸Secure Code Execution: Python runs in isolated E2B sandbox with pandas, numpy, matplotlib, seaborn, scipy
- ▸Real-time Streaming: SSE streams code, output, and charts as they are generated
- ▸Persistent Sessions: Session context file preserves analysis state across follow-up questions
- ▸Self-Healing: Extracts valid code from malformed LLM responses, auto-switches models on failures
- ▸Chart Generation: matplotlib/seaborn visualizations rendered inline with automatic deduplication
Design Decisions
| Challenge | Solution |
|---|---|
| Vercel 10s timeout too short for analysis | Direct browser-to-Cloud Run SSE connection bypasses serverless limits |
| LLM tool call format inconsistent | Robust code extraction from various argument formats + syntax validation |
| Model overload/rate limits | Automatic fallback from Kimi K2 to Llama 3.3 70B with retry logic |
| Users ask follow-up questions | Session context file + sandbox persistence maintains conversation state |
| Secure code execution | E2B sandbox isolates Python environment with pre-installed data science libraries |
Process Flow
Loading diagram...
User Interface
Data Analysis Interface
Chat-based interface for exploring datasets with AI-generated code and visualizations
◆Drag-and-drop file upload for CSV/Excel
◆Real-time code execution with syntax highlighting
◆Interactive charts rendered inline
◆Follow-up questions with session memory
Try Live Demo→https://tewtor.ai