--- title: CSV to Insights Analyst emoji: ๐Ÿ“Š colorFrom: gray colorTo: red sdk: docker app_port: 7860 pinned: false --- # CSV โ†’ Insights Analyst ๐Ÿ“Š Upload a CSV โ†’ get **auto-generated charts + a plain-English briefing you can trust**. > Project **#12** of the *"30 AI Projects in 15 Days"* build-in-public challenge. > Focus: **code execution + a data agent** (vs. #11's long-running service). ## Honest by construction The AI **never invents a number.** A deterministic pandas pass computes *every* statistic and chart; the model only turns that computed profile into prose. Units the model tries to guess (mm, ยฐC, โ€ฆ) are stripped โ€” they aren't in your file. Same grounded discipline as the #10 RAG app. ## What it does - **Profile** โ€” shape, dtypes, missing %, numeric summaries, top categories, correlations, outliers, date-range detection, and plain-language data-quality flags. - **Charts** โ€” trend-over-time, correlation heatmap, distributions, and category bars (GritAI design system). - **Findings** โ€” a short, plain-English briefing grounded only in the computed numbers, with follow-up questions the data could answer next. ## How it works - `profiler.py` โ€” computes the full structured profile (pandas). The source of every number. - `charts.py` โ€” matplotlib charts from the profile, returned as inline base64 PNGs. - `narrator.py` โ€” turns the profile into prose. Local Ollama by default (free/private); Claude optional. A deterministic post-pass strips any units the model added. - `app.py` โ€” Flask UI: upload or try the sample, 12 MB cap, data handled in-memory (never persisted). ## Two tiers - **This hosted demo** narrates via Claude-haiku (charts + stats are 100% local pandas). - **GritAI Studio** (paid) runs the whole thing โ€” narrative included โ€” on your own local GPU fleet: free per-analysis, fully private, nothing leaves your network. ## Run locally ```bash pip install -r requirements.txt python app.py # http://127.0.0.1:7860 # Backend: set INSIGHTS_LLM_BACKEND=ollama (default, local) or =claude (set ANTHROPIC_API_KEY) ``` --- Built by **Robert Lucyk** ยท [GritAI Solutions](https://gritai.solutions) ยท part of the 30-in-15 challenge.