Build agent tools#

We’ll create two managed tools — individual components that complete different tasks — that we will add later to an agent. Dataiku offers multiple built-in tools that you can configure in just a few clicks.

Add a knowledge bank search tool#

The first tool specializes in searching knowledge banks like the one we just built.

  1. Go to GenAI (GenAI icon.) > Agent Tools in the top navigation bar.

  2. Click + New Agent Tool.

  3. Choose Knowledge Bank Search from the available tools.

  4. Give the tool the Name search_articles.

  5. Click Create.

Steps to add a new Knowledge Bank search tool.

Next, configure the tool to use the knowledge bank. We can choose from among the data columns we embedded for the agent to include as metadata and sources in its responses. We’ll also add some descriptions that give the agent some context about the knowledge bank and how the tool should be used.

  1. In the Design tab of search_articles, choose medium_articles_embedded as the Knowledge Bank.

  2. In the Retrieval section, next to Columns to retrieve, select title and url.

  3. Under Sources > With role, click + Add Role and select title, then for Select metadata, select title.

  4. Add another role for url.

  5. In the Description for LLM window, copy and paste the following text:

This knowledge bank contains articles posted on the Medium website about the AI and machine learning industry. Each article has a title, text, url, and date.

This tool is for the agent to retrieve records that correspond to a given topic.
  1. Click Save.

Steps to configure the article_search tool.

Test the search tool#

We can run a quick test of the tool to see how it performs. This gives a behind-the-scenes look at how the tool will run a query. Later, we’ll interact with the agent using a chat interface.

Let’s look for any articles that deal with deep learning.

  1. Still in the Design tab, move to the Test window.

  2. Replace the text Enter search query here with the following text:

What is the latest news on deep learning?
  1. Click Run Test.

Steps to test the articles search tool.

The tool returns several pieces of useful information under the test window, including:

Response

Includes the content and metadata of relevant articles, along with sources. You can change the number of documents, metadata, and sources retrieved in the Design tab.

Trace and Log

Can help audit and debug an agent’s actions.

Tool Descriptor

Provides information about the tool for agent use.

Add a messaging tool#

The next tool to build sends a message summarizing the articles returned using the knowledge bank search tool.

Note

You can send a message via Slack, Microsoft Teams, or email. An administrator must configure these settings. This tutorial uses email, though feel free to experiment with the message type of your choice and adapt the steps below accordingly.

  1. Return to the Agent Tools page and click + New Agent Tool.

  2. Choose the Send Message tool.

  3. Add the Name send_email and click Create.

  4. In the tool Design page, choose the Integration type of Mail.

  5. For the Channel, choose the channel configured by your administrator.

  6. Add the following text to the corresponding boxes:

    • To: Your email address

    • Subject: AI industry news report

    • Tool description > Description for LLM: This tool should be used to send a summary of the most relevant articles found by the search_articles tool, via email.

  7. Click Save.

Steps to add a new messaging tool.

Test the messaging tool#

Let’s run a quick test to make sure this tool is working correctly.

  1. In the Test window, optionally add your own message in the Test query box, replacing the text The message to send.

  2. Click Run Test.

  3. Check that the Tool output window returns ok. You can also check your email or other messaging tool to find the test message.

Steps to test a new messaging tool.

Now that you have two tools that are working separately, let’s put them together to build an agent!