Skip to content
Bluejayders
System 02 · Data platform · Text-to-SQL

Uber QueryGPT

The best-documented enterprise agent pipeline in public. Uber published the full agent chain by name — Intent Agent, Table Agent, Column Prune Agent — plus the three failure modes that forced the redesign, the evaluation rubric, and the gateway layer every internal app uses to reach external models. It is also unusually honest about what didn't ship, which is why two boxes on the L2 diagram are greyed out.

4LLM calls per query
1human gate in the path
10 → 3 minauthoring time
~300daily active users
12system workspaces
16M/mogateway LLM queries
Numbers you will see quoted that Uber never published

“80% → 86.1% accuracy”, “$120M annual productivity gains”, “140,000 hours saved”, “40% of analyst time spent writing SQL.” None of these appear in any Uber source. Uber publishes no end-to-end accuracy percentage for QueryGPT at all — only an evaluation rubric (see below). The 86.1% figure in particular is a third-party blog artefact.

L1

System context

QueryGPT sits inside Uber's data platform, not its ML platform — a distinction most reconstructions miss. The QueryGPT post never mentions Michelangelo, the Prompt Engineering Toolkit, Langfx or the gateway. Those edges are drawn dashed.

uber — L1 system context
USERSQUERYGPT — DATA PLATFORM TEAMRETRIEVAL & METADATAUBER DATA PLATFORMMODELSSIBLING GENAI SYSTEMS (DIFFERENT TEAMS, SAME PLATFORM)drawn for contrast — Finch is the 2025 state of the art for NL→SQL at UberEngineers, ops managers, datascientists~300 daily active usersOperations org = ~36% of queries1.2M interactive queries/monthQuerybuilderUber's SQL editor / authoring UIQueryGPT figure 2 is literallycaptioned 'Querybuilder Usage'QueryGPTowned by the Data Platform teamNL → SQL · 4 LLM calls + 1 human gate10 min → ~3 min per queryWorkspaces12 system + user-created customcurated SQL samples + tablesper business domainVector databaseUber confirms one exists……but NEVER names it for QueryGPT(Sia and OpenSearch are other products)?“Our data dictionary”Uber's metadata product is Databookbut QueryGPT never names it— the link is inferred?QueryGPT query logsCONFIRMED use: curating theevaluation set with golden SQLNOT confirmed as a RAG index sourceGenAI GatewayGo service · OpenAI-compatible API30 teams · 16M queries/mo · 25 peak QPSpresence on THIS path is inferred?Data access proxiesfor Presto, Spark and Hiveabstract the physical compute clustersPresto~20 clusters, 10,000+ nodes~500k queries/day, ~100 PB from HDFSExeggutor → Prism → express/batchOpenAI GPT-4 Turbo (1106)128K token limitnamed directly in the QueryGPT postGenie — on-call copilotSlack · 154 channels70,000+ questions answered48.9% helpfulness rateEnhanced Agentic-RAGQuery Optimizer · Source Identifier· Post-Processor agentsLangfx + LangGraph on MichelangeloFinch (Jul 2025)FinTech team — separate productSupervisor → SQL Writer / Doc ReaderNL aliases for columns AND valuesMichelangelo~400 ML projects · 5k models in prod10M predictions/sec at peakModel Catalog · Prompt Toolkit · Langfxdomain scopingkNN similaritysearchschema lookupconversation logspromptOpenAI-shaped callsubmit generatedSQLMichelangeloGatewayGenAI Gateway
drag to pan · scroll to zoom · click any box
actorapp / surfaceagent / reasoningmodel callstore / indexexternal systemguardrail / trustplatform / gatewaypipeline / evalnot shippeddashed = inferred— api call— data— llm call— human loop— guardrail— escalation— external
Three teams, three products

QueryGPT is Data Platform. GenAI Gateway and Genie are Michelangelo / AI Platform. Finch is FinTech. Enhanced Agentic-RAG is Engineering Security & Privacy. They share infrastructure, not ownership.

The gateway naming trap

Uber has published five names for what is probably one evolving service: Uber Generative AI API Gateway (2023), GenAI Gateway (2024), Michelangelo Gateway (2024), Generative AI Gateway (2025), AI Gateway (2026). No post ever says they are the same thing.

Finch is the 2025 successor pattern

Its key delta over QueryGPT: it stores natural-language aliases for both SQL columns AND their values in an OpenSearch index — “a significant enhancement over traditional methods that rely solely on table schemas and a few sample rows.” Plus curated single-table data marts so the LLM writes simpler SQL.

L2

The agent pipeline — every hop, as published

Uber shipped v1 at a May 2023 hackathon, then went through 20+ algorithm iterations to reach this. Every named component below is verbatim from Uber's post. The two greyed boxes are components Uber explicitly describes as needed or planned — not shipped.

uber querygpt — L2 v2 agent pipeline
INPUTINTENT & DOMAIN ROUTINGSCOPED RAG RETRIEVALTABLE SELECTION + HUMAN GATECONTEXT COMPRESSIONGENERATION & OUTPUTPrompt Enhancer'a prompt enhancer WAS NEEDEDto massage the user question'NOT SHIPPED — Learnings sectionNatural-language prompt'Write a query to find the numberof trips completed by Teslasin Seattle yesterday'System Workspaces12 total: Mobility, Core Services,Platform Engineering, IT, Ads…each = curated SQL + tablesIntent AgentLLM CALL #1maps the prompt to ONE OR MOREbusiness domains / workspacesCustom Workspacesuser-created when no systemworkspace fits the requirementSQL sample corpus'guidance on HOW to use thetable schemas provided'v1 seed: 20 queriesSearch — kNN similarityvectorise question → nearest neighboursNOW SCOPED to the chosen workspacev1 fetched 3 tables + 7 samplesTable schema corpusCREATE TABLE DDLsome tables span 200+ columnsVector databaseconfirmed to exist, never named?Table AgentLLM CALL #2picks the right tables fromthe retrieved candidatesHuman ACK gate'Looks Good' button OR edit the listIN THE CRITICAL PATH — confirmedadded after user feedbackSchema fetchfull DDL for confirmed tables40–60K tokens each — this is whatbroke the 32K-context eraColumn Prune AgentLLM CALL #3emits 'a skinnier version ofeach schema' — cost, latency, tokensUber Business instructionsinternal lingo + date-handling rulesstatic prompt asset —NOT retrievedPrompt assemblypruned schemas + SQL samples+ question + business instructionsSQL generation LLMLLM CALL #4OpenAI GPT-4 Turbo (1106), 128KOutput: {SQL, Explanation}+ chat-style iteration mode(SHIPPED — past tense in the post)Validation Agent'looking to include' — recursivehallucination repairNOT SHIPPED as of Sep 2024Execution — Querybuilder /Prestoimplied by the 'Successful Run'evaluation metric only;never drawn in the post?user promptworkspace(s) →scoped candidatesetcandidate tables +samplesproposed tablelistconfirmed tablelistfull CREATE TABLEDDLpruned schemasretrieved SQLsamplesuser runs it
drag to pan · scroll to zoom · click any box
actorapp / surfaceagent / reasoningmodel callstore / indexexternal systemguardrail / trustplatform / gatewaypipeline / evalnot shippeddashed = inferred— api call— data— llm call— human loop— guardrail— escalation— external
Why v1 failed — Uber's own three headings

Better RAG: similarity search over CREATE TABLE DDL and SELECT statements “doesn't return relevant results” for a natural-language question — embedding-space mismatch. Understanding user's intent: “What we needed was an intermediate step, which classifies the user's prompt into an 'intent'.” Handling large schemas: tables spanning 200+ columns burned 40–60K tokens each; three of them broke the 32K-context models of the day.

The human gate is real

Most agent diagrams show a fully autonomous chain. Uber's has a mandatory ACK: the Table Agent's proposed list is rendered to the user, who clicks “Looks Good” or edits it. It was added because users saw wrong tables being picked.

Intent classification is multi-label

“maps the user's question to one or more business domains/workspaces.” Not a single-label router.

ComponentStatusUber's own words
Intent Agent, Table Agent, Column Prune AgentshippedAll three named and diagrammed in the current design
Chat-style iteration modeshippedintroduced a chat style mode where users can iterate on the generated query” — past tense
Validation / self-correction agentnot shipped“are also looking to include a 'Validation' agent… this remains an area that we haven't completely solved”
Prompt enhancer / expandernot shipped“A 'prompt enhancer'… was needed to 'massage' the user question” — stated as a need, in Learnings
Query execution inside QueryGPTinferredImplied by the “Successful Run” eval metric; never drawn in the product flow
L2b

How agents reach external systems — gateway & identity

This is the layer the question “how are agents connected to external systems” actually lives in. Top: the 2024 GenAI Gateway, the single egress point for every internal app. Bottom: the 2026 agent-identity architecture that replaced it for agentic workloads — note the clean split between AI Gateway (agent → model) and MCP Gateway (agent → Uber's own services).

uber — genai gateway (2024) and agent identity layer (2026)
GENAI GATEWAY — JUL 2024the 'how apps reach external models' layerAGENT IDENTITY & MCP — MAY 2026AI Gateway = agent→model egress · MCP Gateway = agent→Uber systemsInternal Uber appsPython, Java and Go clients~30 customer teams60+ distinct LLM use casesEng Security review gateuse cases reviewed against Uber'sdata handling standard BEFOREgateway access is grantedPII RedactorANONYMIZED_NAME_0 placeholdersun-redacts on the response pathpositional instability hurts cachingOpenAI-compatible HTTP/JSON'developers write code as if they'reusing the native OpenAI client'keeps LangChain/LlamaIndex compatGenAI Gateway — Go service16M queries/month · 25 peak QPSauthn/authz · metrics · rate limitload balance · hallucination detectionAudit log + cost attributionper-request UUID in a context header→ audit log → cost rollup by UUID(mechanism published in the Genie post)Vendor clientsforked github.com/sashabaranov/go-openaiopen-sourced uber/go-vertex-aiIn-house serving stackUber-hosted LLMs on MichelangeloModel Catalog: GPT-4, PaLM,Llama 2 on-premOpenAIGoogle Vertex AIResponse cacheNO Uber source puts cachingin the gateway — common mythThousands of internal agentsbuilt on Uber's Agent platform(shipped early 2025)Agent Registry'Michelangelo associates an AIagent to a workload'AI Agent Meshdata plane for agent-to-agentstandardized A2A protocol clientSTS — Security Token Servicedynamic trust broker: short-lived,scoped tokens for EVERY hopSPIRE/SVID · act_chain JWT · P99 <40msAI Gatewaymediates ALL outbound callsfrom agents to modelsMCP Gatewaymediates agent → Uber's own systemspolicy enforcement point forMCP tool invocationsAI Guardprompt injection · jailbreakscontent safety · PII redactionOpenAI / Anthropicexternal model APIsUber's microservicesthousands of services madeMCP-ready over existing APIsaccess grantedredacted promptin-house modelstool calls
drag to pan · scroll to zoom · click any box
actorapp / surfaceagent / reasoningmodel callstore / indexexternal systemguardrail / trustplatform / gatewaypipeline / evalnot shippeddashed = inferred— api call— data— llm call— human loop— guardrail— escalation— external
The pivotal design decision

“A pivotal design decision was to mirror the HTTP/JSON interface of the OpenAI API… developers write code as if they're using native OpenAI client, while being able to access LLMs from different vendors.” Rationale: a proprietary interface “would risk becoming quickly outdated” and would break LangChain/LlamaIndex compatibility.

Cost attribution, concretely

From the Genie post — the only place Uber explains the mechanism: “a UUID gets passed to Knowledge Service, which in turn passes the UUID through the context header to Michelangelo Gateway… so that it can be added to an audit log used to track costs by that UUID.”

2026: MCP over existing APIs

“Uber's microservices tech stack comprising thousands of services was made AI-ready by enabling MCP support over existing service APIs.” STS token exchange runs at P99 < 40 ms; the platform is adopted by thousands of internal agents.

L3

Critical path — question to executed SQL

Four LLM calls and one human gate, with the intermediate artefact at every hop.

uber querygpt — L3 request sequence
ARTIFACT / DETAILUserIntent AgentSearch + vector DBTable AgentColumn Prune AgentGPT-4 Turbo (1106)PrestoNL question1"Write a query to find the number of trips that werecompleted by Teslas in Seattle yesterday" — Uber's ownMobility example.LLM call #1 — classify intent2OUT: intent → [one or more workspaces], e.g.["Mobility"]. Multi-label. This is the step that"drastically narrows the search radius for RAG".scope retrieval to workspace3OUT: that workspace's curated SQL samples + tables becomethe candidate set. 12 system workspaces exist.vectorise + kNN similaritysearch4v1 fetched 3 tables and 7 SQL samples; v2 counts notrestated. Vector DB product never named.candidate tables + SQL samples5OUT: candidate_tables[], candidate_sql_samples[]LLM call #2 — pick the righttables6OUT: proposed_table_list[], e.g. [fact_trip_state,dim_city]render proposed table list7HUMAN GATE. User clicks "Looks Good" OR edits the list.This is in the critical path — confirmed, not optional.confirmed table list8OUT: confirmed_table_list[] → full CREATE TABLE schemasfetched (up to 200+ cols, 40–60K tokens each)LLM call #3 — prune irrelevantcolumns9OUT: pruned_schemas[] — "a skinnier version of eachschema". Cuts token cost AND latency.assembled prompt10pruned schemas + retrieved SQL samples + NL question +Uber Business instructions + system promptLLM call #4 — { SQL Query, Explanation }11Output structure unchanged from v1. User may iterate inchat-style mode.run the SQL12INFERRED. Uber measures "Successful Run" and "Run HasOutput" in evaluation, which implies execution — but theproduct flow never draws this edge.
drag to pan · scroll to zoom
actorapp / surfaceagent / reasoningmodel callstore / indexexternal systemguardrail / trustplatform / gatewaypipeline / evalnot shippeddashed = inferred— api call— data— llm call— human loop— guardrail— escalation— external
EVAL

The evaluation rubric Uber published instead of an accuracy number

SignalWhat it measures
IntentWas the workspace / business domain correctly inferred?
Table OverlapAre the tables identified via Search + Table Agent correct? Scored 0–1 — the worked example scores 0.5 when 1 of 2 required tables is found. Uber's own text calls this “Search Overlap Score” in the example — an internal inconsistency
Successful RunDoes the generated SQL execute without error?
Run Has OutputDoes it return rows? Catches the classic hallucination: WHERE status = "Finished" when the real value is "Completed"
Qualitative Query SimilarityLLM-scored 0–1 against the golden SQL
Two product flows in the harness

Vanilla — everything inferred end to end. Decoupled — intent and datasets are supplied, isolating pure SQL-generation quality.

Their noise floor, stated openly

“we do not over-index decisions based on ~5% run-to-run changes.” A rare and useful admission.

Sources — all first-party Uber engineering

  1. QueryGPT — Natural Language to SQL Using Generative AI (19 Sep 2024) the only first-party QueryGPT source that exists
  2. Navigating the LLM Landscape: Uber's Innovation with GenAI Gateway (11 Jul 2024)
  3. From Predictive to Generative — How Michelangelo Accelerates Uber's AI Journey (2 May 2024)
  4. Genie: Uber's Gen AI On-Call Copilot (10 Oct 2024) — Sia, Terrablob, Knowledge Service, the UUID cost-attribution mechanism
  5. Enhanced Agentic-RAG (29 May 2025) — Query Optimizer / Source Identifier / Post-Processor, Langfx, LangGraph
  6. Unlocking Financial Insights with Finch (17 Jul 2025)
  7. Solving the Identity Crisis for AI Agents (21 May 2026) — Agent Registry, AI Agent Mesh, STS, MCP Gateway, AI Guard
  8. Presto Express: Speeding up Query Processing with Minimal Resources (7 Nov 2024)
  9. Introducing the Prompt Engineering Toolkit (26 Nov 2024) — the live page renders empty; this archived copy works
  10. uReview: Scalable, Trustworthy GenAI for Code Review (12 Aug 2025)

Verified absent: there is no QueryGPT v2 post, no QueryGPT conference talk, no InfoQ article and no podcast. Domain-restricted sweeps of InfoQ, QCon, Data+AI Summit, Trino Summit and Presto Conference return nothing.