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.
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.
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.
Show all 6 reported metrics
Frequently asked questions
What did this team achieve with this AI workflow?
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 red…
What tools did this team use?
LLM, vector databases, similarity search, RAG, OpenAI GPT-4 Turbo, k-nearest neighbor search.
What results were reported?
query authoring time before QueryGPT: about 10 minutes; query authoring time with QueryGPT: about 3 minutes; monthly interactive queries at Uber: approximately 1.2 million; Operations organization share of queries: about 36% (source-reported, not independently verified).
What failed first in this deployment?
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 sch…
How is this back office ops AI workflow structured?
User submits natural language question → Intent Agent classifies domain → Table Agent selects tables → User reviews and approves tables → Column Prune Agent trims schemas → LLM generates SQL query → Output: SQL query and explanation → Evaluation feedback loop.