AutoAnalyst is an autonomous Business Intelligence agent capable of ingesting raw datasets (CSV, Excel), performing Python-based statistical analysis in a sandboxed environment, and generating boardroom-ready reports with strategic insights and visualizations.
It features a secure SaaS architecture with Google Authentication, user history persistence, and programmatic PDF export capabilities.
- Generative BI: Transforms raw data into "McKinsey-style" executive summaries, KPI tables, and deep-dive analysis.
- Autonomous Coding: Uses a LangChain agent running in a secure E2B Sandbox to write and execute Python code for data visualization (Line, Bar, Donut charts).
- Multi-File Logic: Intelligently handles multiple datasets, detecting overlapping dates or analyzing distinct files separately.
- Professional UI: Glassmorphism-inspired React dashboard with Markdown rendering, interactive charts, and drag-and-drop file staging.
- Secure Infrastructure:
- Auth: Google OAuth2 + JWT Session management.
- Database: MongoDB (Motor/AsyncIO) for storing chat history and analysis results per user.
- Export: Client-side programmatic PDF generation (jsPDF) for high-fidelity reports.
- Framework: React (Vite)
- Styling: Tailwind CSS + Lucide Icons
- State: Axios + React Hooks
- Visualization: Custom Markdown Components (
remark-gfm) + Base64 Image Rendering
- API: FastAPI (Python)
- AI Orchestration: LangChain (Graph Workflow)
- Code Execution: E2B Code Interpreter (Sandboxed Python Environment)
- Database: MongoDB Atlas
- Security: OAuth2, BCrypt, JWT
- User Upload: Files are sent to the FastAPI backend.
- Agent Reasoning: The LLM (Gemini/OpenAI) plans a "Visualization Strategy" (e.g., Top 5 Rule).
- Sandboxed Execution: Python code is generated and executed inside an E2B Sandbox to ensure security and prevent hallucinations.
- Response Construction: The agent returns a structured Markdown report + Base64 encoded images.
- Rendering: The React frontend parses the Markdown into UI cards and renders the charts.
- Node.js & npm
- Python 3.10+
- MongoDB Atlas URI
- Google Cloud Console Credentials
cd backend
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
# Create a .env file with:
# MONGO_URL=...
# GOOGLE_CLIENT_ID=...
# SECRET_KEY=...
# E2B_API_KEY=...
# GOOGLE_API_KEY=...
python main.py


