Digital Developer Conference: Cloud Security 2021 -- Build the skills to secure your cloud and data Register free

Create a conversational voicebot using WhatsApp and Watson services

Note: This code pattern uses the classic Watson Assistant experience. After October 8, 2021, all instances (except the standard plan) can switch between the classic and new Watson Assistant experiences by going to the upper-right corner of the Watson Assistant screen and clicking the Manage icon.

Manage icon

Summary

In this code pattern, build a framework that lets users send voice queries using the WhatsApp application and get a response from IBM Watson Assistant. The query from the user is sent to the Watson Speech to Text Service through a custom application. The output from the Watson Speech to Text Service is then fed to Watson Assistant. Watson Assistant responds back to the user with an appropriate answer.

Description

Conversational AI voicebots are helping businesses automate repetitive and time-consuming queries. This gives your team more time to tackle more complex, high priority strategic tasks, while still ensuring that the customers are engaged. Voicebots take in voice input and can ingest, analyze, interpret, and respond to customer inquiries, with the goal being able to answer a customer’s question in real time or being able to continue a text exchange with the customer to clarify the question.

A voicebot is useful in many scenarios where typing is not a convenient option, such as:

  • Elderly customers who find it more convenient to speak than to type. Some customers have better spoken language skills than written language skills. They find it easier to use voicebots.
  • Delivery executives on the move with a need to update systems.

This code pattern uses the scenario of a customer speaking Brazilian Portuguese through the WhatsApp application to interact with a customer care center. A framework is built that lets the customer send queries using speech on WhatsApp, and then get a response from Watson Assistant. The user’s query is sent to the Watson Speech to Text Service through a custom application. The output from the Watson Speech to Text Service is then fed into Watson Assistant. Watson Assistant understands the query with the help of the built-in support for Brazilian Portuguese and responds back to the user with an appropriate reply. This code pattern can be configured to support multiple languages. Watson Assistant supports these languages.

When you have completed this code pattern, you understand how to:

  • Use the Watson Speech to Text Service
  • Use the Watson Assistant Service
  • Integrate WhatsApp with Watson Services
  • Handle queries sent over voice on WhatsApp

Flow diagram

flow

  1. The user sends a voice or text message in the WhatsApp application.
  2. The message is redirected to the Twilio Programmable Messaging service.
  3. Twilio redirects the message to the voicebot application that is deployed on IBM Cloud or Red Hat OpenShift.
  4. If the user sent a voice message, the voicebot application uses the Watson Speech to Text Service to transcribe the message into text.
  5. The text message is sent to Watson Assistant.
  6. The Watson Assistant chatbot detects the intent and replies with a response.
  7. The Twilio Programmable Messaging service redirects the response message to WhatsApp.
  8. The user is able to view the response message on WhatsApp.

Instructions

Find the detailed steps in the README file. Those steps explain how to:

  1. Clone the repository.
  2. Create the Watson Services.
  3. Create the Twilio Service.
  4. Build and deploy the voicebot application.
  5. Try out the voicebot application on WhatsApp.