Screens: AI, MCP and security

AI Assistant

The AI Assistant panel is a chat where you ask the AI questions grounded in the database schemas you pick, and run the SQL it writes right there. Your questions go to the AI provider using an API key you registered. Check AI and MCP first to see what leaves your device.

Where you can use itWebDesktopWithout signing inSigned inLocal projectsAccount projects

Without signing in, you use it in local projects with a key in the API Keys on This Device group. Open and close the panel with the

Project railAI Assistant button on the right rail of the project screen. `Ctrl+I` (`Cmd+I` on macOS) also opens and closes it, including from inside the SQL editor.

What's on the screen

No.NameDescription
1AI model fieldThe API key this chat uses. Keys are listed as [provider] name, and the primary key carries a ★. The primary key is selected at first. The Add AI model button below the list opens the screen where you register keys.
2New chat buttonKeeps the current chat in the history and starts an empty one. You cannot click it while a response is coming in.
3Chat history buttonOpens the list of earlier chats in this project ('Chat history' below).
4Pin buttonWhen on, the panel floats above the work area instead of narrowing it. Move a floating panel by dragging the bar at the top, and resize it by dragging its edges.
5Tool activityWhat the AI checked in the database before answering. Click a line such as Check tables, Check table details, Check execution plan or Query data to expand its request and response.
6SQL cardOne SQL statement written by the AI. It shows a number, the statement kind and a title, with the Run, Open editor and Copy buttons.
7Execution result labelThe result of running the card's SQL. It shows the number of rows returned or affected; click it to expand the result table. The table shows up to the first 100 rows.
8Context tagsThe schemas the AI may see for this question. Hover to see the full connection, database, schema, and remove one with ×. A lock means it is the target of a task handed over from the editor or ERD, so it cannot be removed.
9Select Database Schema buttonOpens the window where you pick the context.
10Send buttonSends the message. While a response is coming in, it becomes the Stop generating button.
  • In the input box, Enter sends and Shift+Enter adds a line (the Enter to send · Shift+Enter for a new line hint). When the box is empty, ↑ and ↓ bring back messages you sent in this chat.
  • If you have no key registered, the empty chat shows the Add AI model button and the input box is disabled.

Getting SQL from plain language

  1. Click the Project railAI Assistant button or press Ctrl+I.
  2. Pick the key to use in the AI model field (1). Leave it as is if the primary key will do.
  3. Click the Select Database Schema button (9), pick the schemas for your question and click the Apply button ('Picking the context' below).
  4. Type what you want in the input box and press Enter. For example: "the 5 products with the most sales last month", "customers who have never written a review".
  5. The AI checks the tables it needs (5) and answers with an explanation and SQL cards (6).
  6. When the response ends, SELECT cards run right away and get a result (7). Cards that change data or the schema wait or run according to the conditions in the table below.
  • If you send without a context, the Select a database for AI context window appears. Click the Select database button to open the context window, pick one and send again.
  • You cannot change the key or the context while a response is coming in. To stop it, click the Stop generating button.
  • The earlier messages sent along to the AI are at most the 29 most recent messages of this chat. The AI does not see anything older.
  • The response language and common instructions added to every response are set on the My pageGeneral Settings screen described in Providers & API Keys.

Picking the context

The context is everything the AI may see for this question. The AI's tools do not access schemas you did not pick.

No.NameDescription
1Search fieldNarrows the list by connection or schema name (Search Connection or Schema).
2Select all and Clear all buttonsSelect or clear every visible schema.
3Connection, database, schema listThe checkbox of a connection or database selects everything under it at once.
4Apply buttonMoves your selection to the context tags of the input box. The Cancel button discards your changes.
  • The list only shows schemas selected in the connection settings of connections whose Enabled option is on in Project AI settings. Disabled connections and design-only connections without database access details are not listed. When there is nothing to pick, the No Schema is available. notice appears.
  • A new chat starts with the schema set by the Default option in Project AI settings already picked. If none is set, it starts empty.

Running SQL cards

When a response ends, NeoSQL goes through the cards from the top and runs those that meet the conditions below. Run the others yourself with the Run button.

StatementWhen the response endsWhen you click the Run button
SELECTRuns right awayRuns again
Data changes such as INSERT, UPDATE and DELETERuns if the connection's Data changes option is on; waits if it is off (the default)Runs when you click the Execute button in the confirmation window. The window's Show SQL button shows the full SQL
Schema changes such as CREATE, ALTER and DROPRuns if the Schema changes option is on; waits if it is off (the default)Runs when you click the Execute button in the confirmation window
Statements of unknown kindDoes not runDoes not run
  • The connection's Protection mode field comes before this table. With Read-only (block non-SELECT), statements other than SELECT do not run; with Confirm (DDL + risky DML), NeoSQL always asks before running, whatever the policy. In account projects, users restricted by DDL Restriction cannot run schema changes.
  • A card's SQL runs with auto-commit on the connection, database, schema written on the card. It is applied immediately regardless of the SQL editor tab's transaction, so it cannot be undone.
  • Execution results stay in the panel and are not sent to the AI provider. The executed SQL is kept in the SQL history and saved SQL as run by the AI.
  • The Open editor button creates and opens a new SQL document with the card's SQL on the same connection and schema. Use it to edit and run the SQL or to keep it.

Approving reads of real data

When the AI needs real row values to answer and the connection's Allow data transfer option is off, an approval card appears in the chat. This option is on for new connections, so at first the AI reads without a card.

No.NameDescription
1Query SQLThe single SELECT statement the AI wants to run. If you approve, its result goes to the AI provider.
2Auto-approve subsequent queries checkboxTurn it on and approve, and later queries are approved without a card while this project stays open. It is not saved, so reopening the project asks again.
3Approve and Reject buttonsRejecting stops the response. You can continue the chat by sending a new message.
  • A query the AI runs itself is a single read-only SELECT, up to 10 rows, with a 30-second limit.
  • In account projects, the Auto-approve subsequent queries checkbox is shown to the project owner, and to other members only when the Allow persistent data-transfer approval for project non-owners option in Project AI settings is on.

Opening HTML responses

When you ask for something to look at, such as a report or a chart, the AI may answer with an HTML document. The response shows the document title and the Open HTML button.

  1. Click the Open HTML button in the response. A Document tabHTML preview tab opens in the work area.
  2. Hover over the tab and buttons appear at the top right: the Open in browser button (1), the Download HTML button (2) and the Print button (3).
  • The preview is drawn in an isolated frame. The document's scripts run, but they cannot load external files or talk to the network.
  • The Open in browser button opens the document in the operating system's default HTML app on the desktop, and in a new browser tab on the web.
  • This tab is not saved. To keep it, download the file with the Download HTML button.

Designing tables in an ERD

When you clearly ask for the result in an ERD, as in "design tables in the ERD for managing order returns", the AI uses its ERD tools instead of writing SQL. The tool activity shows an Create ERD tables or Modify ERD tables line.

  • The result is saved in an ERD created for each chat, connection and schema, and that ERD opens. Asking again in the same chat adds to the same ERD.
  • The ERD tools do not change the database. Review the design and create it in the real database with Apply changes to the database.
  • If it is unclear whether you mean the ERD or the database, the AI asks.

Chat history

Click the Chat history button at the top of the panel and the panel switches to the list of earlier chats in this project. Each chat shows its title and the time of its last activity.

  • Double-click a chat or press Enter to open it.
  • Hold Ctrl (Cmd on macOS) while clicking to select several, or Shift to select a range.
  • Right-click for the Rename and Delete chat items. Deleting cannot be undone.
  • Chats are saved in your account (the NeoSQL server) for account projects, and on this device for local projects.

Things to keep in mind

  • SELECT cards run on the database as soon as the response ends. A SELECT that scans a large table runs as it is, so on production connections use the Protection mode field or connect with a narrowly privileged database account (Safeguards for production databases).
  • SQL run by the AI is auto-committed. If you turn on the Data changes and Schema changes options, change SQL is also applied right away without confirmation.
  • The Allow data transfer option is on for new connections. To confirm every time real row values go to the AI provider, turn it off in Project AI settings.
  • Do not type passwords, tokens or personal data into questions. Questions and earlier messages go to the AI provider as they are.
  • On the web, keys whose address is http, localhost or a private IP do not appear in the AI model field. Use those keys on the desktop only.