Upload any CSV, get instant statistics, beautiful charts, and AI-powered answers — all in one sleek dark-themed web app.
| Feature | Description |
|---|---|
| 📁 CSV Upload | Upload any CSV or use the built-in retail dataset |
| 📈 Auto Visualizations | Bar, Pie, Line, Histogram & Scatter charts via Plotly + Seaborn |
| 🤖 AI Q&A Chat | Ask anything about your data — powered by Groq LLaMA 3.3 70B |
| 📊 Smart Statistics | Min, max, mean, std, quartiles, frequency distributions |
| 🔒 Secure API Handling | Keys loaded automatically from .env / Streamlit Secrets — no manual input needed |
| 🌙 Dark Glassmorphism UI | Premium dark-themed Streamlit interface |
📦 AI Data Analysis Assistant/
├── 📄 app.py → Streamlit web interface (main app)
├── 📄 main.py → CLI pipeline (terminal mode)
├── 📄 analysis.py → Data loading + statistics + Q&A logic
├── 📄 visualization.py → Seaborn/Matplotlib chart generator
├── 📄 dataset.csv → 50-row realistic retail dataset
├── 📄 requirements.txt → Python dependencies
├── 📄 .env.example → API key template (safe to commit)
├── 📄 .env → Your actual API key (NEVER commit this)
├── 📁 charts/ → Auto-generated PNG charts saved here
└── 📄 README.md → You are here!
git clone https://github.com/binarylaiba/AI-Data-Analysis-Asistant.git
cd AI-Data-Analysis-Asistantpip install -r requirements.txt# Copy the example file
copy .env.example .envOpen .env and add your key:
GROQ_API_KEY=gsk_your_real_key_here🔑 Get a free Groq API key at → https://console.groq.com/keys
Note: The app works without a key — AI chat is simply skipped gracefully.
py -m streamlit run app.pyOpens at http://localhost:8501
What you get:
- 📌 Sidebar — Upload any CSV or use default
dataset.csv - 📊 Metric Cards — Total records, total sales, avg age, top category
- 🔍 Dataset Preview — First 10 rows + column types + missing values
- ❓ Competition Q&A — Styled answers to all 3 analysis questions
- 📉 Interactive Plotly Chart — Dark-themed, hover-enabled charts
- 🖼️ Chart Export — Saved PNG preview (Seaborn/Matplotlib)
- 💬 AI Chat — Ask anything about your data in real time
py main.py dataset.csvSteps it runs:
- Loads & inspects the CSV
- Prints full descriptive statistics
- Answers the 3 competition questions
- Generates
charts/sales_by_category.png - Sends chart to Groq for a 2-sentence AI explanation
- Launches interactive Q&A — type questions, get instant answers. Type
exitto quit.
dataset.csv — 50 rows of realistic retail transactions:
| Column | Type | Description |
|---|---|---|
Order_ID |
int | Unique order ID (1001–1050) |
Product |
string | Product name |
Category |
string | Electronics / Furniture / Clothing / Home & Kitchen |
Sales |
float | Revenue per order (USD) |
Age |
int | Customer age |
City |
string | US city |
| # | Question | Answer |
|---|---|---|
| 1 | Which product has the highest total sales? | 🥇 Laptop |
| 2 | What is the average customer age? | 📅 37.14 years |
| 3 | Which product category appears most frequently? | 🏷️ Electronics |
Exact figures are computed at runtime directly from
dataset.csv.
pandas
numpy
matplotlib
seaborn
groq
streamlit
python-dotenv
plotlyInstall all at once:
pip install -r requirements.txt-
dataset.csv— 50-row retail dataset with required headers -
analysis.py—load_data,analyze_data,answer_questions -
visualization.py—generate_chart(Seaborn/Matplotlib PNG) -
main.py— CLI pipeline + interactive Q&A (Groq) -
app.py— Streamlit web interface with all required panels -
requirements.txt— all dependencies listed -
.env.example— placeholder API key (safe for version control) -
README.md— this file
- API key is loaded automatically from
.envor Streamlit Cloud Secrets - No manual API key input in the UI — clean & secure by design
.envis listed in.gitignore— your key is never committed
- AI model used:
llama-3.3-70b-versatilevia Groq (with fallback models) - All Python files are commented with clean section dividers
- Charts are auto-saved to
charts/sales_by_category.png - Streamlit app and CLI pipeline run independently of each other
Made with ❤️ by Laiba | Powered by Groq + Streamlit