03 · Multi-agent analysis system
Agentic Data Analyst
Upload data. Ask in English. Get SQL, AutoML, stats, forecasts, and a living report.
- Specialist agents
- 7
- Unified chat
- 1
- SQL allowlist
- SELECT
- Public demo
- Live
The story
I treated this as a product, not a chatbot demo. One orchestrator. Seven specialist agents. One chat. The interesting engineering is routing, SQL guardrails, leakage flags, and ChromaDB memory so analysis becomes a conversation instead of a one-shot notebook.
Problem
Business teams sit on CSV exports they cannot query. Every small question becomes an analyst ticket. Delivered reports are static. A follow-up a week later restarts the entire exercise.
Why it matters
The bottleneck is not model quality. It is orchestration, safety, and memory. A useful analyst agent must clean before it concludes, restrict SQL to reads, refuse ambiguous merges, and keep findings queryable.
Architecture
Streamlit UI feeds an orchestrator that classifies each turn and dispatches to Quality, SQL, Stats, Forecast, ML, Report, or RAG agents. CSVs land in SQLite. Agent outputs are indexed in ChromaDB with MiniLM embeddings. Groq Llama 3.3 70B drives language. SQL is SELECT/CTE only.
System
One chat. Seven specialists.
Streamlit chat
One interface. No mode switch.
Orchestrator
Rule + LLM routing
Quality
Profile + clean
SQL
Text-to-SQL
Stats
t-test / ANOVA
Forecast
Trend + bands
ML
XGB / sklearn
Report
HTML export
RAG
ChromaDB
LLM
Groq Llama 3.3
CSV ingest
Types inferred
SQLite
Queryable tables
Specialists
SQL · ML · stats
ChromaDB
Indexed findings
Quality gate on ingest
Upload churn CSV
Score, missing values, duplicates. Auto-clean or skip. Ambiguous IDs stay human decisions.
Technical decisions
Quality gate before insight
Missing values, duplicates, type issues, and outliers are profiled on upload. Safe auto-clean is optional. Ambiguous category merges are never auto-decided.
SQL as a specialist, not a general LLM
The SQL agent emits SELECT/CTE only. INSERT/UPDATE/DELETE/DROP are blocked. Multi-table joins are supported with explicit key hints.
Session memory via ChromaDB
Every agent output is indexed. Follow-up questions retrieve prior findings with citations instead of starting from zero.
Honest scope
AutoML is exploratory, not a production training pipeline. Forecasts are lightweight trends. Causal claims stay off-limits unless the user designs an experiment.
Challenges
Routing without mode-switching
Users should not pick SQL vs ML vs RAG. The orchestrator has to classify mixed language and keep context across specialists.
Leakage and overfit flags
Small CSVs make vanity metrics easy. The ML agent surfaces driver language with overfit and leakage warnings instead of a trophy accuracy score.
Guardrails that fail closed
A missing API key should warn, not crash. Unsafe SQL should never reach SQLite. Ambiguous IDs should ask, not guess.
Outcomes
- 01
Live Streamlit deployment with sample churn and housing datasets.
- 02
End-to-end path: ingest → quality → SQL → stats → forecast → AutoML → report → RAG.
- 03
Reusable orchestration pattern for SQL + ML + RAG behind a single chat contract.