Relational DB

Overview

The Relational DB Tool allows Dataworkz Agents to connect to relational databases and run SQL queries. This tool is designed for advanced use cases where queries involve sub-queries, joins, or constructs not supported by the Dataset tool. For simple data access needs, the Dataset tool may be more appropriate.

When to Use

Use the Relational DB Tool when you need:

  • Direct access to data stored in relational databases such as MySQL, PostgreSQL, or Oracle.

  • The ability to run complex SQL queries, including sub-queries and advanced constructs.

  • More control over query definition than the Dataset tool provides.

Prerequisites

  • A database connection (storage) must be configured in the Data Studio.

  • Supported databases include MySQL, PostgreSQL, Oracle, and other relational systems.

Set up

Creating a Relational DB Tool

To create a Relational DB Tool, go to Agents > Create Tool and select Relational DB from the available tool types.

About Tool

Start by adding essential information to help Agents understand the tool’s purpose.

  • Tool Name: Enter a meaningful name.

  • Description: Provide a clear explanation of what the tool does.

  • Configuration

    In this section, you define how the tool connects to and queries the database.

    • Storage: Select the database connection created in Data Studio.

    • Database: Choose the specific database to query.

    • Query:

      • Custom Parameterized Query: Write a prepared SQL statement with named parameters.

        • Example:

      • Dynamic Query from Conversation: Let the Agent generate the full SQL query dynamically from the user conversation.

Input Parameters

Any parameters used in the SQL query (for example, ${productId}) appear here automatically. Define the type and description for each parameter to guide the Agent.

Output

Describe the expected output of the query. The output format can be customized or tested to ensure it matches the desired structure.

Validation

After configuration, test the Relational DB Tool by providing values for the input parameters and executing the query. Review the results to confirm that the tool behaves as expected.

Last updated