The Business Insights AI Agent using CDGC Metadata Discovery recipe includes Databricks and Snowflakes Python tools by default to execute your SQL queries. If you want to use a different database, you can configure a new tool and integrate it into the agent flow.
Configure the Databricks Python Tool
1Open the Databricks_Execute_SQL_Statement tool connection.
2On the Code tab, enter the following property values in double quotes:
- DATABRICKS_INSTANCE. A unique URL or instance name for your workspace.
- WAREHOUSE_ID. The identifier for an SQL warehouse compute resource within that workspace.
3Save the connection.
Configure the Snowflake Python Tool
1Open the Snowflake_Execute_SQL_Statement tool connection.
2On the Code tab, enter the following property values in double quotes:
- account_identifier. A unique name for your Snowflake account.
- user. Your logged-in user name.
- public_key_fingerprint. A unique string representing a public key used for secure, passwordless authentication.
3Save the connection.
Add support for other databases
1Create a Python tool connection named <Database>_Execute_SQL_Statement, where <Database> is the name of the target system you want to connect to. For example, SQLServer.
2Add the following description:
Tool that executes SQL statement in <Database> and retrieves the response. Input parameters include the SQL statement, schema, and database.
3On the Input Parameters tab, add the following parameters of type string:
- statement
- database
- schema
4On the Output Parameters tab, add a parameter named results.
5Implement the code to execute the provided SQL query using the API specific to the database system you want to connect to. Ensure that the tool runs the SQL statement and returns the query results correctly.
6Save the connection.
7Connect your new database tool to the SQLGenerationAgent within the AI Agent for Business Insights flow as shown in the following image:
For more information, see Python Code tool in the AI Agent Engineering guide.
This integration lets the agent use your custom tool to execute SQL queries against the new database.