15 Build Your Digital Assistant

Here are some high-level best practices for building digital assistants.

A digital assistant uses machine learning to route user messages to a configured skill that best fits the content of the message. For this, all utterances defined in a skill are used to train a classifier for that skill. So, before you can test skills in a digital assistant, make sure they have a well-trained model for all their intents and that you tested the skill thoroughly.

About Training of unresolvedIntent in Your Skills

It is possible to create a user-defined "unresolvedIntent" intent for a skill and train it with user-defined utterances. This option was widespread before digital assistants were introduced. With digital assistants, this development option has lost its relevance and may no longer be needed. However, in order for you to understand, let's explain what it is about and how and why it worked.

The unresolved intent in a skill handles messages outside of the domain that a skill is designed to process. For this you usually map a dialog flow state to the "unresolvedIntent" action transition to inform the user that the skill could not handle the request.

For example, a skill that handles pizza orders and deliveries is not intended to deal with financial transactions. So, when a user sends a message to check the balance for an account, the unresolved intent will handle the request.

Now let's assume that a digital assistant has two skills defined: one skill to handle pizza orders and deliveries, and another to handle financial use cases. If a user sends a message that contains a request to check an account balance, the digital assistant does not forward it to the pizza skill but to the finance skill. This means that the unresolved intent in the pizza skill is no longer used to handle financial messages.

Let's further assume, for the same digital assistant, that a user requests information about the current weather, which of course does not match either the pizza or the financial skill. In this case, which skill's unresolved intent do you think will handle this request? You got it right when you shouted out, "the unresolved intent of the digital assistant".

By adding skills to a digital assistant and then training the digital assistant, the digital assistant learns about the type of messages that each of the configured skills wants to handle. If the digital assistant can’t tell which skill to route a message to, it displays the response that it is configured with to handle unresolved intents.

What does this mean for adding and training a custom "unresolvedIntent" intent in your skills? It means that a well-trained model does not require a custom "unresolvedIntent" intent to be defined in each skill. And, as a reminder, having a well-trained models in all of your skills is what the person wearing the "AI model designer" hat should be striving for.

On the rare occasion that a skill in a digital assistant incorrectly responds to a message that it should not handle, you can add a custom "unresolvedIntent" intent to train the skill to no longer respond to it, so the digital assistant's unresolved intent message gets displayed or an intent in one of the other skills handles the request.

We recommend creating custom unresolved intents in a skill only as a last resort (i.e. if testing reveals a problem that you cannot resolve by retraining the affected intent model).

Digital Assistant is the Home of your Persona

A digital assistant provides a unified chatbot experience to users and therefore requires the personality that you have defined to be consistently present in all conversations.

Resource Bundles

Like skills, digital assistants can be configured to support multiple languages. Digital assistants require all skills that are configured for it to support the languages it supports. This also includes the type of language support, which could be native NLU-based or by using external translation services.

All prompts and messages displayed by the digital assistant when routing user messages to skills should come from resource bundles. Having those messages in a single place makes it easy to ensure consistency, to make edits, and to hand it to a translator for translation.

Disambiguation and Interruption Dialogs

Although a digital assistant is made up of many different skills, it should not reveal these technical details to users. Oracle Digital Assistant uses configurable dialogs that are displayed to the user when a user message changes the conversational context to a different skill or intent and when the context is reset to the original conversation. Make sure to define the transition messages to be less robotic.

For example, the message that appears during non sequitur routing is defined in the digital assistant settings as "Switching to ${system.routingToIntent} in ${system.routingToSkill} now". For navigating to a "create expense" intent in an "expenses" skill, the printed message would be, "Switching to create expense in expenses skill", which is not how a human would say it.

If you change the message template to "Sure, let's ${system.routingToIntent} for you", the user message can become "Sure, Let's create a new expense for you" (where the "create a new expense" part of the message is the display name you defined for the intent in the skill).

This however means that you need to ensure that the display names of all intents are set such that messages printed on the digital assistant level always print semantically correctly. Therefore, we recommend that you review all of the messages in the Configurations tab of the digital assistant settings panel, and:

  • Change the existing templates according to your needs.

  • Move the customized templates to resource bundles. Add a positional placeholder where the dynamic expression should be added to the message. E.g. " Sure, let's {0} for you". The resource bundle reference would be created as ${rb('key_name', ${system.routingToIntent})}.

  • Review the display names you have defined for the intents in the skills and ensure they fit in with the message templates you have defined in the digital assistant configurations.

  • Review the skill invocation names, which are defined in the skill's Settings page, to ensure the names also fit linguistically with their use in the message templates.

  • Optionally, change settings like Interrupt Prompt Confidence Threshold to only show the prompt when the confidence is low or to suppress it altogether.

  • In the configuration settings, change the confidence threshold, which determines when a skill is considered to be a candidate skill. We recommend setting this threshold to a lower value than the default and then gradually increasing it over time. What you want to find is the sweet spot that resolves all your skills with confidence with no bad routing.

Checklist for Building Your Digital Assistant

  • ☑ Make sure skills added to a digital assistant have a well-trained and tested model for all their intents.
  • ☑ Review digital assistant configuration settings to adapt the message templates for built-in messages to your needs and the persona of your bot.
  • ☑ Review intent display names and skill invocation names to make sure their wording fits with the digital assistant templates you defined.
  • ☑ When testing the digital assistant conversations, make sure that the persona defined for your bot is consistently present.