Skip to main content
Feedback

Creating a DataHub Query tool

You can create a tool that connects an AI agent to a DataHub repository and its deployed model. The DataHub Query tool retrieves active golden records based on field filter criteria using the Query Golden Records API endpoint and your specified deployed model and repository. It lets the agent fetch and share golden record data with users. If data is masked and the user does not have permission to view it, the agent may not be able to respond as expected.

An AI agent can use the DataHub Query tool to query data that has been processed and governed in DataHub. This ensures the agent accesses accurate, quality data when answering user queries or executing tasks.

Prerequisites

You must have the following privileges:

  • Agent Developer role or a custom role Agent Garden Access, Agent Create, Agent Edit, Agent Feedback Submit, Agent Garden Feedback View
  • DataHub access
  • To create DataHub Query tools, you must have the following privileges:
    • MDM - View Repositories
    • MDM - View Models
  • To query data or use the hub tool in an agent, you need at least one of the following permissions:
    • MDM - View Data
    • With Advanced User Security feature, you must have:
      • View Records Hub entitlement for the repository you want to query
      • MDM - Stewardship or MDM - Stewardship Management

Read Agent Garden: Getting Started for details on adding roles and setting up custom privileges.

Important considerations

  • The DataHub Query tool can return up to 200 active golden records. Querying end-dated records and quarantined entities is not supported.

  • The tool only supports filtering by Field ID. Filtering by source ID, created date, updated date, or tag is not supported.

  • The tool does not support setting limit or offset for the returned records.

  • Each DataHub Query tool represents only one specific query. For example, if you want an agent to query astronaut data by birth state and return records by the given state or query astronaut data by last mission name and return a list of records with the mission name, you must create two Query tools; one for the state query and one for the mission name query.

    two separate query tools attached to a task for different query scenarios

Create a DataHub Query tool

Follow these steps to create a DataHub Query tool.

  1. Navigate to Agent Garden > Tools and click Create New Tool. image show the Tools button location in the side menu
  2. Select DataHub Query.
  3. Click Add Tool.
  4. Enter a Tool Name to identify your tool.
  5. Enter a description for the tool to help the Large Language Model (LLM) understand what the tool does.
  6. Optional: Click Add Input Parameter to have the agent ask the user for a value for a field filter. The tool can use a field filter value to query records. You can add up to five input parameters (filter fields).
    1. In Name, enter a name for the field you want to filter. For example, “city”. The name cannot have spaces.
    2. Enter a description for the field filter.
    3. Select the data type for the field in the Type drop-down (integer, boolean, string). example of a state field filter with string type
    4. Optional: Turn on the Required? toggle if the parameter value is required. This requires the agent to retrieve the input parameter value from the conversation before it can proceed.
    5. Click Add Input Parameter.
  7. Click Save & Continue.
  8. In Repository, select the repository that contains the golden records you want to query.
  9. In Model, select the deployed model associated with the golden records.
  10. Select the fields for which you want the agent to provide data. You have the option to select all next to the Fields column.
  11. Click Save & Continue.
  12. Optional: Click Add Filter to specify the filter criteria in which to query records. Filter by field name is supported. Other filtering options, such as filtering by tag or by source, are not supported. filter example with input parameter in brackets
    1. Select the field name.
    2. Select an operator.
    3. In the value field do one of the following:
      • Enter a static value.
      • Select the value placeholder for the input parameter you created in step 6.
      • If adding multiple filters, select the AND or OR operator. AND returns records that match all field names specified. OR returns records that match any of the field names specified.
  13. Click Save & Continue.
  14. Review your tool settings and click Deploy Tool to activate it and add it to agents. Deployed tools show as active in the Tools list view and are available in the Tools tab to attach to an instruction when you create an agent.

Next steps:

  • Create another tool. Agents can use multiple tools to complete tasks.
  • Build an agent
On this Page