# Competency

# What

# What is a competency?

A competency can be thought of as a capability that your AI is capable of performing out. For example, asking your conversational AI/virtual assistant about the weather, ordering food, playing your favorite music etc. are all realized through the construction of competencies.

A competency does not require any additional information to be extracted from the user query to process users' quest. For example, a competency which is capable of providing FAQ responses about open hours of branches can give a response even when no information other than the intent about opening hours.

Alternatively, a platform user can still set slots to be extracted from the query, but when the information is not provided, the AI can still run an answer. For example, the open hours competency can optionally contain a specific day of the week, a sample query can be: "What time does DMV open on Friday ?" However, when a day of the week is not provided, the competency can default to a frequently asked day.

# What is the relationship between competencies, transitions and a states?

A competency can be decomposed into a bucket of states and transitions.

Note: Recommend reading this section after being familiar with the concept of transition and state.

When a competency is created, one single state competency_name is created.

screenshot of get_balance

In the meantime, a class competency_name_start is generated. When a query is classified to an intent associated with this class, the transition gets triggered. As the example shows in the graph above, if a query like "How much money do I have in my account?" maps to get_balance_start, it will take the transition and move from the root state to the get_balance state.

# What is the competency sidebar?

competency sidebar

Competency Sidebar is a comprehensive tool kit where you can:

# What is context retention?

To understand context retention, let's start by looking at a dialog:

Me: I want to transfer 200 dollars to Albert.
Financial Assistant: Okay. You want to transfer 200 dollars to Albert. From which account you want to withdraw the money?

Me: Oh how much money I have left in my checking account?
Financial Assistant: You have 4200 dollars in your checking account.

Me: Okay. Let me do the transfer now.
Financial Assistant: Okay. What's the source account, the amount and to whom you want to transfer?

Without context retention, the user’s experience can be fragmented and they may have to repeat the key information that has provided earlier over and over again. Using the platform context retention feature, you will be able to build conversation experiences like this without any additional custom logic:

Me: I want to transfer 200 dollars to Albert.
Financial Assistant: Okay. You want to transfer 200 dollars to Albert. From which account you want to withdraw the money?

Me: Oh how much money I have left in my checking account?
Financial Assistant: You have 4200 dollars in your checking account.

Me: Okay. Let me do the transfer now.
Financial Assistant: Okay. You want to transfer 200 dollars to Albert. From which account you want to withdraw the money?

Specifically, context retention refers to the storage of extracted slots in the system and the recall of stored slots when competencies are triggered.

# Scenarios where context is carried over:

There are two ways for context to be carried over: Context retention feature enabled on a competency or an explicit classification transition between the two competencies with slots that are shared (slots with the same name). See How to add different types of transitions to learn more.

Context Retention Explicit Transition Behavior
Yes No Context is saved and “re-activated“ when the end user is back in the same competency. See the sample conversation below.
No Yes Context is carried over when traveling through the transition.
Yes Yes Context is carried over with the transition and also context is saved in the back for re-activation later on.

Sample conversation:

context retention

In the sample, we can see that when switching the topic to bank hours and back, the slot values amount, source_account, destination_account are all "re-activated".

# Conversation Guidance: Must-Complete and Incomplete Reminder

# Must-Complete

Enabling Must-Complete on a competency prevents an end user from leaving the competency until they reach a terminal state. This could be used for acknowledgement of a promotional offer or compliance agreement. In general, Must-Complete prioritizes the completion of a competency over allowing the end user to navigate the conversation freely.

# Incomplete Reminder

Upon reaching a terminal state the conversation will resume the most recently interacted with competency that is incomplete. A competency is considered incomplete if it has Incomplete Reminder enabled and no terminal state has been reached within that competency. This can be used more generally than Must-Complete, to for example remind a user to finish any action that they started but did not complete.

# Tips for Using Conversation Guidance
  • A competency can be assigned Must-Complete, Incomplete Reminder, or neither, but not both.
  • Context Retention is required for competencies in which either of these features will be used.
  • Must-Complete and Incomplete Reminder have special global response templates associated with them.
  • These features can be used together. For example, if an end user attempts to leave a Must-Complete competency by attempting to enter another competency with Incomplete Reminder, they will not be allowed to leave. However, upon completion of the Must-Complete competency, they will be redirected to the last incomplete competency that they asked about. See the example below:
Me: I'm interested in opening an account.
Financial Assistant: Okay. Are you interested in our new-customer promotion?

Me: Actually I changed my mind, can I transfer 200 dollars to Rory?
Financial Assistant: Before we do that, are you interested in our new-customer promotion?

Me: Not at this time.
Financial Assistant: Okay. Did you want to finish that transfer you started? You wanted to send 200 dollars to Rory, right?

Me: Yes, and that's correct.
Financial Assistant: Great! I'll send 200 dollars to Rory.

# Conversation Guidance Information in the Payload

If conversation guidance is triggered, the information about the source competency, including its slot values, is preserved in the request payload in the dialog_management field, which contains the following sub-fields:

  • from_competency : Source competency which just completed
  • from_intent : Intent within the source competency
  • from_logic : Conversation Guidance logic that caused the transition from source competency to destination competency
  • from_slots : Slot information of the source competency
  • from_state : State of the source competency
  • into_competency : Destination competency which is currently active
  • into_state : State of the destination competency
  • response : Printable response generated by the destination competency
  • speakable_response : Speakable response generated by the destination competency

This information may help resolve potentially conflicting slot information between two related competencies. For example, consider the following dialog where the user transitions from the funds_transfer competency with Incomplete Reminder to the check_balance competency before resuming funds_transfer.

Me: Transfer 200 dollars from checking account to Albert
Financial Assistant: Okay. You asked to transfer 200 dollars from your checking account to Albert. Is that correct?

Me: What is the balance of my savings account?
Financial Assistant: The balance of your savings account is $3700. Earlier we discussed funds_transfer. You asked to transfer 200 dollars from your checking account to Albert. Is that correct? OR would you prefer to transfer from your savings account? 

Let’s break down the conversation. When the user asks to transfer money from their checking account, the funds_transfer competency is triggered with one of the slots - SOURCE_ACCOUNT loaded with the value checking as shown below:

Intent: funds_transfer_start
Slot Values: {
  "_SOURCE_ACCOUNT_": [
    "checking"
  ],
  "_DESTINATION_ACCOUNT_": [
    "Albert"
  ],
  "_AMOUNT_": [
    "200 dollars"
  ]	
}

However, the user did not confirm the transfer and instead asked about the balance on their savings account. This caused the conversation guidance to

  • mark the funds_transfer as incomplete (as the funds_transfer had Incomplete Reminder enabled),

  • switch to check_balance competency and retrieve the balance, completing the check_balance competency, and

  • then resume funds_transfer, the last incomplete competency, producing the following response:

    The balance of your savings account is $3700. Earlier we discussed funds_transfer. You asked to transfer 200 dollars from your checking account to Albert. Is that correct? OR would you prefer to transfer from your savings account?

The above response was created by leveraging the slot values from check_balance, which were loaded as follows:

  "_ACCOUNT_NAME": [
    "savings"
  ],
  "_AMOUNT_": [
    "$3700"
  ]

As funds_transfer was triggered the second time, the check_balance slots such as ACCOUNT_NAME and AMOUNT were retained in dialog_management["from_slots"] as follows:

 "dialog_management": {
    "from_competency": "check_balance",
    "from_intent": "check_balance_complete",
    "from_logic": "incomplete",
    "from_slots": {
  "_ACCOUNT_NAME": [
    "savings"
  ],
  "_AMOUNT_": [
    "$3700"
  ]
    },
    "from_state": "check_balance",
    "into_competency": "funds_transfer",
    "into_state": "funds_transfer",
    "response": "You asked to transfer 200 dollars from your checking account to Albert. Is that correct? OR would you prefer to transfer from your savings account?",
    "speakable_response": "You asked to transfer 200 dollars from your checking account to Albert. Is that correct? OR would you prefer to transfer from your savings account?"
  },

As a result, the AI confirmed if the user still wanted to make the transfer from their checking account or if they would rather use their recently referenced savings account. Programmatically the AI was able to achieve it by comparing dialog_management.from_slots["_ACCOUNT_NAME_"] with SOURCE_ACCOUNT, triggering the additional confirmation when the two did not match.

# How

How to create/import a competency

How to edit/delete a competency?

How to pinpoint a specific element within a large project?

How to configure context retention?

How to design/scope competencies?

Best Practice Tips

# How to create/import a competency?

There are two ways to create a competency:

  1. Click add next to COMPETENCIES in the competency sidebar.

In the modal,

create new competency

  1. Name your competency. Note to use _ between words since spaces are not allowed and state names will be represented entirely lowercase in the payload to external endpoints.
  2. Specify slots you would like to identify from the input utterances. Press enter after each slot.

To import a competency:

import competency

  1. Go to the overflow menu overflow menu next to COMPETENCIES in the competency sidebar to reveal Import Competency option.

# How to edit/delete a competency?

edit competency

  • Edit allows you to add slots and delete existing slots. Detail see How to add/remove a slot?
  • Export allows you to preserve datasets used to train this competency or download the whole competency which includes the state graph, slot mapping, responses etc.
  • Disable/Enable: When a competency is disabled, any queries related to the intents associated with the competency will go to out_of_scope intent. However, you can still edit states, intents, training data and response that belong to the competency. Training is required when disabling or enabling a competency.
  • Delete: As the name indicates. Please consider archiving before deletion.

# How to pinpoint a specific element within a large project?

The search function in the competency sidebar is designed to help you navigate a large-scale project. It allows you to search for competencies, intents, states, and slots.

search competency sidebar

The search bar pulls up all the elements that contain the search term including the parent element. For example, for weather_forecast_start intent, the search menu also shows you the classification transition weather_forecast attached to it.

The table below shows the actions taking place when you select an element:

Element Actions
Competency Expands the competency and shows all the states that connect to this competency.
Intent Expands the competency and opens the intent data page.
State Expands the competency and the state.
Slot Expands the competency and opens the slot data page.

# How to configure context retention?

  1. Go to Versions Settings page in the competency sidebar.

  2. The Context Retention configuration box is near the top of the page.

context retention box

  1. Select the competencies for which you want to enable context retention. You may modify the maximum number of conversation turns and competencies visited through which the conversation context is retained. The Conversation Guidance setting can be changed to either Must-Complete or Incomplete Reminder for each competency. Note that the Apply All functionality will overwrite all existing settings when utilized.

  2. Click Save Context Retention Settings.

# Best Practice Tips

At this point, it's time for you to start thinking about the following questions:

  • Start with determining what capabilities you would like your AI version to have. Launch a Scoping Job to help you gather and brainstorm some common end user-AI interactions.
  • Brainstorm the ways how a user might query your virtual assistant. For example, if you want to design a competency that allows your users to order food. What might be some first things the customers might say? "Hi! Can I order some food?" "Can I get a cheeseburger?"
  • Next, what do you imagine your AI to respond in order for the conversation to proceed "cooperatively"? What kind of persona do you imagine your conversational AI to have?


Last updated: 07/31/2020