Uber QueryGPT: Natural Language to SQL Generation Using Generative AI
SQL query authoring at Uber requires both SQL expertise and deep knowledge of internal data models, consuming around 10 minutes per query across approximately 1.2 million monthly queries — a significant productivity bottleneck, especially for the Operations organization which accounts for about 36% of queries.
How it works
Common implementation structure
How this type of workflow is generally built, generalized across documented cases — not tied to any one vendor's stack. Click any stage to read what happens there. Specific products that implement these stages appear in “Tools commonly seen” below.
Stage 1 · User submits natural language question
A user provides an English question to QueryGPT to generate a SQL query.
QueryGPT reduces query authoring from about 10 minutes to about 3 minutes; in its limited release to Operations and Support teams it averages 300 daily active users, with about 78% reporting that generated queries reduced the time they would have spent writing from scratch.
What failed first
The initial RAG-based prototype of QueryGPT saw declining accuracy as more tables were onboarded; naive similarity search on schema samples failed to return relevant results for natural language prompts, and large schemas with 200+ columns exceeded the 32K token limit of the available model, breaking query generation.