A text-to-SQL system that turned plain-language questions into correct SQL on a database that off-the-shelf tools get wrong.
to a validated answer, from 2 to 3 days in the data team’s queue.
- 2 to 3 days to under 30 secondsto an answer, from the data team’s queue to self-serve
- About 92%of generated queries returned the right answer on the benchmark, up from roughly 60% for an off-the-shelf approach
- From about a dozen to 200+ peoplewho can query the data directly, from SQL-fluent analysts to business users
- Roughly 40%of the data team’s week returned to platform work (estimated with the team)
// The problem
Where time went
The company’s analytics database was fast for the same reasons it was hard to query: its own SQL dialect, approximate answers for very large counts, and no support for joins that standard SQL allows. Getting an answer meant writing SQL and knowing the schema and the dialect, so analysts and business users filed requests with a small data team and waited 2 to 3 days, while the engineers who should have been building the platform answered one-off questions. Off-the-shelf text-to-SQL returned confident wrong numbers with no error at all.
// The build
What we built with them
LevelUp Labs worked with the data team to build a text-to-SQL system that turns a plain-language question into a correct query on the company’s own database. It finds the right tables and columns for the question, plans the query, writes it in the database’s own dialect, checks it before it runs and corrects it when the database returns an error. Approximate results are shown as estimates. A correctness benchmark scores every change on whether the query returns the right answer, so the team knows when the system can be trusted.
// Where it stands
Business users now ask the database directly and get an answer in seconds, and the data team is back on platform work.
// How we measured
Execution accuracy on a domain set of questions with known answers, tracked with latency and cost; time to answer against the workflow baseline; the data team’s time estimated with them.
// Build with confidence