Case study 02 / Data & ML · Agents
Text-to-SQL → Sheet Chat
Business teams ask sales questions in plain language and get an answer in about 10 seconds instead of waiting 1–2 days for a manual report.
01Problem
Every new question about sales data became a request to the data team, and a manual report took 1–2 days. Decision-makers either waited or decided without the numbers, and analysts spent their time on one-off SQL.
02Solution & architecture
- Text-to-SQL: a question is mapped to the right schema context across 10 Oracle Autonomous DB tables, turned into SQL by an LLM, validated before it runs, and returned as a table with a plain-language explanation.
- Evaluation: a set of 100 real business questions with expected answers. The system writes correct SQL for 90% of them, and every change is measured against the same set.
- Sheet Chat: the same idea extended to any spreadsheet. It is a stateful LangGraph agent on DuckDB that plans the analysis, queries, draws charts and runs data-quality checks before answering.
03Demo
04Results
~10s
per answer, down from 1–2 days of manual reporting
90%
correct SQL on a 100-question business eval set
10tables
of Oracle Autonomous DB queryable in plain language
05What I'd improve next
- The last 10%: group the failing eval questions by cause (ambiguous wording, missing join, business-rule gaps) and fix each group with schema notes or few-shot examples.
- Grow the eval set: log real user questions and promote the hard ones into the evaluation set, so it keeps up with how people actually ask.
- Shared core: run the Oracle Text-to-SQL path through the same LangGraph planner as Sheet Chat, so both get charts and data-quality checks.
Enterprise project. The demo is a recording of the internal system, shared with George's approval; confidential details beyond what it shows are not published.