back_office_ops · logistics · workflow

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.
Tools used
LLMvector databasessimilarity searchRAGOpenAI GPT-4 Turbok-nearest neighbor search
Outcome

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.

Results
Time savedabout 10 minutes
Volumeapproximately 1.2 million
Running sinceMay 2023
Source

https://www.uber.com/en-IN/blog/query-gpt/

How we source this →

Grounding & classification
Source type: technical build writeup
34 fields verified against source quotes.
code generationmulti agent workflowragknowledge basebuilder submittedfailure mode describedhuman review describedmetric backednamed customerproduction runtime claimedtools describedworkflow describedlogisticssoftwareemployee productivitytime savedtechnical build writeupback office opsdata entry opsagentic task executionai draft human approvalrag answering