QueryGPT: Uber builds a natural language to SQL system using LLMs and multi-agent architecture
Authoring SQL queries at Uber required deep knowledge of SQL syntax and internal data models and took around 10 minutes per query, creating a productivity bottleneck across approximately 1.2 million interactive queries per month.
The initial version of QueryGPT used simple RAG over a small sample set and suffered declining accuracy as more tables were onboarded; simple similarity search between natural language prompts and SQL schemas returned irrelevant results, and large schemas exceeded the available LLM token limit.
QueryGPT reduced SQL query authoring time from around 10 minutes to about 3 minutes, reached about 300 daily active users in limited release, and 78% of users reported the 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 reduced SQL query authoring time from around 10 minutes to about 3 minutes, reached about 300 daily active users in limited release, and 78% of users reported the generated queries reduced the time they would…
What tools did this team use?
large language models, vector databases, RAG, OpenAI GPT-4 Turbo.
What results were reported?
Monthly interactive queries on data platform: approximately 1.2 million; Operations organization share of queries: 36%; manual SQL query authoring time: around 10 minutes; QueryGPT SQL generation time: about 3 minutes (source-reported, not independently verified).
What failed first in this deployment?
The initial version of QueryGPT used simple RAG over a small sample set and suffered declining accuracy as more tables were onboarded; simple similarity search between natural language prompts and SQL schemas returned…
How is this back office ops AI workflow structured?
User submits natural language prompt → Intent Agent classifies domain → Table Agent selects tables → User reviews and confirms tables → Column Prune Agent trims schemas → SQL query generated and returned → Evaluation and continuous improvement.