Ask your data

Go on. I want the whole story.
Ask a question in plain language. Lily finds the tables that answer it, writes the SQL, runs it and explains the result. You always see the query.
Opening Ask
On a SQL connection:
- the Ask Lily pill in the tab bar;
- Ask in the query editor toolbar, or ⇧ ⌘ A while a query tab is open;
- AI › Ask your data… in the editor.
How it answers
- Reading the schema. Lily keeps a catalog of the schema on your Mac and prepares it in the background.
- Finding the relevant tables. The AI tool browses that catalog and has to read a table's columns before it can use it.
- Writing the query.
- Running the query. Only reads run (see below), within your row cap.
- Summarizing the answer. The AI gets the question, the SQL and up to 40 rows.
The answer shows a preview of the rows, the SQL, Copy, Open in editor and Move to another engine…. If the query fails because of a wrong name or a syntax error, Lily asks the AI to fix it once and tries again.
Ask remembers the conversation while the connection is open, so you can follow up (and last month?). The Clear button starts over.
Read-only, always
Ask only runs reads, even on a writable connection. Lily checks the generated SQL and refuses writes, including writes hidden inside a WITH, EXPLAIN ANALYZE and SELECT … INTO. To run a write the AI suggested, open it in the editor, where the normal guardrails apply.
Rows and sensitive data
Rows in the answer step pass through the sensitive-data mask when Lily has scanned that schema (which happens when you open Understand). Masked values reach the AI as ‹redacted›. Run Understand once on schemas with personal data before using Ask on them.
Across several databases
With two or more SQL connections open, a sparkles button appears in the connection bar: Ask across your databases. Ask one question without picking a connection.
- Lily scores each open database by what it is about (from Understand, table names and the connection name) and asks up to three of them. A database that was never analyzed is not ruled out.
- Each one answers with its own read-only Ask, one after another.
- One final request combines their answers, using the answer text only, never the rows.
The footer names which connections answered, failed or were judged unrelated.
MongoDB and DynamoDB
Their workspaces have their own Ask: the AI writes an aggregation pipeline for MongoDB or a PartiQL SELECT for DynamoDB, from field names and types sampled from the collection. Only reads run. The answer step sends up to 20 documents or items as they are, without masking. See What the AI sees.