DataChat is a full-stack AI-powered data analytics platform that allows users to upload datasets, ask questions in natural language, generate visualizations, discover statistical insights, run predictive models, and export analysis as a PDF report.
Instead of requiring users to write Python, SQL, or manually build charts, DataChat translates natural-language questions into structured analytical operations and executes them against the uploaded dataset.
Live Demo: Deployed web application Status: Active / Deployed
Traditional data analysis often requires users to understand spreadsheets, Python, pandas, statistical concepts, and visualization libraries before they can extract useful information from their data.
DataChat provides a conversational interface for this process.
A user can upload a CSV or Excel dataset and ask questions such as:
Show the distribution of marks
Compare average salary by department
Show a scatter plot of attendance vs marks
Show the correlation matrix
Find outliers in salary
Describe the age column in detail
Predict marks using attendance and study hours
The system interprets the request, validates it against the dataset schema, executes the appropriate analysis, generates insights, and presents the result through an interactive interface.
Ask questions about an uploaded dataset using plain English.
DataChat converts the question into a structured analysis intent before executing it.
User Question
↓
Intent Detection
↓
Schema Validation
↓
Analysis Execution
↓
Insight Generation
↓
Visualization / Result
When a dataset is uploaded, DataChat automatically analyzes its structure.
The profiling layer identifies:
- Column names
- Data types
- Unique values
- Missing values
- Sample values
- Numeric columns
- Categorical columns
- Dataset dimensions
- Data-quality characteristics
The generated schema is then supplied to the intent parser so that the AI works with the actual columns available in the dataset.
DataChat can automatically investigate a newly uploaded dataset.
The exploration pipeline can identify:
- Dataset statistics
- Column inventory
- Missing values
- Duplicate records
- Data-quality issues
- Important statistical patterns
- Recommended analyses
- Automatic visualizations
- Key findings
This allows the system to provide useful information even before the user asks a specific question.
| Operation | Description |
|---|---|
summary |
Dataset-level summary and statistics |
histogram |
Distribution analysis for numeric columns |
groupby |
Aggregation across categorical groups |
correlation |
Correlation matrix between numeric columns |
missing |
Missing-value analysis |
trend |
Legacy trend analysis |
timeseries |
Time-based trends, growth and volatility |
outliers |
Outlier detection |
value_counts |
Frequency analysis of categorical values |
describe |
Detailed descriptive statistics |
duplicates |
Duplicate-row detection |
invalid_values |
Data-quality and invalid-value detection |
dynamic_chart |
Flexible visualization generation |
predictive_model |
Regression and classification modeling |
DataChat supports multiple visualization types through Plotly:
- Scatter plots
- Bar charts
- Line charts
- Box plots
- Pie charts
- Correlation heatmaps
- KDE / density plots
- Violin plots
- Stacked bar charts
- Area charts
- Histograms
Example natural-language requests:
Show a scatter plot of attendance vs marks
Show a violin plot of marks by class
Show a stacked bar chart of class by gender
Show an area chart of revenue over month
Show a density plot of salary
The backend generates chart-ready data while the frontend is responsible for rendering the visualization.
DataChat uses a Groq-hosted LLM through an OpenAI-compatible API to interpret natural-language questions.
The intent parser receives:
- The user's question
- The current dataset schema
- Supported analysis operations
- Supported visualization types
It then returns a strict JSON representation of the requested operation.
For example:
{
"operation": "dynamic_chart",
"chart_type": "scatter",
"x": "attendance",
"y": "marks"
}The system validates the returned intent before executing it.
This separation between AI interpretation and deterministic analysis execution prevents the LLM from directly manipulating the dataset.
The project separates language understanding from data computation.
┌─────────────────────┐
│ User Query │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Intent Parser │
│ (Groq LLM) │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Schema Validation │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Analysis Executor │
└──────────┬──────────┘
│
┌─────────────────────┼─────────────────────┐
│ │ │
▼ ▼ ▼
Statistical Visualization ML / Predictive
Analysis Engine Analysis
│ │ │
└─────────────────────┼─────────────────────┘
│
▼
┌─────────────────────┐
│ Insight Engine │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Frontend │
│ Charts + Results │
└─────────────────────┘
DataChat also provides tabular predictive modeling.
Supported models include:
- Linear Regression
- Random Forest Regressor
- Logistic Regression
- Random Forest Classifier
The system automatically determines whether the target is more suitable for regression or classification based on the target column.
Example:
Predict marks using attendance and study hours
The modeling pipeline includes:
- Feature selection
- Numeric preprocessing
- Missing-value imputation
- Categorical encoding
- Feature scaling
- Train/test splitting
- Model training
- Evaluation
- Feature importance
- Prediction confidence estimation
Example supported metrics include:
Regression:
- MAE
- MSE
- RMSE
- R²
Classification:
- Accuracy
- Precision
- Recall
- F1 Score
DataChat does more than display raw statistical results.
The insight engine interprets analytical results and generates structured findings.
For example, a correlation analysis can identify:
Strongest relationship:
attendance ↔ marks
Pearson r = 0.78
A distribution analysis can identify:
- Mean vs median differences
- Distribution skew
- Standard deviation
- Interquartile range
- Potential outliers
- Coefficient of variation
Group comparisons can identify:
- Highest-performing groups
- Lowest-performing groups
- Spread between groups
- Groups above the overall average
These insights are returned alongside the visualization.
DataChat maintains analytical context between questions.
For example:
User:
Show a histogram of marks
DataChat:
[Histogram]
User:
Now compare this by class
DataChat:
[Grouped analysis]
The session-memory layer tracks information such as:
- Last operation
- Last chart type
- Previously used columns
- Last grouping column
- Last intent
- Last result
- Previous insights
- Active filters
This allows follow-up questions to reference previous analytical context.
The system supports natural-language filtering such as:
Show students where marks > 80
Focus on class A
Show only high scorers
The filter parser converts these requests into dataframe operations before analysis.
DataChat provides dedicated time-series analysis for temporal datasets.
The time-series engine calculates:
- Trend direction
- Rolling mean
- Period-over-period growth
- Total growth
- CAGR when applicable
- Volatility
- Coefficient of variation
- Peak value
- Trough value
- Date range
- Number of observations
Example:
Show revenue growth over time
Users can generate a downloadable PDF report containing information derived from the dataset and recent analysis.
The reporting pipeline can include:
- Dataset summary
- Schema information
- Key findings
- Generated insights
- Recent analysis
- Visualizations
- Interpretations
Reports are generated using ReportLab.
DataChat includes basic protection against excessive memory usage.
The backend currently supports:
- Maximum upload size: 50 MB
- Maximum in-memory dataset size: 100,000 rows
For datasets exceeding the configured row threshold, the system samples the dataset before analysis while preserving information about the original row count.
The frontend can indicate when sampling has occurred.
- Next.js 14
- React 18
- TypeScript
- Tailwind CSS
- Plotly.js
- react-plotly.js
- Python
- FastAPI
- Uvicorn
- Pandas
- NumPy
- Scikit-learn
- Groq API
- OpenAI-compatible API interface
- LLM-based intent parsing
- LLM-assisted natural-language explanations
- Pandas
- OpenPyXL
- xlrd
- ReportLab
- Vercel — Frontend
- Render — Backend
datachat/
│
├── backend/
│ ├── app/
│ │ ├── agents/
│ │ │ └── investigation_agent.py
│ │ │
│ │ ├── ai/
│ │ │ └── intent_parser.py
│ │ │
│ │ ├── analysis/
│ │ │ ├── analysis_executor.py
│ │ │ ├── auto_explorer.py
│ │ │ ├── correlation.py
│ │ │ ├── describe.py
│ │ │ ├── duplicates.py
│ │ │ ├── dynamic_chart.py
│ │ │ ├── explanation.py
│ │ │ ├── groupby.py
│ │ │ ├── health_auditor.py
│ │ │ ├── histogram.py
│ │ │ ├── insight_engine.py
│ │ │ ├── invalid_values.py
│ │ │ ├── missing.py
│ │ │ ├── outliers.py
│ │ │ ├── predictive_model.py
│ │ │ ├── summary.py
│ │ │ ├── timeseries.py
│ │ │ ├── trend.py
│ │ │ └── value_counts.py
│ │ │
│ │ ├── context/
│ │ │ └── session_memory.py
│ │ │
│ │ ├── reporting/
│ │ │ └── report_generator.py
│ │ │
│ │ ├── services/
│ │ │ └── profiling.py
│ │ │
│ │ ├── utils/
│ │ │ └── validator.py
│ │ │
│ │ └── main.py
│ │
│ ├── reports/
│ ├── requirements.txt
│ └── runtime.txt
│
├── frontend/
│ ├── app/
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ └── page.tsx
│ │
│ ├── components/
│ │ └── ChartRenderer.tsx
│ │
│ ├── package.json
│ ├── next.config.js
│ ├── tailwind.config.js
│ └── tsconfig.json
│
└── README.md
Make sure the following are installed:
- Python 3.10+
- Node.js 18+
- npm
- Git
- A Groq API key
git clone <YOUR_REPOSITORY_URL>
cd datachatNavigate to the backend:
cd backendCreate a virtual environment:
python -m venv venvActivate it.
.\venv\Scripts\Activate.ps1source venv/bin/activateInstall dependencies:
pip install -r requirements.txtCreate a .env file inside backend/.
GROQ_API_KEY=your_groq_api_key
GROQ_MODEL=llama-3.1-8b-instant
FRONTEND_URL=http://localhost:3000
CORS_ORIGINS=http://localhost:3000Never commit
.envfiles or API keys to GitHub.
From the backend directory:
uvicorn app.main:app --reloadThe backend will run on:
http://127.0.0.1:8000
Health check:
http://127.0.0.1:8000/health
Expected response:
{
"status": "Backend running"
}Open another terminal:
cd frontendInstall dependencies:
npm installCreate .env.local:
NEXT_PUBLIC_API_URL=http://127.0.0.1:8000Start the development server:
npm run devThe frontend will be available at:
http://localhost:3000
Upload one of the supported formats:
.csv
.xlsx
.xls
DataChat automatically profiles the dataset and generates an initial exploration.
Use natural language:
Show summary
Show histogram of salary
Compare average salary by department
Show correlation matrix
Find outliers in age
DataChat returns:
- Analysis result
- Interactive visualization
- Statistical information
- Plain-English explanation
- Generated insights
- Recommended follow-up analyses
After analysis, generate a PDF report containing the relevant findings and visualizations.
The FastAPI backend exposes several core endpoints.
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/health |
Backend health check |
POST |
/upload |
Upload and profile dataset |
POST |
/query |
Analyze natural-language question |
POST |
/investigate |
Run autonomous dataset investigation |
POST |
/generate-report |
Generate PDF analysis report |
DELETE |
/session/{session_id} |
Release session data |
POST /query
Content-Type: application/json{
"question": "Show a scatter plot of attendance vs marks",
"session_id": "your-session-id"
}The backend returns the parsed intent, analytical result, explanation, and generated insights.
DataChat uses a split deployment architecture:
┌────────────────────┐
│ Vercel │
│ Next.js Frontend │
└─────────┬──────────┘
│
│ HTTPS API
▼
┌────────────────────┐
│ Render │
│ FastAPI Backend │
└─────────┬──────────┘
│
┌────────┴─────────┐
│ │
▼ ▼
Groq API Analysis
Engine
Deployed using Vercel.
Required environment variable:
NEXT_PUBLIC_API_URL=<BACKEND_URL>Deployed using Render.
Required environment variables:
GROQ_API_KEY=<YOUR_KEY>
GROQ_MODEL=llama-3.1-8b-instant
FRONTEND_URL=<FRONTEND_URL>
CORS_ORIGINS=<FRONTEND_URL>The repository includes backend tests covering several parts of the system.
Examples include:
test_complete.py
test_extended.py
test_health_auditor.py
test_predictive_model.py
test_unit.py
test_validation.py
Additional integration and feature-level tests are included for areas such as:
- Auto exploration
- Backend responses
- Follow-up memory
- Insight generation
- Scatter validation
- Module imports
Run the test suite with:
pytestDataChat follows several architectural principles.
The LLM is primarily responsible for understanding the user's request.
The actual statistical computation is performed by deterministic Python code.
LLM
↓
Structured Intent
↓
Validation
↓
Deterministic Analysis
This makes the analytical pipeline easier to reason about and test.
The AI receives the actual dataset schema before interpreting a query.
This helps prevent requests from referring to columns that do not exist.
Each analytical capability is separated into its own module.
This makes it easier to add new analytical operations without rewriting the entire backend.
The frontend focuses on:
- User interaction
- Dataset upload
- Conversation UI
- Visualization
- Report downloads
The backend handles:
- Data processing
- AI interpretation
- Analysis
- Session management
- Insight generation
- Report creation
DataChat is an actively developed project and has several limitations.
- Analysis operates on uploaded datasets rather than persistent databases.
- Session data is stored in server memory.
- Session state is temporary.
- Large datasets may be sampled to control memory usage.
- Predictive modeling is intended for tabular experimentation rather than production ML deployment.
- LLM-generated explanations depend on external API availability.
- The current intent parser supports a defined set of analytical operations rather than arbitrary Python/SQL execution.
- Future forecasting is intentionally outside the currently supported analysis pipeline.
- Authentication and multi-user persistent storage are not currently part of the core architecture.
- Dataset profiling
- Missing-value analysis
- Duplicate detection
- Outlier detection
- Descriptive statistics
- Correlation analysis
- Time-series analysis
- Data-quality analysis
- Histogram
- Bar chart
- Scatter plot
- Line chart
- Box plot
- Pie chart
- Heatmap
- KDE
- Violin plot
- Stacked bar
- Area chart
- Natural-language query parsing
- Schema-aware intent generation
- Follow-up query resolution
- AI explanations
- Automated insights
- Autonomous dataset investigation
- Regression
- Classification
- Feature importance
- Model evaluation
- PDF report generation
- Dataset summary
- Findings
- Insights
- Visualization inclusion
- Persistent database-backed sessions
- Authentication and user accounts
- Multi-dataset workspaces
- Advanced statistical testing
- More ML models
- Improved autonomous analysis
- Database / SQL data sources
- Production-grade observability
- More advanced report customization
Do not commit sensitive credentials.
The following files should remain local:
.env
.env.local
API keys should be provided through environment variables.
The production deployment should also configure CORS to allow only trusted frontend origins.
Contributions are welcome.
A typical workflow is:
git checkout -b feature/your-featureMake your changes, test them, and commit:
git add .
git commit -m "feat: add your feature"Push the branch:
git push origin feature/your-featureThen open a pull request.
Add the project's chosen license here.
For example:
MIT License
Ayush Kottary
Built as a full-stack AI/data analytics engineering project combining:
Artificial Intelligence
+
Data Science
+
Machine Learning
+
Data Visualization
+
Full-Stack Development
DataChat is deployed and actively developed.
The current version focuses on conversational dataset analysis, automated insights, interactive visualizations, predictive modeling, and report generation.