Skip to content

ExeSQL

The ExeSQL component connects to a relational database and executes SQL queries. It is the core component used by Database Agents to translate natural language into SQL and return structured results.

Use ExeSQL when your agent needs to:

  • Query a MySQL, PostgreSQL, or MariaDB database in response to user questions
  • Execute generated SQL and return results as a formatted table
  • Auto-repair failed SQL queries through a configurable retry loop
ParameterTypeDefaultDescription
Database Typestring__Database type: mysql, postgresql, mariadb, MsSQL, BigQuery, Snowflake, SQLite
Hoststring__Database server hostname or IP address.
Portnumber__Database server port.
Databasestring__Name of the database to connect to.
Usernamestring__Database login username.
Passwordstring__Database login password.
Loopnumber3Maximum number of retry attempts if a query fails.
Top Nnumber30Maximum number of rows to return.
ModelstringThe language model used for SQL regeneration or auto-repair.
Temperaturenumber0.1Controls randomness in SQL regeneration.
  1. Add the ExeSQL component to your canvas.

  2. Connect a Generate component (or Retrieval + Generate) upstream to produce the SQL query.

  3. Fill in the database connection details (host, port, database name, username, password).

  4. Set loop to the number of auto-repair attempts allowed on query failure.

  5. Connect the ExeSQL output to a downstream Generate component to format the results as a human-readable response.