Agents Lookup

Use cases / Data & analytics

In-house text-to-SQL assistant for analysts

Build an internal assistant that finds the right tables from metadata, writes SQL and explains it, as Pinterest, Uber and LinkedIn did.

DifficultyAdvanced
Setup timeSeveral weeks
CategoryData & analytics

The use case

Large companies have thousands of tables, and the hard part of text-to-SQL is picking the right ones. Pinterest, Uber (QueryGPT) and LinkedIn (SQL Bot) each published how they built internal assistants: retrieve candidate tables using metadata and past queries, prune columns, have the model write SQL, then validate and fix it. They report that table descriptions and domain grouping mattered as much as the model. Analysts still read the SQL, check it against known numbers, and use the assistant to draft queries rather than as an oracle.

Example workflow

  1. Collect table metadata, descriptions and popular queries
  2. Retrieve candidate tables for each question
  3. Generate SQL and run validation
  4. Show SQL with an explanation to the user
  5. Log feedback to improve metadata

Tools

Risks and guardrails

Sources

Written by Agents Lookup. Credits and official pages for the tools this use case names: