IBM Watson Assistant Integration With Twilio SMS
And Why SMS Is Still Relevant…
Introduction
In most regards other messaging mediums have overtaken plain old SMS.
Some of these mediums are WhatsApp, Messenger, Web chat etc. One of the reasons why these mediums are popular is the availability of design affordances.
Affordances are UX elements available to the developer/designer to use in the conversational experience.
In the case of Messenger, there are quick reply buttons, marques and other elements which allows for enriching the conversational experience.
In the case of SMS, the user can only enter their responses in text, or at best navigate by a number based menu.
So what makes SMS still relevant?
I believe one of the big opportunities of SMS is to implement bi-directional or conversational notifications. Many organizations like couriers, e-commerce, medical aids etc. communicate with customers via SMS. These notifications via SMS updates the user on a host of topics; when their parcel will be delivered, scheduled medication which is ready for pickup, appointment reminders etc.
But what happens if you user has a question, while you have their attention? There are normally thousands of replies on these notifications which remain unanswered.
Imagine if your customer can reply to those notifications, ask a related question and a natural langue conversation can ensue from there…
Setup Twilio SMS Account
This short guide will walk you through the setup to connect your IBM Watson Assistant to Twilio’s SMS gateway. This is useful for a quick prototype or demo.
Within a few minutes I was able to connect my Watson Assistant to a mobile number and chat with the assistant via SMS. Here’s how…
Buying a number within Twilio is quite straight forward, click on Manage Numbers tab on the left, and buy a number.
You can select your country and in some cases your region. It does make sense to match the region of your Watson Assistant deployment. In one instance my Watson Assistant Deployment was in Dallas, and I could choose a US number which is in Dallas.
For the purpose of this exercise we are not interested in Voice, only SMS capabilities.
When a number is selected, this cost is displayed and the capabilities of the number is displayed. The cost of the numbers do vary, and generally it seems if numbers in the US are cheaper.
The number reservation is quick and the number is available immediately. Some countries, like South Africa, have regulatory requirements which need to be met prior to accessing the number.
Within Watson Assistant, which you will see later, a messaging endpoint URL is given. This can be copied and pasted into the position indicted by the red arrow above.
The Account SID and Auth Token can be accessed by clicking on Dashboard. Copy this, as it will be required within Watson Assistant.
Setup The Watson Assistant Side
IBM Watson Assistant is constituted by two main component. An Assistant and one or more skills. This story is about how to orchestrate multiple skills, and multiple skill types within an Assistant.
The basic components of Watson Assistant. The basic architecture of Watson Assistant consists of two main parts; skills and an assistant.
Each skill type, of which there are three, has a specific use-case; this can be extended of course. However, used out of place, can seriously impede the scaling of your chatbot.
Let’s start with the difference between an Assistant and Skills…
The assistant can be seen as the container of the conversational agent.
The assistant also houses the skills, and the assistant also facilitates the connectors to the integration mediums.
The Assistant direct requests down the optimal path for solving a customer problem.
By adding skills, your assistant can provide a direct answer to an in domain question or reference more generalized search results for requests more complex.
Here we have one Assistant, called Test, with a few existing integrations. We are going to select integrations to add our Twilio SMS integration to it.
The integration options are listed on the right, with the option to add integration.
Once Twilio SMS integration is selected, two tabs are presented. Basic setup and Advanced options.
The basic setup requires two fields:
- Account SID, and
- Auth token.
These are the two values we copied out of Twilio in the dashboard.
Here you see the Webbook URI, which Twilio in turn requires. When reaching this point in the process, you can send a SMS to your reserved Twilio number.
Within seconds Watson Assistant should respond, and from there a conversation can ensue.
There are a few considerations at this point, the first being that the return SMS is on another number.
The return SMS is sent via the general Twilio SMS gateway. Messages are also sent from changing originating numbers. For a demo this is all good. But for a production environment, you will want to have the mobile terminating and originating number to be the same.
Secondly, considering the absence of design affordances like buttons, and the character limitations, special consideration will have to be given to the return dialogs. Ideally dialogs need to fall within the character limitations of a SMS and in plain text. Expecting a NLU response from the user.
It makes sense to have a separate and parallel dialog dedicated to the SMS medium.
Conclusion
The number of integration options under IBM Watson Assistant is growing at a rapid pace, with live agent breakouts part of it.
The reality is that conversational agents will have to be ubiquitous, living in the user’s environment and accessible via any medium of choice.
Ambient orchestration is required for a seamless and contextual conversation spanning over multiple mediums.