IBM Developer

Build watsonx Assistant conversation content with templates

Use watsonx Assistant templates to build the foundation for your assistant

By Alexander Dfouni

When it comes to building your assistant's conversation content in IBM watsonx Assistant, you can create your next action from scratch or by using one of the templates available in watsonx Assistant. In this tutorial, get an easy-to-follow guide to using watsonx Assistant templates as a means to build your assistant's foundation.

If this is your first time building an assistant in watsonx Assistant, following these steps gives you an understanding of how watsonx Assistant actions and steps work to deliver a conversation to your user. For now, try following these steps regardless of your assistant's use case to get a quick grasp of the build process.

Note that this tutorial is a part of a learning path for beginners. More in-depth information on building actions with templates can be found on the watsonx Assistant documentation pages.

To see the process, you can watch the following short video.

Prerequisites

To follow this tutorial, you need:

  • An IBM Cloud account
  • Access to any watsonx Assistant instance on a Lite, Plus Trial, Plus, or Enterprise plan
  • Access to any assistant
  • An understanding of the watsonx Assistant user interface

Estimated time

It should take you approximately 25 minutes to complete the tutorial.

Steps

  1. Navigate to the Actions page. There are no actions that are listed on the "Created by you" tab yet. Select Create action +.

    Actions page

  2. Select Quick start with templates on the next screen.

    Quick start selection

  3. You are presented with the template catalog. Here, you can select multiple templates to add to your assistant. Let's use one of these templates to understand how watsonx Assistant conversations come together.

    1. Filter the templates to Getting information (a).
    2. Select the Request contact information templates (b).
    3. Click Add templates on the window that appears (c).

      Getting the templates

  4. You return to your Actions page Created by you tab. Now, you see the template that you selected has been successfully added to your assistant. Click Preview to test the assistant's current functions before looking inside the action.

    Actions page

  5. Try saying "contact info please" when the Preview window opens. Interact with the assistant as if you were the customer asking for help.

    Notice how the Welcome message came from the default "Greet customer" action, and the response to asking about contact information came from the "Request contact information" action. You can click either to go directly to the step in the action where the response came from.

    Click into the Request contact information action when you are finished previewing the action. The Preview chat remains visible as you navigate your actions unless you minimize it.

    Contact information

  6. Within the Request contact information action, the template has populated the action's phrases with various ways that a customer might ask for contact information. Even though "contact info please" is not a listed phrase here, watsonx Assistant is able to still recognize the intended request by matching to the phrases it knows. Some of the provided user examples use varying tones of language to provide watsonx Assistant with real examples of the ways humans communicate.

    Click into Step 1 of the Conversation steps when you are finished reviewing the phrases that are provided by the template.

    Request contact info

  7. This is the first step in the action, representing the first response that your assistant checks the conditions of to consider responding to your customer's matched phrase with. Recognize the text within the "Assistant says" box as the response the assistant had when you asked "contact info please". This template's first step is taken without conditions, so the assistant always takes Step 1 when the "Request contact information" action begins. This step is currently set to always continue to the next step.

    Looking over to the list of conversation steps, there are three other steps that are listed after the first. A great way to learn how these steps connect to each other is to use debug mode's "go to step" feature within the Preview chat.

    To enable debug mode in the Preview chat, click the spider icon (a) on the Preview chat window's tray. Then, click any of the location pins (b) to enable "go to step." For this example, click the pin for "Greet customer."

  8. Watsonx Assistant automatically goes to the step where the assistant is pulling the response from, across any action. To better understand how the "Request contact information" action works, go through that flow and watch where the assistant pulls the response from. Try entering "contact info please" again.

    Entering contact info again

  9. Watsonx Assistant goes to the first step of the Request contact information action. Select North America to preview the logic between steps.

    Selecting North America

  10. Go to step loads Step 2. Within the "Assistant says" box, which contains the response that is seen in the preview window, an action variable is used to dynamically insert the location selected in Step 1.

    However, unlike Step 1, Step 2 is taken with conditions. The condition is that the value of the Step 1 action variable is North America. This is logical because the assistant should only provide the North America contact information to a customer based in North America. Additionally, unlike Step 1, Step 2 ends the action when complete because the customer has received the answer to their question and no further steps are required.

    Now that you understand the differences between Step 1 and Step 2, compare their step thumbnails in the Conversation steps list on the left side of the window. Notice how the thumbnail for Step 2 displays the condition "1 is North America," which is a shorthand representation of the conditions for Step 2. The thumbnails for Step 1 and Step 2 also differ in showing what happens at the end of the step.

    By understanding how to read the step thumbnails, infer that Steps 3 and 4 are similar to Step 2. Steps 2, 3, and 4 are taken, or not, depending on the response to Step 1.

    When you understand how to read the step thumbnails within actions, you can test your understanding by previewing the flow with "go to step" enabled again. Click the refresh icon within the Preview window to restart the conversation from the beginning.

    Restarting the conversation

  11. Enter "contact info please" once again, but select Asia this time.

    Entering Asia in contact info

  12. Watsonx Assistant jumps from Step 1 to Step 4 because Step 4 is the only step that is taken with the condition that the value of the Step 1 action variable is Asia.

    Step 4's condition checks for "Any" of the conditions to be true, setting the conditions to "or" rather than "and" (which can be done by setting "Any" to "All"). The template is set up for a scenario where the contact information for Asia, Africa, and Australia is the same.

    Template is set up

Summary

With an understanding of how to add actions to your assistant using templates, how the flow of steps within an action is decided, and how to use debug mode to troubleshoot that flow, you are now ready to create some actions of your own from scratch. Continue to the next tutorial in this guide to learn how to plan and build actions from scratch.

Any questions? Reach out to Alexander Dfouni.