Spaces:
Sleeping
Sleeping
File size: 2,107 Bytes
e2f9a1d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # 30-in-15 Β· #12 β CSV β Insights Analyst (plan)
**Rung focus:** code execution + a data agent (vs. #11's long-running service).
**One-liner:** Upload a CSV β get auto-generated charts + plain-English findings you can trust.
## Core principle (honest by construction)
The LLM **never invents numbers.** A deterministic profiling pass (pandas) computes every stat and
chart; the model only *narrates* the already-computed summary. Numbers in the writeup are grounded in
the computed profile, not hallucinated. (Mirrors the #10 RAG "honest, cited" discipline.)
## v1 scope (lean)
1. **Upload** a CSV (size-capped, typed sniff).
2. **Profile** (pandas): shape, dtypes, missing %, numeric describe, top categoricals, correlations,
simple outlier + trend flags.
3. **Auto-charts** (matplotlib, GritAI design-system palette): distributions, top categories,
correlation heatmap, and a time trend if a date column is detected.
4. **Narrative**: LLM turns the computed profile into a plain-English "what's interesting here" β
grounded in the numbers, flags data-quality issues, suggests next questions.
5. **Ask-a-question** (stretch): natural-language question β constrained pandas op executed on the
dataframe β answer + the exact numbers (the "data agent / code execution" angle).
## Stack
- Flask + the canonical GritAI design system (`docs/gritai_design_system.css`), same as the Flask rungs.
- pandas + matplotlib (stdlib-adjacent, no heavy deps).
- Backend LLM: local Ollama (free) by default; Claude optional β same env-var pattern as the bot.
- Deploy: HF docker Space per [[hf-spaces-deploy-playbook]] β `insights.gritai.solutions` on the hub.
- Two-tier: free demo (funnel) / paid "GritAI Studio" full stack.
## Validate on REAL data (Rob's rule)
Build + tune against a real CSV Rob provides so the demo isn't synthetic. Fallback: a solid public
dataset, swap Rob's in later.
## Safety
Same secrets hygiene (env-only keys, log exception TYPE only). Uploaded data stays local/ephemeral;
never logged, never sent anywhere except the chosen LLM backend (local by default).
|