We do not generate SQL · the agent does · the pipeline is versioned

Text to SQL, and then what?

The text-to-SQL agent: from a question to a pipeline your team can rerun

We do not generate SQL. Your agent does that, and it is already good at it. What it usually lacks is everything on either side of the query: the real schema going in, and somewhere durable for the answer to live coming out. That is what this server is.

The gap a text-to-SQL tool leaves

A natural-language-to-SQL layer answers a question once, in one session, against one database. Three days later the question comes back, and nothing about the first answer helps.

  • The schema was a guess. Without introspection the model infers columns from names, and a plausible query over a wrong column returns a plausible wrong number.
  • The answer was a message. It is in a chat log. It is not versioned, not reviewable, and not runnable by anyone else.
  • The failure was a stack trace. When the query breaks, the agent gets a driver exception to guess at rather than a code to branch on.
  • One database at a time. Real questions cross two — the facts here, the lookup there.

What the agent gets here

Real schemas, a versioned artefact, readable failures, history

Your actual schema, before the query

datasources_get_schemas, datasources_get_tables, datasources_get_columns and datasources_preview_rows — the agent looks at the columns and a few real values first, so its SQL is grounded rather than inferred.

The answer becomes an artefact

The query is saved as a template, referenced by a pipeline in declarative JSON. It has a name, parameters, and a diff. Somebody else can run it without asking the agent again.

And a version history

Editing a released pipeline copies it to a draft; the release keeps running until a person releases the new one. Last quarter's number is reproducible because last quarter's SQL still exists.

Failures the agent can act on

Catalogued {domain}.{entity}.{failure} codes with details — a missing parameter, an unreachable datasource, a refused write — instead of a driver message to parse.

The rows themselves

executions_get_result pages the real result through a cursor, so the agent checks its own answer against the data rather than declaring victory.

A prompt for the debugging loop

The server ships a debug_failed_execution prompt that walks a failed run to a diagnosis — the failure path, treated as a first-class part of the agent's job.

And the question that crosses two databases

The question that stops a single-database text-to-SQL tool dead — "revenue by borough", where the trips are in Postgres and the zone lookup is in SQLite — is an ordinary pipeline here. Each source is read in place, staged into an in-memory database created for that one execution, and joined there. The worked example, with its SQL.

Being straight about it

  • No natural-language box. There is no "ask a question" UI. Your agent is the interface, over MCP.
  • No model shipped or called. The quality of the SQL is your agent's; the quality of what happens to it is ours.
  • No accuracy claim. We do not benchmark on Spider or BIRD, because we are not the thing being benchmarked.

What an AI data pipeline is here → · Connect your agent →

Asked before

Text-to-SQL questions, answered plainly

Does datapipelines generate the SQL?

No — your agent does that, and the page says so in its first sentence. What the server adds is everything on either side: the real schema going in, and a versioned, reviewable artefact coming out. The grounding tools are docs/mcp-server.md §6.1.

What happens to the query after it answers once?

It becomes an artefact: the SQL is saved as a template referenced by a pipeline in declarative JSON — named, parameterised, diffable — so anyone can rerun it without asking the agent again. The pipeline shape is docs/pipeline-contract.md §3.1.

What does the agent get when a query fails?

A catalogued {domain}.{entity}.{failure} code with details — a missing parameter, an unreachable datasource, a refused write — instead of a driver message to parse, so the agent can branch on the code. The error-code catalog is docs/pipeline-contract.md §13.

Can it join two databases in one question?

Yes — each source is read in place and staged into an in-memory database created for that one execution, and the join runs there as ordinary SQL. That is the staging join, and the worked example runs it on real NYC data. Staging is docs/staging.md §1.

Ask the question that keeps coming back

The one you answered three times this month is the right pilot. On the demo stack, the answer becomes a pipeline with a version number — and the fourth time, nobody asks you.