InsightGen is a full-stack, AI-driven data analysis platform. It empowers users to seamlessly upload CSV datasets, automatically extract deep analytical insights, and dynamically build interactive visualizations using both manual controls and intuitive Natural Language Prompts.
- 🚀 Instant Automated Analysis: Upload a CSV and immediately get data types, missing value analysis, and statistical correlations.
- 🤖 AI-Generated Insights: Translates complex data correlations into human-readable business insights.
- 📈 Interactive Chart Builder: Dynamically plot your data with Bar, Line, or Pie charts using an intuitive point-and-click interface.
- 💬 Natural Language Querying: Just type what you want to see (e.g., "Show me the total revenue by region"), and the system automatically builds the correct chart.
- 📄 Extensible Export Options: Download your generated insights into
TXTor beautifully formattedPDFreports. - ⚡ High Performance: Built on FastAPI and Vite for lightning-fast backend processing and frontend rendering.
graph LR
A[User / Frontend React] -->|Upload CSV / Query| B(FastAPI Backend)
B --> C{Pandas Engine}
C -->|Data Cleaning & Stats| B
B --> D[OpenAI API]
D -->|Natural Language Parsing & Insights| B
B -->|JSON Response & Recommendations| A
Frontend:
- Core: React (Vite)
- Visuals: Recharts (Data Visualization)
- Styling: Standard CSS for responsive, modern UI
Backend:
- Language: Python 3
- Framework: FastAPI (REST API)
- Data Engine: Pandas
- Server: Uvicorn (ASGI)
Follow these step-by-step instructions to get a local copy of InsightGen up and running.
- Python 3.8+ installed on your machine.
- Node.js 16+ and npm installed.
- An active OpenAI API Key.
Navigate to the backend directory:
cd backendCreate and activate a Python virtual environment:
# macOS/Linux
python3 -m venv .venv
source .venv/bin/activate
# Windows
python -m venv .venv
.venv\Scripts\activateInstall the required dependencies:
pip install -r requirements.txtSet up your Environment Variables:
cp .env.example .envOpen the .env file and insert your actual API key:
OPENAI_API_KEY=your_real_openai_api_key_hereStart the Backend Server:
uvicorn app.main:app --reload --port 8000The backend API is now running at http://127.0.0.1:8000.
Check out the interactive API Docs at http://127.0.0.1:8000/docs.
Open a new terminal window and navigate to the frontend directory:
cd frontendInstall the Node.js packages:
npm installStart the Development Server:
npm run devThe application will be running at http://127.0.0.1:5173. Open this URL in your browser to start analyzing data!
- Upload Data: Click the Upload CSV button and select a file. (You can test using the generated files in the
sample-data/folder). - Review Insights: The panel will automatically populate with human-readable correlations and data summary.
- Chart Builder & Natural Language:
Use the manual dropdowns to plot data, OR try typing these exact prompts in the chat box:
- "Show me the total revenue by region"
- "What is the average profit for each category?"
- "Plot the trend of units sold over date"
- "Display total revenue by product as a pie chart"
- Export: Click the "Export PDF" or "Export TXT" buttons to save your insights offline.
| Method | Endpoint | Description |
|---|---|---|
POST |
/analyze |
Upload a CSV file via form-data to extract columns, rows, correlational insights, and chart recommendations. |
POST |
/query-chart |
Send a natural language string and available columns to map it to the ideal chart configuration. |
POST |
/query |
Processes a prompt and returns the ideal chart configuration logic {"x": "col", "y": "col", "chart": "type"}. |
POST |
/export-insights/txt |
Send an array of insight strings to generate and download a plain text report. |
POST |
/export-insights/pdf |
Send an array of insight strings to generate and download a formatted PDF report. |
insightgen/
├── backend/ # FastAPI Backend Application
│ ├── app/
│ │ ├── __init__.py
│ │ ├── analyzer.py # Core Pandas dataframe analysis logic
│ │ ├── main.py # FastAPI routes & App definition
│ │ └── schemas.py # Pydantic models for request/response validation
│ ├── requirements.txt # Python dependencies
│ └── .env.example # Environment variables template
├── frontend/ # React/Vite Frontend Application
│ ├── index.html
│ ├── package.json
│ ├── vite.config.js
│ └── src/
│ ├── App.jsx # Main Application Component
│ ├── components/ # Reusable UI Components
│ ├── services/ # API connection logic
│ └── styles.css # Global Styles
└── sample-data/ # Sample CSV files
- Frontend: Update the API base URL in
frontend/src/services/api.jsto point to your live backend domain, then host via Vercel, Netlify, or AWS S3. - Backend: Wrap the FastAPI application in a
Dockerfileand deploy via Render, Railway, or AWS ECS/EC2. Remember to securely inject the.envvariables to your cloud provider. - Handling Large Data: For extremely large files (200MB+), consider converting the in-memory Pandas dataframe loading into distributed chunks or background task queues (e.g., Celery/Redis).