Skip to content

NL2SQL 0.9.0

Wave C of the redesign: a conversation led by the model that can ask, chart and draw, dashboards you build in chat or by hand and refresh with no model call, a launcher that takes you from a database to a working project, and MCP over HTTP with API keys. Saved results are now readable only by the caller who asked, so read Upgrading before you install it.

Released 2026-10-29.

Highlights

  • Conversations that use tools. engine.conversations keeps a conversation per user. The model reads the history and either replies or calls a tool (ask, a chart, a diagram, the dashboard tools), one call per step. It never writes SQL and never sees rows. A conversation report shows what happened on each turn.
  • Charts and diagrams. Every result gets an automatic chart chosen from its column kinds, and a Mermaid diagram can be drawn of an answer or of a schema.
  • Dashboards. Dashboards live in workspaces and are pinned whole. A refresh re-runs the stored plans with no model call, under the viewer's current access, and can run on a schedule. Filters are typed predicates added before the validator. generate builds a starter dashboard from the schema and glossary with no model call, and the conversation can build and edit dashboards too.
  • From a database to a project. nl2sql launch finds a database (a file, DATABASE_URL or a local port), tests the connection, and writes a project with every secret in .env and only ${env:...} references in YAML. nl2sql mcp --http serves the MCP tools over HTTP behind API keys, each request running as its key's user, tenant and roles.
  • Results belong to their asker. A run's saved rows can be read only by the caller who asked it, and a run a hook withheld is never readable.

What's included

Features

  • Shared models, config, error codes, events and state store interface version 4 for the wave (#354).
  • SuppliedPlan for a whole run, the answer= flag on run_query and stream_query, and the stubs the parallel tracks fill (#355).
  • Model-led conversations with ask, retry and ownership (#358).
  • Chat tools in the conversation loop, and the conversation report (#363).
  • Automatic charts from a result's column kinds (#357).
  • Mermaid diagrams of an answer and a schema (#366).
  • Scan a folder, a URL or local ports for datasources (#359).
  • Writers for a project and a datasource, with secrets written as environment references, and the Connect routes in nl2sql-api (#364).
  • nl2sql launch, from a database to a working project (#373).
  • API keys with hashed tokens, revoke and verify (#360).
  • MCP over HTTP with API keys (#367).
  • Workspaces, the dashboard store and manual edits (#361).
  • Token-free refresh, stored results and schedules for dashboards (#365).
  • Dashboard filters as predicates before the validator (#372).
  • A starter dashboard from the schema and glossary (#370).
  • Chat builds and edits dashboards (#371).

Fixes

  • A run that a hook withheld (HOOK_DENIED, NEEDS_APPROVAL, COST_LIMIT_EXCEEDED and the others) stays unreadable by its trace id; the result manifest is now written last (#362).
  • Results are readable only by the caller who asked (#369).
  • A plan that counts rows with COUNT(*) or selects t.* now runs instead of failing at the database; a star in any other position (for example COUNT(t.*) or SUM(*)) is refused at validation with a retry hint (#374).
  • A pipeline timeout fails the step, not the whole conversation turn (#376).
  • Schema retrieval keeps key and label columns, and falls back to the caller's whole visible schema when search fails (#377).

Docs

  • The Wave C design: model-led chat, dashboards pinned whole, workspaces, refresh (#352).
  • One Built-note slot per row in the Wave C design (#368).

Known limits

  • The web app and the REST routes for conversations and dashboards are Wave D. In this release you use them from Python, the CLI and MCP.
  • The REST API has no per-user identity yet, so its callers who share a tenant and roles share their results.
  • Dashboards are private to their owner. Sharing one across a tenant, and publishing, come later.
  • On schemas with more than 15 tables, retrieval picks tables by search and can miss the one a question needs. In the smoke test it missed payment, so the planner asked which revenue proxy to use rather than summing payments. A glossary term (for example, revenue = SUM(payment.amount)) avoids it. Better table recall is planned.

Pre-release check

An end-to-end smoke test against the Pagila database (29 tables, Postgres, on the GCP test bed) with a real model.

  • Run 1 found three bugs, all fixed before release. Retrieval dropped key columns (#377). A pipeline timeout was reported as a cancelled turn (#376). A retrieval failure left the planner with an empty schema (#377).
  • Run 2, on main at 04e3c275.
  • nl2sql launch built a working project.
  • Chat answered the first two turns (rentals per month; top 5 categories by rental revenue). On the third ("for just the top category, which 5 films brought in the most revenue?") it asked a clarifying question instead of answering; see Known limits.
  • A dashboard built from chat refreshed and reopened with zero model calls.
  • MCP over HTTP refused a request without an API key (401) and answered with a key.
  • The run took about 3 minutes and $0.89 of model spend.

Upgrading

pip install --upgrade "nl2sql-engine[demo]==0.9.0"

Third-party store authors: pip install "nl2sql-sdk==0.9.0".

Breaking changes: several. Each needs a look before you upgrade.

  • engine.results.manifest, page, csv and chart require user_context= (#369), and the REST results routes check the caller. Any other caller gets ResultNotFound. Runs saved before 0.9 have no recorded asker and are refused. What to do: pass the asker's UserContext, and re-run a question whose old result you still need.
  • Result manifests gain column_kinds and an owner (#357, #369). What to do: code that reads a manifest should accept the new fields.
  • SuppliedPlan is now a whole run (#355): a decomposition plus plans, or a verified query with its datasource. The old fields are gone, with no alias. What to do: use SuppliedPlan.for_sub_query(sub_query, plan) for the one-sub-query case.
  • chart() no longer takes tenant_id (#369). It takes the caller's user_context instead.
  • State store interface version 4 (#354). A 0.8 file is migrated in place by migration 6. What to do: third-party state stores add the conversation, workspace, dashboard and API key methods and set interface_version = 4.
  • The playground's results routes take ?role=, the role of the run being read (#369).
  • The MCP ask tool's choice is now an option id sent with conversation_id, replacing {request, option_id} (#367). What to do: update MCP clients that answer a clarification.
  • A new conversation agent (#358). What to do: a config that pins every agent's model should add it. A small model is enough.
  • MCP's build_server(engine, identity) gains a keyword-only over_http=False (#367). The positional arguments are unchanged; with over_http=True the server is set up for streamable_http_app(), and its identity callable is asked on every request. What to do: nothing for stdio; HTTP embedders pass over_http=True and wrap the server with nl2sql.mcp.http.build_app.
  • init_project now writes through write_project (#364). It writes the same files. What to do: nothing, unless you patched or replaced the file writing inside init_project.
  • POST /api/v1/datasource answers a bad body with 422, not a 500 (#364).

What's next

Next: Wave D, the apps.

Full changelog: v0.8.0...v0.9.0