1. Home
  2. Kore.ai Conversational Platform
  3. Bot Builder Tool
  4. Defining Bot Tasks
  5. Dialog Tasks
  6. Using the Dialog Builder Tool

Using the Dialog Builder Tool

This topic describes the user interface for creating a conversational flow between a user and a Bot in a dialog task using the Dialog Builder tool in Kore.ai Bot Builder. In the following image, the Find Branch dialog has four sub-intents, with the Component Properties panel displayed for the Has_ATM sub-intent displayed.

Dialog Task- User Interface

In the Search field, you can search component titles for any letters or words using find-as-you-type. Search matches are highlighted in the component titles.

Adding Dialog Task Components

When you create a dialog task, by default the first component created and displayed is a user intent node, or user intent component of a dialog task. The user intent is how the dialog task is identified by the end-user, for example, Search for a Flight, or Create a Ticket. Additional components in the dialog task are added to perform the intent requested by the end-user. For example, for example, for the Search for a Flight dialog, you should add additional components to query the user for the departure airport, arrival airport, and date.

To add a component, simply click either of the Add Component  icons as shown in the following illustration.

Dialog Task Add Component

On the command menu displayed, select one of component types, and then either select an existing component or create a new component as shown in the following example of Create new entity.

Add Component - Entity

 

When create new is selected, the component is added to the dialog task with default data that can be modified in the Properties panel that is displayed at the same time as shown next.

Add Component - Entity Default

In the previous example, a default entity node is added with a default name Entity0006, default Type set to String, and default User Prompt set to Sample prompt message for Entity0006. After adding a new component, define the component properties as required in the Properties panel.

Depending on the type of component added, you will need to define various settings in the Properties panel. For more information, see the following component types:

About the Options Menu

The Options menu is your access to Dialog Builder tool settings and commands such as view settings, dialog task settings, and dialog import and export. To access the commands on the Options menu, click the Ellipses  icon located on the upper rightmost side of Dialog Builder as shown in the following illustration.

Options Menu

Using Display Options

You can also set Display Options for your dialog task. Click the Ellipses  icon to display the Display Options menu command for nodes in your dialog task. You can use Display Options to reduce unnecessary node information and better utilize screen real estate.

You can show or hide some or all of node type, node details, or connection details shown in Dialog Builder. For example, all details are shown in the following illustration for Show All.

Click Hide Node Type to removed the node name.

Click Hide Node Details to remove node descriptions.

Click Hide Connection Details to remove conditional transition details.

Click Hide All to show only basic node information with color coding.

Using Zoom Controls

On the Options menu, click the Ellipses  icon to display Zoom Options for:

  • Fit to page – Resizes Dialog Builder components and connections to fit within the display screen resolution for a single, non-scrolling page.
  • Reset Zoom – Resets zoom settings to actual size.

Additional Zoom Option controls are available in the lower leftmost side of the Dialog Task builder shown in the following illustration.

Zoom Options

Dialog Settings

On the Options menu, click the Ellipses  icon to display Dialog Settings for your dialog as shown in the Dialog Task Settings dialog. You can modify the dialog task basic settings, and if desired, set the visibility of a dialog to create a hidden dialog task that is available for use, but not shown as a bot task.

Dialog Task Settings

Add or modify the following settings for each dialog:

  • Name – The Name of your dialog task, usually the main user intent, for example, Pay Bills.
  • Description – An optional description of your dialog task displayed in Bot Builder.
  • Visibility Scope – Specify the visibility of this dialog task to the end-user. Select one of:
    • Visible – The dialog is listed as a task for the bot and in the Bot Store. This is the default setting.
    • Hidden – The task can be accessed by the end-user or within a dialog flow, but the task is not displayed to the end-user:
      • when the end-user asks what the bot can do as a list of tasks
      • in the Bot Store as a task for the bot.

Importing and Exporting Dialog Tasks

You can export a complete dialog task, and then import the dialog into another instance of Dialog Builder tool.

Exporting a Dialog

On the Options menu, click the Ellipses  icon to display the Export command. Click Export. A .json file is downloaded to the default download directory for your web browser.

The follow JSON example is an exported file for a Dialog task with a single node.

{  
   "_id":"dg-a2592e58-560a-5af5-81f6-3723f457c749",
   "name":"MyNewDialogTaskTest",
   "shortDesc":"Optional description here.",
   "visibility":{  
      "namespaceIds":[  
         "u-3bccf6c4-90e1-5471-94f6-259a4839abd9"
      ],
      "namespace":"private"
   },
   "nodes":[  
      {  
         "nodeId":"intent0",
         "type":"intent",
         "transitions":[  
            {  
               "metadata":{  
                  "connId":"dummy0",
                  "color":"#299d8e"
               },
               "default":""
            }
         ],
         "metadata":{  
            "top":170,
            "left":30
         },
         "nodeOptions":{  
            "transitionType":"auto"
         },
         "componentIndex":0
      }
   ],
   "components":[  
      {  
         "desc":"Optional description here.",
         "type":"intent",
         "intent":"MyNewDialogTaskTest",
         "name":"MyNewDialogTaskTest",
         "dialogId":"dg-a2592e58-560a-5af5-81f6-3723f457c749"
      }
   ]
}

Importing a Dialog

After you have exported a dialog, you an import the dialog to the same, or another instance of Dialog Builder tool. When a file is imported, the data is validated to ensure the intent of the dialog is the same as the import file. Any new nodes or changed settings in the imported dialog is propagated to all other dialog components of the task.

To import a dialog

  1. On the Options menu, click the Ellipses  icon to display the Import command.
  2. Click Import, and then in the Import a Dialog dialog, click Choose File.
  3. Navigate to your previously exported dialog, and then click Import.

The Import Successful dialog and the results of the import are displayed as shown in the following illustration.

Import Successful Dialog

 

Color Coded Connections

The conditions, or transitions from one component to another are labeled by a colored arrow showing the path to the next node based on the connection condition defined. In the following color chart, the order of connection color assignment is shown.

Dialog Task Condition Color Chart

When multiple conditions are defined with multiple connection options to other components, the colored arrows help you visualize the flow as shown in the following illustration.

Dialog Task Component Colors

Troubleshooting Your Dialog Task

A real-time set of errors and warnings is available as you define your dialog task located in the upper rightmost corner of Dialog Builder. Click the information icon to display any errors or warnings as shown in the following illustration.

Dialog Task - Errors and Warnings

In addition, you can view the flow of your dialog task from the start of the root intent to a selected component by using the Show Trace diyshowtraceicon icon as shown in the following illustration.

Dialog Task - Show Trace

In the previous illustration, any components of the dialog task that are not directly in the dialog flow for the selected component are grayed out. Using the trace feature you can look for a broken flow or conditional transition issues. Click Clear Trace Path to remove the trace.

The Bots Platform also provides validation of your dialog task at the task level when you exit the Dialog Builder or use the Talk to Bot tool.

You can click the the Talk to bot  icon in Dialog Builder located in the lower rightmost corner to display the Talk to Bot pane. You can chat with your Bot to test recognition, performance, and flow without leaving Dialog Builder as shown in the following illustration of the Kore.ai Banking Bot locating bank branches for the user.

Dialog Task - Talk To Bot

Using Debug Log

For additional troubleshooting, you can open the Debug Log window shown in the following illustration from the Talk to Bot pane when you click the Debug Log  icon located on the title bar shown in the previous illustration.

Debug Log

 

In the upper panel of the Debug Log window, a sequential list of dialog task components is displayed. You can also view the dialog flow in the Session Context & Variables panel as an expandable panel of dynamically populated Context object and session variables updated at each processed component in Dialog Builder. For more information, see Using Session and Context Variables in Tasks and Context Object.

Logging

In the log, you can view the sequential progression of the dialog task from a state of started to a state of finished along with the following status for each component step as:

 

  • processing – The Bots Platform begins processing of the node
  • processed – The node and node connections are processed, a following node is found but the dialog has not yet moved to that node.
  • waitingForUserInput – The user was prompted for input
  • pause – The current dialog task is paused while another task is started.
  • resume – The current dialog with status of pause continues at the same point in the flow after completion of another task that was started.
  • waitingForServerResponse – The server request is pending an asynchronous response.
  • error – An error occurred, for example, the loop limit is reached, a server or script node execution fails.
  • end –  The dialog reached the end in the dialog flow.

In the following example log, the intent is processed followed by an entity for use input, followed by a service node, dialog node (sub-intent), script node, and finally a Bot Response node.
intent : Search_flight_availablity (processed)
Timestamp: Fri Apr 21 2017 08:34:51
> entity : Source (processing)
Timestamp: Fri Apr 21 2017 08:34:52
> entity : Source (waitingForUserInput)
Timestamp: Fri Apr 21 2017 08:34:52
> entity : Source (processed)
Timestamp: Fri Apr 21 2017 08:35:02
> service : SourceCall (processing)
Timestamp: Fri Apr 21 2017 08:35:02
> service : SourceCall (processed)
Timestamp: Fri Apr 21 2017 08:35:02
> dialogAct : Weatherquestion (processing)
Timestamp: Fri Apr 21 2017 08:35:22
> dialogAct : Weatherquestion (waitingForUserInput)
Timestamp: Fri Apr 21 2017 08:35:22
> dialogAct : Weatherquestion (processed)
Timestamp: Fri Apr 21 2017 08:35:27
> script : listofobjects (processing)
Timestamp: Fri Apr 21 2017 08:35:28
> script : listofobjects (processed)
Timestamp: Fri Apr 21 2017 08:35:28
> script : formatinglocation (processing)
Timestamp: Fri Apr 21 2017 08:35:28
> script : formatinglocation (processed)
Timestamp: Fri Apr 21 2017 08:35:28
> service : weatherapi (processing)
Timestamp: Fri Apr 21 2017 08:35:28
> service : weatherapi (processed)
Timestamp: Fri Apr 21 2017 08:35:29
> script : locationscript (processing)
Timestamp: Fri Apr 21 2017 08:35:29
> script : locationscript (processed)
Timestamp: Fri Apr 21 2017 08:35:29
> message : response (processing)
Timestamp: Fri Apr 21 2017 08:35:29
> message : response (processed)
Timestamp: Fri Apr 21 2017 08:35:30

The following is an example of the Session & Context Variables panel in Debug Log. For more information about the parameters, see Using Session and Context Variables in Tasks and Context Object.

{
   "bot":"Travel Planning Sample_Help Docs_1",
   "botid":"st-b70a7f73-9d78-5fe5-95d8-173a4b40bb7c",
   "taskid":"dg-cc54776b-3dec-57b2-95f4-42484eb70c46",
   "intent":"Search flight availablity @development",
   "intentType":"dialog",
   "entities":{
      "Source":"orlando",
      "SourceAirport":"MCO",
      "Dest":"daytona",
      "DestinationAirport":"DAB",
      "Date":"2017-08-29"
   },
   "userInputs":{
      "originalInput":{
         "sentence":" b",
         "timestamp":1503933057000
      }
   },
   "history":[
      {
         "originalSentence":"b",
         "timestamp":1503933057000
      },
      {
         "dialogState":"started",
         "timestamp":1503933057000
      },
      {
         "nodeId":"intent0",
         "state":"processed",
         "type":"intent",
         "componentName":"Search_flight_availablity",
         "timestamp":1503933057000
      },
...
      {
         "nodeId":"message15",
         "state":"processing",
         "type":"message",
         "componentName":"FinalFlightsInfo",
         "timestamp":1503933508000
      },
      {
         "nodeId":"message15",
         "state":"waitingForUserInput",
         "type":"message",
         "componentName":"FinalFlightsInfo",
         "timestamp":1503933508000
      },
      {
         "nodeId":"message15",
         "state":"processed",
         "type":"message",
         "componentName":"FinalFlightsInfo",
         "timestamp":1503933734000
      },
      {
         "dialogState":"finished",
         "timestamp":1503933734000
      }
   ],
   "dialog_tone":[
      {
         "tone_name":"angry",
         "count":1,
         "level":0.05
      },
      {
         "tone_name":"disgust",
         "count":1,
         "level":-0.05
      },
      {
         "tone_name":"fear",
         "count":1,
         "level":-0.05
      },
      {
         "tone_name":"positive",
         "count":8,
         "level":0.62
      }
   ],
   "message_tone":[

   ],
   "SourceCall":{
      "response":{
         "statusCode":200,
         "body":[
            {
               "value":"MCO",
               "label":"Orlando International Airport [MCO]"
            },
            {
               "value":"SFB",
               "label":"Orlando Sanford International Airport [SFB]"
            },
            {
               "value":"JDO",
               "label":"Juazeiro do Norte - Orlando Bezerra de Menezes Airport [JDO]"
            }
         ],
         "headers":{
            "access-control-allow-headers":"Cache-Control, Pragma, Origin, Authorization, Content-Type, X-Requested-With",
            "access-control-allow-methods":"GET, PUT, POST, DELETE, OPTIONS",
            "access-control-allow-origin":"*",
            "allow":"GET, HEAD, OPTIONS",
            "cache-control":"private",
            "content-encoding":"gzip",
            "content-type":"application/json",
            "server":"KoreOps",
            "set-cookie":[
               "GEAR=local-56f519ef2d5271b6c70001b1; path=/"
            ],
            "vary":"Accept,Cookie,Accept-Encoding",
            "transfer-encoding":"chunked",
            "connection":"keep-alive"
         }
      }
   },
   "DestCall":{
      "response":{
         "statusCode":200,
         "body":[
            {
               "value":"DAB",
               "label":"Daytona Beach International Airport [DAB]"
            }
         ],
         "headers":{
            "access-control-allow-headers":"Cache-Control, Pragma, Origin, Authorization, Content-Type, X-Requested-With",
            "access-control-allow-methods":"GET, PUT, POST, DELETE, OPTIONS",
            "access-control-allow-origin":"*",
            "allow":"GET, HEAD, OPTIONS",
            "cache-control":"private",
            "content-encoding":"gzip",
            "content-type":"application/json",
            "server":"KoreOps",
            "set-cookie":[
               "GEAR=local-56f519ef2d5271b6c70001b1; path=/"
            ],
            "vary":"Accept,Cookie,Accept-Encoding",
            "content-length":"96",
            "connection":"keep-alive"
         }
      }
   },
   "locationinfo":{
      "response":{
         "statusCode":200,
         "body":{
            "results":[
               {
                  "address_components":[
                     {
                        "long_name":"Daytona Beach",
                        "short_name":"Daytona Beach",
                        "types":[
                           "locality",
                           "political"
                        ]
                     },
                     {
                        "long_name":"Volusia County",
                        "short_name":"Volusia County",
                        "types":[
                           "administrative_area_level_2",
                           "political"
                        ]
                     },
                     {
                        "long_name":"Florida",
                        "short_name":"FL",
                        "types":[
                           "administrative_area_level_1",
                           "political"
                        ]
                     },
                     {
                        "long_name":"United States",
                        "short_name":"US",
                        "types":[
                           "country",
                           "political"
                        ]
                     }
                  ],
                  "formatted_address":"Daytona Beach, FL, USA",
                  "geometry":{
                     "bounds":{
                        "northeast":{
                           "lat":29.2930571,
                           "lng":-80.9829099
                        },
                        "southwest":{
                           "lat":29.12747599999999,
                           "lng":-81.21030999999999
                        }
                     },
                     "location":{
                        "lat":29.2108147,
                        "lng":-81.0228331
                     },
                     "location_type":"APPROXIMATE",
                     "viewport":{
                        "northeast":{
                           "lat":29.2930571,
                           "lng":-80.9829099
                        },
                        "southwest":{
                           "lat":29.12747599999999,
                           "lng":-81.21030999999999
                        }
                     }
                  },
                  "place_id":"ChIJg1YCJZTb5ogR6yrLHbc7ajY",
                  "types":[
                     "locality",
                     "political"
                  ]
               }
            ],
            "status":"OK"
         },
         "headers":{
            "content-type":"application/json; charset=UTF-8",
            "expires":"Tue, 29 Aug 2017 15:15:17 GMT",
            "cache-control":"public, max-age=86400",
            "vary":"Accept-Language",
            "access-control-allow-origin":"*",
            "content-encoding":"gzip",
            "server":"KoreOps",
            "content-length":"461",
            "x-xss-protection":"1; mode=block",
            "x-frame-options":"SAMEORIGIN",
            "connection":"keep-alive"
         }
      }
   },
   "list":{
      "results":[
         {
            "address_components":[
               {
                  "long_name":"Daytona Beach",
                  "short_name":"Daytona Beach",
                  "types":[
                     "locality",
                     "political"
                  ]
               },
               {
                  "long_name":"Volusia County",
                  "short_name":"Volusia County",
                  "types":[
                     "administrative_area_level_2",
                     "political"
                  ]
               },
               {
                  "long_name":"Florida",
                  "short_name":"FL",
                  "types":[
                     "administrative_area_level_1",
                     "political"
                  ]
               },
               {
                  "long_name":"United States",
                  "short_name":"US",
                  "types":[
                     "country",
                     "political"
                  ]
               }
            ],
            "formatted_address":"Daytona Beach, FL, USA",
            "geometry":{
               "bounds":{
                  "northeast":{
                     "lat":29.2930571,
                     "lng":-80.9829099
                  },
                  "southwest":{
                     "lat":29.12747599999999,
                     "lng":-81.21030999999999
                  }
               },
               "location":{
                  "lat":29.2108147,
                  "lng":-81.0228331
               },
               "location_type":"APPROXIMATE",
               "viewport":{
                  "northeast":{
                     "lat":29.2930571,
                     "lng":-80.9829099
                  },
                  "southwest":{
                     "lat":29.12747599999999,
                     "lng":-81.21030999999999
                  }
               }
            },
            "place_id":"ChIJg1YCJZTb5ogR6yrLHbc7ajY",
            "types":[
               "locality",
               "political"
            ]
         }
      ],
      "status":"OK"
   },
   "count":1,
   "place":"'orlando'",
   "weatherapi":{
      "response":{
         "statusCode":200,
         "body":{
           ...
   },
   "weather":"Scattered Showers",
   "lastupdate":"Mon, 28 Aug 2017 11:15 AM EDT",
   "temp":"80F",
   "chill":"79",
   "direction":"175",
   "speed":"14",
   "pressure":"1007.0",
   "humidity":"89",
   "visibility":"16.0",
   "wind":"\nChill:79\nDirection:175\nSpeed:14",
   "FlightsInfo":{
      "response":{
         "statusCode":200,
         "body":{
            "currency":"USD",
            "results":[
  ...
               {
                  "itineraries":[
                     {
                        "outbound":{
                           "flights":[
                              {
                                 "departs_at":"2017-08-29T06:29",
                                 "arrives_at":"2017-08-29T08:10",
                                 "origin":{
                                    "airport":"MCO"
                                 },
                                 "destination":{
                                    "airport":"CLT"
                                 },
                                 "marketing_airline":"AA",
                                 "operating_airline":"AA",
                                 "flight_number":"1974",
                                 "aircraft":"321",
                                 "booking_info":{
                                    "travel_class":"ECONOMY",
                                    "booking_code":"K",
                                    "seats_remaining":7
                                 }
                              },
                              {
                                 "departs_at":"2017-08-29T09:10",
                                 "arrives_at":"2017-08-29T10:34",
                                 "origin":{
                                    "airport":"CLT"
                                 },
                                 "destination":{
                                    "airport":"DAB"
                                 },
                                 "marketing_airline":"AA",
                                 "operating_airline":"AA",
                                 "flight_number":"5317",
                                 "aircraft":"CR9",
                                 "booking_info":{
                                    "travel_class":"ECONOMY",
                                    "booking_code":"L",
                                    "seats_remaining":7
                                 }
                              }
                           ]
                        }
                     }
                  ],
                  "fare":{
                     "total_price":"810.30",
                     "price_per_adult":{
                        "total_fare":"810.30",
                        "tax":"76.35"
                     },
                     "restrictions":{
                        "refundable":false,
                        "change_penalties":true
                     }
                  }
               }
            ]
         },
         "headers":{
            "access-control-allow-headers":"origin, x-requested-with, accept",
            "access-control-allow-methods":"GET, PUT, POST, DELETE",
            "access-control-allow-origin":"*",
            "access-control-max-age":"3628800",
            "cache-control":"no-cache",
            "content-encoding":"gzip",
            "content-type":"application/json",
            "expires":"-1",
            "pragma":"no-cache",
            "server":"KoreOps",
            "vary":"Accept-Encoding",
            "x-frame-options":"sameorigin",
            "x-permitted-cross-domain-policies":"master-only",
            "x-webkit-csp":"default-src 'self'",
            "x-xss-protection":"1; mode=block",
            "transfer-encoding":"chunked",
            "connection":"keep-alive"
         }
      }
   },
   "resultsFound":true,
   "subIntentsNodeId":"message15",
   "mappedIntents":[

   ],
   "session":{
      "EnterpriseContext":{

      },
      "BotContext":{

      },
      "UserContext":{
         "profColour":"#00D0EC",
         "workinghours":{
            "workdays":"mon,tue,wed,thu,fri",
            "workstart":"08:00 AM",
            "workend":"05:00 PM"
         },
         "workaddress":{
            "longitude":"",
            "latitude":"",
            "suiteNo":"",
            "country":"",
            "state":"",
            "zip":"",
            "city":"",
            "street":""
         },
         "dept":"Documentation",
         "jTitle":"Documentation Team",
         "profImage":"profile.png",
         "activationStatus":"active",
         "emailId":"help@koremessenger.com",
         "firstName":"Help",
         "lastName":"Docs",
         "orgId":"o-20e421ee-3fd2-5d0b-b149-6943c083950b",
         "_id":"u-014ce789-49b4-533c-8c79-dd8a1555e823",
         "identities":[
            {
               "val":"help@koremessenger.com",
               "type":"email"
            }
         ]
      },
      "UserSession":{

      },
      "BotUserSession":{
         "lastMessage":{
            "channel":"rtm",
            "messagePayload":{
               "clientMessageId":1503933733806,
               "message":{
                  "body":"2"
               },
               "resourceid":"/bot.message",
               "botInfo":{
                  "chatBot":"Travel Planning Sample_Help Docs_1",
                  "taskBotId":"st-b70a7f73-9d78-5fe5-95d8-173a4b40bb7c"
               },
               "client":"botbuilder",
               "meta":{
                  "timezone":"America/New_York",
                  "locale":"en-US"
               },
               "id":1503933733806
            }
         }
      },
      "opts":{
         "userId":"u-014ce789-49b4-533c-8c79-dd8a1555e823",
         "streamId":"st-b70a7f73-9d78-5fe5-95d8-173a4b40bb7c"
      }
   }
}

Next Steps

Your next step is to decide what component type to add and how to transition to the next component. For more information, see the following component types:

Was this article helpful to you? Yes 1 No