File size: 2,222 Bytes
cf52e88
e2f9a1d
 
 
 
cf52e88
e2f9a1d
cf52e88
 
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
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.