Skip to content

AI chat

Note

This feature is available in Lite, Enterprise, Ultimate and Team editions only.

To use the AI Chat:

  1. Activate the AI assistant.
  2. Click on the AI Chat icon located in the DBeaver toolbar.

    • Alternatively, open the SQL Editor and click on the AI smart completion icon located in the left toolbar of the SQL Editor.

    Note

    The toolbar is customizable. For further information, refer to Toolbar Customization article.

  3. In the chat window that opens, input your request in natural language.

  4. Press the Send button to get the SQL translation, then choose one of the following options:

    • Execute to run the generated SQL query
    • Editor to open the query in the SQL Editor and continue working with it directly
    • Copy to copy the query to your clipboard and paste it wherever you need

AI Chat configuration

Connection field

To use a specific connection in AI Chat, select the connection from the toolbar at the top of the chat panel. The selected connection defines which database the AI will use when generating SQL queries.

Multiple conversations

You can create multiple chats for different connections.

Info

The first chat is created automatically when you open AI Chat. Each chat is named based on your first prompt.

Action Button/icon How to do it
Add a new chat Click the button to start a new conversation
Switch chats (Dropdown menu) Use the dropdown menu to switch between existing chats
Delete a chat Select the chat from the dropdown, then click the delete button

Resetting query context

The AI Chat logs your query history, enabling you to reference and expand on prior inputs. Each new or edited entry prompts the AI to generate a revised SQL query. To start a new conversation or to change the query context in the AI Chat, use the reset button in one of two ways:

  • To clear the entire history, click the reset button in the AI Chat toolbar
  • To clear a portion of the history up to a chosen message, click the reset button next to that message

Defining the scope

To improve accuracy, especially in databases with large schemas, you can use the Scope field to limit the context to specific database objects.

  1. In the AI Chat toolbar, click the Change scope button to open the context menu.
  2. Specify the area of your database that the AI should concentrate on. You can choose from:

    • Current Schema: Focuses the AI on the schema you are currently using
    • Current Database: Limits the AI to the database currently selected
    • Connection: Sets the AI to consider all schemas within the current database connection
    • Custom: Allows you to define a more specific scope, such as a particular table or schema