New: AI & text-to-SQL on your own SupersetBook a demo
Docs
AI & text-to-SQL

AI & text-to-SQL

How D23 uses AI to turn plain-English questions into SQL queries against your data.

D23 ships AI text-to-SQL so anyone on your team can query data without knowing SQL. You ask a question; D23 generates, runs, and explains the query.

How it works

  1. You type a question in SQL Lab or the AI query panel — for example, "What were our top 10 products by revenue last quarter?"
  2. D23 sends context to the AI — your table schema, column names and types, and sample values — so the model understands your data model.
  3. The model generates SQL targeted at your connected database dialect (Snowflake, BigQuery, Postgres, etc.).
  4. D23 runs the query against your database and returns results. You see the SQL and can edit it before running.

Supported AI models

D23 supports multiple AI providers for text-to-SQL:

  • Claude (Anthropic) — strong reasoning, excellent at complex multi-join queries.
  • GPT-4o (OpenAI) — fast, broadly capable.

You choose which model powers your workspace. Your queries and schema are sent to the model only to fulfil the request and are not used for training.

What AI can query

AI text-to-SQL works against any connected database. It respects:

  • Row-level security — generated queries inherit your RLS filters, so users only see their data.
  • Cached results — frequently asked questions hit Superset's query cache for instant responses.
  • Schema introspection — D23 keeps an up-to-date index of your tables and columns so the AI always has fresh context.

Limits and accuracy

AI text-to-SQL is a productivity tool, not a replacement for human review. Complex business logic, ambiguous column names, and very large schemas can produce incorrect SQL. Always review generated queries before acting on results.

Next: Governance.