Ask any question about your data in plain English. Get instant, interactive charts — no SQL, no coding required.
BI Dashboard AI lets non-technical users — executives, analysts, anyone — upload a CSV file and immediately start asking business questions in plain English. The system:
- Understands your question using LLaMA 3.3 70B via Groq
- Generates accurate SQL against your actual data
- Validates the SQL before running it (no hallucinated columns)
- Visualizes results as interactive Plotly charts
- Summarizes findings in plain English — no jargon
| Feature | Description |
|---|---|
| 💬 Conversational UI | Chat-style interface with message history and follow-up questions |
| 📁 CSV Upload | Upload any CSV — auto-detects encoding and delimiter |
| 📊 Auto Chart Selection | Picks bar, line, pie, scatter, histogram based on data shape |
| 🔒 Hallucination Prevention | 3-layer validation — prompt injection, SQLite EXPLAIN, empty result detection |
| 📝 Plain-English Summaries | Non-technical summaries with real statistics from actual data |
| 🔢 Single Value Cards | Clean stat cards for single-value answers instead of broken charts |
| ❓ Vague Query Handling | Asks for clarification with suggested questions instead of guessing |
| ⬇️ Data Export | Download any chart's data as CSV |
User (Natural Language)
│
▼
┌─────────────────────┐
│ Streamlit UI │ ← Port 8501 (frontend_template.py)
│ Chat interface │
│ Plotly charts │
└──────────┬──────────┘
│ HTTP POST /query
▼
┌─────────────────────┐
│ FastAPI Backend │ ← Port 8000 (backend_template.py)
└────┬────────────────┘
│
├──► Groq API (LLaMA 3.3 70B)
│ └── Generates SQL + chart spec
│
├──► SQLite EXPLAIN validation
│ └── Rejects hallucinated column names
│
└──► SQLite Query Execution
└── Returns real data → Plotly → User
Pipeline: Text → Groq/LLaMA → SQL → Validate → SQLite → Plotly → Streamlit
- Python 3.9+
- A Groq API key (free at console.groq.com)
python run.pyThat's it. The script will:
- Install all dependencies automatically
- Copy backend and frontend files
- Start FastAPI on port 8000
- Start Streamlit on port 8501
- Open your browser to
http://localhost:8501
your-folder/
├── run.py ← Entry point
├── backend_template.py ← FastAPI backend
└── frontend_template.py ← Streamlit frontend
├── run.py # Single-command launcher
├── backend_template.py # FastAPI app — /query, /upload-csv, /schema
├── frontend_template.py # Streamlit chat UI with Plotly charts
├── backend/
│ └── main.py # Auto-generated from backend_template.py
├── frontend/
│ └── app.py # Auto-generated from frontend_template.py
└── data/
└── *.db # Uploaded CSV stored as SQLite
| Layer | Technology |
|---|---|
| LLM | Groq — LLaMA 3.3 70B Versatile |
| Backend | FastAPI + Uvicorn |
| Database | SQLite (auto-created from uploaded CSV) |
| Frontend | Streamlit |
| Charts | Plotly Express + Graph Objects |
| Data Processing | Pandas + NumPy |
Simple
"What is the average price of all vehicles?"
Intermediate
"Show me prices of 3 Series vehicles in 2018 broken down by fuel type"
Complex
"Show me the trend of average mileage and price over the years for diesel vehicles"
Follow-up (Conversational)
"Now filter this to only show vehicles above 30 MPG"
Hallucination test
"Show me total sales revenue by region" → blocked with explanation
Vague query
"Show me something cool" → asks for clarification with suggestions
The system uses 3 hard gates to prevent the AI from making up data:
- Prompt injection — exact column names are injected into every prompt so the LLM sees the real schema
- SQLite EXPLAIN validation — every generated SQL is validated by SQLite itself before execution; invalid column/table names are caught and blocked
- Empty result detection — if a valid SQL returns zero rows, the user is informed rather than shown an empty chart
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| GET | /schema |
View current database schema |
| POST | /upload-csv |
Upload CSV → SQLite |
| POST | /query |
Natural language → charts |
| POST | /inspect-file |
Debug file parsing |
| GET | /sample-queries |
Get example questions |
{
"prompt": "Show me average price by model",
"conversation_history": [],
"use_uploaded_db": true
}Update the Groq API key in backend_template.py:
GROQ_API_KEY = "your-groq-api-key-here"| Criterion | Implementation |
|---|---|
| Accuracy — Data Retrieval (40%) | Schema-aware SQL with unique value injection and TRIM/LIKE for text matching |
| Accuracy — Chart Selection | LLM instructed with chart type rules; line for time-series, pie for part-of-whole, etc. |
| Accuracy — Error Handling | 3-layer hallucination prevention; vague queries trigger clarification |
| Aesthetics — Design (30%) | Clean light theme, gradient header, card-based layout |
| Aesthetics — Interactivity | Plotly tooltips, zoom, pan, legend toggle on every chart |
| Aesthetics — User Flow | Loading spinner, chat-style messages, instant feedback |
| Architecture (30%) | Full Text→LLM→SQL→SQLite→Plotly pipeline |
| Prompt Engineering | Schema injection, unique value listing, TRIM/LIKE rules, temperature=0 |
| Hallucination Handling | Explicitly reports when data is unavailable; never fabricates |
| Bonus — Follow-ups (+10%) | Full conversation history passed to LLM each turn |
| Bonus — CSV Upload (+20%) | Upload any CSV with auto encoding/delimiter detection |
- Groq — blazing fast LLM inference
- Meta LLaMA 3.3 — open source LLM
- Streamlit — rapid frontend
- FastAPI — modern Python API
- Plotly — interactive charts
Built for the Qualifier — Conversational AI for Instant Business Intelligence Dashboards