Skip to content

SQLDatabase

SQLDatabase prepares the connection to a database for other components to use, for example SQL Query Database Tool, with which an agent queries the database, or Natural Language to SQL, which turns a question into a SQL query. On its own it does not read or write data.

When to use it

  • You want an agent to answer questions by querying your database.
  • You want to turn questions into SQL queries over your database.

Configuration

The connection details are typed in the node itself.

FieldWhat it does
User (required)The database user.
Password (required)Its password.
Hostname (required)The server address.
PortThe server port.
DatabaseThe database name.
Table To UseOptional: the table to work with, if you know it.

Output

The SQLDatabase output is the connection, to plug into components that ask for a database. URI Database string is the connection address as text.

Example

A sales director wants to ask an agent “how much did we sell in September?”.

  1. Add SQLDatabase with the sales database details.
  2. Connect the SQLDatabase output to a SQL Query Database Tool.
  3. Connect the tool to an agent and ask the question in the chat.

Good practices

  • Use a database user with read-only permissions.