AI Assistant
Ask an AI about your schema and your plan — without sending it your data
Generate SQL from a description, explain a statement, or explain an execution plan, with real IRIS depth — bring your own API key, and nothing ever goes to Data Prudentia.
Unique to SQL DATA LENS
- Generate SQL, explain a statement, explain a plan
- IRIS depth: maps, bitmap indexes, TuneTable
- Bring your own key — Anthropic, OpenAI, Azure OpenAI, custom
- Off by default, opt-in per connection
- Literal masking, and a preview of the exact text before it is sent
A general-purpose AI model can read a SELECT statement and tell
you what it does. It cannot tell you why the optimizer chose a master map
scan over a bitmap index, or whether the table's TuneTable
statistics are stale enough to make the whole plan suspect — because that is
IRIS knowledge, not SQL knowledge. The AI Assistant, new in 4.02,
adds that domain knowledge to the model you already trust, and does it
without asking you to send your data anywhere to get the answer.
Three actions, in their own menu
An AI menu sits in the menu bar between Tools and Window, with three entries. All three act on the active SQL editor — open or click into the editor you mean before choosing one; there is no toolbar button and no grid context-menu entry for them in this release.
- Generate SQL from description… turns a plain-language description, plus the current schema context, into a SQL suggestion inserted into the editor as a marked block at the cursor. It is never executed automatically — you review it and run it yourself, the same two-step path as any other statement you write.
- Explain statement explains the statement at the cursor: what it reads, which indexes could serve it, and where it might be slow.
- Explain execution plan explains an actual
execution plan in plain
language — on IRIS and Caché, specifically calling out master-map scans,
temporary files, bitmap versus standard index use, and whether the
table's
TuneTablestatistics look current enough to trust the plan the optimizer chose.
On InterSystems IRIS or Caché all three carry that extra depth — maps, the
Master Map, bitmap versus standard indexes, TuneTable state —
on top of what a general-purpose model already knows about SQL, so an
explanation talks about your database engine, not SQL in the
abstract. On a non-IRIS connection the same three actions work with
whatever the schema metadata offers, without that extra depth.
What is sent, and what never is
This is the part to understand before turning the AI Assistant on for a connection, not an afterthought at the end of the page.
Never sent, under any setting:
- Row data, table contents, global contents, or any sampled column values.
- Credentials or connection details — password, JDBC URL, host name, user name, connection name. The provider only ever learns that the connection is, generically, "an InterSystems IRIS database" or the equivalent product name.
- Your license or configuration data.
Sent only after you opt in, per connection, off by default:
| Content | Sent when |
|---|---|
| Schema metadata (table/column/index names, types) | Opt-in on, per connection |
| The statement text | Opt-in on; SQL literal values replaced with ? first, by default |
| The execution plan text | Same as the statement text |
| What you typed for Generate SQL from description… | Always — it is what you deliberately typed, and the send preview shows it back to you regardless |
Literal masking is on by default: a value like
WHERE last_name = 'Müller' is rewritten to
WHERE last_name = ? before anything is sent, because the
literal itself is exactly the row-level data the rule above keeps out. You
can switch this off per connection if you need the AI to see literal
values — working with test data you are comfortable sharing, for
instance — and the send preview, below, always shows the exact text that
goes out, masked or not.
Nothing is sent to Data Prudentia. This feature is bring-your-own-API-key: you configure a provider and it talks directly, over your own network connection, to the provider you chose. Data Prudentia is never in that path and never sees the prompt, the schema, or the answer.
Bring your own provider
Configure at least one provider under
Tools > Settings… > AI Assistant. Four provider types are
offered: ANTHROPIC, OPENAI,
AZURE_OPENAI, and CUSTOM — any other
OpenAI-compatible endpoint, self-hosted or otherwise. The base URL is
optional for Anthropic and OpenAI, which default to the vendor's own
endpoint, and mandatory for Azure OpenAI and a custom endpoint, since
neither has one to fall back on. Exactly one provider is active at a time;
that is the one the three actions use.
The key is stored the same way a connection password is — Windows DPAPI — never in plain text, never exported with a connection file, and never written to the log; the log only records that a key was set.
Your own endpoint. Point a CUSTOM or
AZURE_OPENAI provider's base URL at a self-hosted,
OpenAI-compatible endpoint — Ollama, vLLM, LM Studio, or an Azure OpenAI
deployment in your own tenant — instead of a public cloud API. For an
organisation where even schema names must not leave the building, this is
the intended path: the prompt never leaves your network, and nothing else
about the feature's behaviour changes.
Turned on per connection, not globally
Sending anything beyond your own typed text needs an explicit opt-in on the connection itself — a global on/off switch does not exist, deliberately: a connection to a scratch database and a connection to a patient database sitting side by side in the same Server Navigator need to be trusted independently. Open the connection's Properties… dialogue and switch to the AI tab:
- Allow sending schema metadata and statement text to the configured AI provider — off by default, including after an update and for an imported connection profile.
- Include SQL literal values — off by default, and only selectable once the first checkbox is on.
A connection marked Production shows a note on this tab reminding you of that before you decide — it does not block the opt-in; the choice, informed, stays yours. See environments and read-only.
Without the opt-in, the three actions are not hidden: running one writes an explanation into the result panel instead of silently doing nothing. You still open the tab yourself; the message names the way, it is not a button. The neighbouring case — no provider configured at all — does offer an Open AI Settings… button that takes you straight to the settings page.
The send preview
The first time you use any of the three actions on a connection in a session, a dialogue titled AI Assistant - review what will be sent shows the complete text about to be sent — system instructions, schema/statement/plan context, your request — with OK/Cancel. It is remembered for the rest of the session only: restart SQL DATA LENS and the next request on that connection asks again.
After a request has gone out, the same text is reachable any time from the Show What Was Sent… button on the result panel. Tick Always show the "what will be sent" preview before sending on the AI Assistant settings page to see it before every single request, not just the first per connection — off by default, and useful in regulated environments where a per-request check is part of the process. The preview is not a description of what gets sent; it is the exact string, so a masking mistake or an unexpected piece of context is visible before it goes anywhere.
What you are paying for
Not model usage — that runs on your own API key, billed by the provider you chose, and SQL DATA LENS never sees or marks up that cost. What you pay for is the integration: the schema and plan context builder, the IRIS domain knowledge built into the prompt, the literal masking, and the key storage. Saying that plainly costs us nothing to admit and should earn more trust than pretending otherwise would.
Editions and the trial
The AI Assistant ships in the Named User, Team and Enterprise editions, and in the 30-day trial included with every download — it is not part of the Free Edition. Running one of the three actions there shows a message naming the edition you need rather than hiding the menu entries, the same way the rest of the paid-only surface behaves. See pricing for what each edition includes, or write to sales@sqldatalens.com with questions a trial cannot answer.
Questions before you turn it on
What exactly gets sent to the AI provider, and what never does?
Row data, table or global contents, sampled column values, your license data, and every credential and connection detail — password, JDBC URL, host name, user name, connection name — are never sent, under any setting. The provider only ever learns that the connection is, generically, "an InterSystems IRIS database" or the equivalent product name.
Schema metadata (table, column and index names and types) and the statement or plan text are sent only after you switch on the per-connection opt-in, and SQL literal values inside that text are replaced with ? first, by default. What you type into Generate SQL from description… is always sent — it is the text you deliberately typed, and the send preview always shows it back to you before it goes anywhere.
Does any of this reach Data Prudentia?
No. This is bring-your-own-API-key: you configure a provider under Tools > Settings… > AI Assistant, and the request goes straight from your machine to that provider — Anthropic, OpenAI, Azure OpenAI, or a self-hosted endpoint you point it at. Data Prudentia is never in that path and never sees the prompt, the schema, or the answer. The key itself is stored the same way a connection password is, with Windows DPAPI — never in plain text, never exported with a connection file, never written to the log.
Which providers can I use, and can I keep everything on my own network?
Four provider types: ANTHROPIC, OPENAI, AZURE_OPENAI, and CUSTOM for any other OpenAI-compatible endpoint. The base URL is optional for Anthropic and OpenAI, which default to the vendor's own endpoint, and mandatory for Azure OpenAI and a custom endpoint. Point a CUSTOM or AZURE_OPENAI provider at a self-hosted, OpenAI-compatible endpoint — Ollama, vLLM, LM Studio, or an Azure OpenAI deployment in your own tenant — and the prompt never leaves your network at all. For an organisation where even schema names must not leave the building, that is the intended path, and nothing else about the feature changes.
Why is there no single on/off switch for the whole application?
Because a connection to a scratch database and a connection to a patient database can sit side by side in the same Server Navigator, and they need to be trusted independently. The opt-in lives on the connection itself, under Server > Properties… > AI, off by default — including after an update and for an imported connection profile. A connection marked Production shows a note on that tab before you decide; it does not block the opt-in, the informed choice stays yours.
Does the Free Edition or the trial include the AI Assistant?
The trial does — every download starts as a full Pro trial, 30 days, with the whole feature available to try before you decide. The Free Edition does not: the three actions stay visible in the AI menu rather than being hidden, and running one shows a message naming the edition you need. See pricing for what each edition includes.
Next step
The part worth trying first is the send preview itself — turn the opt-in on for a test connection, run Explain execution plan on a slow query, and read the exact text before you click OK. Download SQL DATA LENS and see what it says about a plan you already know the answer to.
Explore your IRIS data from SQL down to globals
Download, unzip, connect. Your first namespace is on screen in about three minutes.
Windows 10, 11 and Windows Server (64-bit) · ~130 MB · version 4.02 · full 30-day Pro trial included