Local-first AI analyst workspace for Tunisian SME commerce data with DuckDB, Streamlit, Firecrawl evidence ingestion, and safe natural-language SQL.
# TuniData AI
TuniData AI is a local-first, source-aware AI analyst workspace for Tunisian SME commerce data. It turns CSV/Excel files and optional live Firecrawl research into a filterable dashboard, safe DuckDB SQL answers, AI-grounded synthesis, and exportable Markdown reports.
## Why It Matters
Small Tunisian teams often have the real business signal already: spreadsheets from shops, marketplaces, social commerce, delivery partners, and seasonal campaigns. TuniData AI makes that signal inspectable without hiding the logic behind a black box.
The app is designed as a Data/AI portfolio project by **Jessem Abouda**: practical data engineering, local analytics, explainable query routing, and a Tunisian demo story that feels grounded instead of generic.
## What Makes It Different
- **Tunisian commerce cockpit**: governorates, regions, TND revenue, marketplace/social-commerce channels, Ramadan/Eid, summer, back-to-school, and delivery pressure.
- **Interactive dashboard**: coordinated filters, KPI strip, regional leaderboard, monthly revenue and margin trend, channel mix, delivery heatmap, profitability scatter, return-rate chart, and searchable order table.
- **Live SourceBridge ingestion**: optional Firecrawl BYOK search/scrape accepts one URL, pasted URL lists, or search results, then turns web sources into ledgers, readable excerpts, auto-extracted source facts, custom structured tables, and extracted table candidates.
- **Explainable Ask Data flow**: natural-language questions route into deterministic SQL plans, with Ollama Cloud synthesis over SQL results, bounded dataset snapshots, and collected sources.
- **Read-only SQL guardrails**: mutating statements and file-access functions are blocked before execution.
- **Local-first execution**: Streamlit + DuckDB, no hosted database required. Firecrawl and Ollama keys are session-only in the UI.
- **Portfolio-ready exports, docs, and tests**: source-aware Markdown reports, source-ledger CSV export, arch …