Applied AI / 03
governed self-service
Analytics copilot
Ask the warehouse a question in plain English and get governed SQL, a chart and a one-line answer, or an honest decline.
The decisionWhether a business user can get a trustworthy number without waiting for an analyst.
01 / Overview
The problem, and the approach.
AThe challenge
Self-service analytics fails in two ways: people cannot get the number without an analyst, or an AI tool hands them a confident number computed the wrong way. The second failure is worse, because nobody notices.
BThe approach
A semantic layer of nine governed metrics, each with one definition and an owner. A plain-English question is parsed into a metric, filters and a breakdown, compiled to SQL against a read-only warehouse, and returned with a chart, a one-line answer and the SQL itself. Anything outside the layer is declined. Claude can be switched on for parsing; the rule-based parser is the default, and both are measured on the same test sets.
02 / The decision journey
5 decisions, one story.
Each stage asks one business question and answers it with a model you can open and change. Any card opens that stage of the live demo.
-
01
Ask
What do you want to know?
Plain English in; governed SQL, a chart and a one-line answer out.
Open this stage
-
02
Define
What does each number mean, exactly?
Nine metrics with owners; snapshots and ratios handled once, in the layer.
Open this stage
-
03
Decline
What if it cannot answer?
Unknown metrics, unknown breakdowns and personal data are declined, never guessed.
Open this stage
-
04
Evaluate
How often is it right?
A test set and a held-out set; the first held-out run caught a silent failure.
Open this stage
-
05
Govern
What keeps it safe?
Read-only aggregates, compiled SQL, every answer logged and replayable.
Open this stage
03 / Under the hood
How it’s built.
Algorithms
- Semantic layer
- Rule-based intent parser
- SQL compiler
- Claude (optional)
- Evaluation set
Stack
- Python
- SQLite
- Semantic layer
- Rule-based parser
- Claude (optional)
- Streamlit
Methods, in order
- Semantic layer
- Intent parsing
- Compiled SQL
- Refusals
- Evaluation set
- Claude (optional)
Data
A synthetic subscriber warehouse: monthly subscriptions, care contacts and a month dimension.
04 / Outcomes
What it changed.
- 01
Every one of the 25 test questions mapped to the exact metric, filters and breakdown.
- 02
11 of 12 unseen phrasings right on the first held-out run; the miss exposed a silent failure, now fixed.
- 03
Unknown metrics, unknown breakdowns and customer-level requests declined, never guessed.
Results come from synthetic or public data with known answers. They show the method, not a client result.
05 / Try it
The live demo.
The real app, running on synthetic data. Change the inputs and watch the decision move.
Interactive, synthetic data. If nobody has used it for a while it takes about 30 seconds to wake.
Open in a new tab ↗Open conversations


