Back office ops · Production

LinkedIn SQL Bot: practical text-to-SQL for self-service data analytics at scale

The problem

Data experts at LinkedIn spent a significant amount of their time helping colleagues find data, creating a bottleneck that frustrated data teams and delayed crucial insights for business partners.

Workflow diagram · grounded in source
1
User submits natural language question
trigger
“SQL Bot, an AI-powered assistant integrated within our DARWIN data science platform. This internal tool transforms natural language questions into SQL”
2
Intent classification
ai_action
“We now use intent classification to classify the question and decide how to respond”
3
Semantic table retrieval
ai_action
“We use Embedding-Based Retrieval (EBR) to retrieve context semantically relevant to the user's question”
4
LLM re-ranking of tables and fields
ai_action
“we employ a LLM re-ranker to select the top 7 tables for query writing”
5
Iterative query writing
ai_action
“our query writing process is iterative, so that SQL Bot generates a plan and solves each step of the plan incrementally to build to the final query”
6
Validation and self-correction
validation
“We verify the existence of tables and fields, and execute the EXPLAIN statement on the query to detect syntax and other errors. These errors are fed into a self-correction agent, which is equipped with tools to retrieve additional tables…”
7
SQL query delivered
output
“enables employees across functions to independently access the data insights they need under the appropriate permissions”
Reported outcome

SQL Bot is now utilized by hundreds of employees across LinkedIn's business verticals; in a recent survey ~95% rated query accuracy as 'Passes' or above, and adoption increased 5-10x after integration into DARWIN.

Reported metrics
Adoption increase vs standalone prototype5-10x
query accuracy rated Passes or above~95%
query accuracy rated Very Good or Excellent~40%
Fix with AI session share80%
Show all 6 reported metrics
adoption increase vs standalone prototype5-10x
query accuracy rated Passes or above~95%
query accuracy rated Very Good or Excellent~40%
Fix with AI session share80%
LLM-as-judge agreement within 1 point of human score75%
employee user basehundreds of employees
Reported stack
SQL BotDARWINLangChainLangGraphDataHub
Source
https://www.linkedin.com/blog/engineering/ai/practical-text-to-sql-for-data-analytics
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

SQL Bot is now utilized by hundreds of employees across LinkedIn's business verticals; in a recent survey ~95% rated query accuracy as 'Passes' or above, and adoption increased 5-10x after integration into DARWIN.

What tools did this team use?

SQL Bot, DARWIN, LangChain, LangGraph, DataHub.

What results were reported?

Adoption increase vs standalone prototype: 5-10x; query accuracy rated Passes or above: ~95%; query accuracy rated Very Good or Excellent: ~40%; Fix with AI session share: 80% (source-reported, not independently verified).

How is this back office ops AI workflow structured?

User submits natural language question → Intent classification → Semantic table retrieval → LLM re-ranking of tables and fields → Iterative query writing → Validation and self-correction → SQL query delivered.