Monitoring Voice Agent With Watson

co-authored by Leo Mazzoli & Lalit Agarwalla

Leo Mazzoli
Jul 7, 2020 · 4 min read
Image for post
Image for post

IBM® Voice Agent with Watson™ enhances your call center operations by orchestrating Watson services and integrating them with the telephone network. As a critical piece of your solution, it’s important to know that Watson is ready to help when needed.

The Voice Agent (VA) has built-in capabilities that enable the collection of Call Detail Records (CDR) in an external storage service. This post will focus on setting up the event forwarding capability.

What’s Needed

IBM Voice Agent with Watson: Enhances your call center operations by orchestrating Watson services and integrating them with the telephone network

IBM Watson Assistant: Allows you to build conversational interfaces into any application, device, or channel.

IBM Watson Text To Speech: Processes text and natural language to generate synthesized audio output.

IBM Watson Speech To Text: Converts the human voice into the written word

IBM Cloudant Database: A JSON document database to store Call Detail Records.

Voice Agent Event Forwarding

With all the services in place, the first thing to do is to configure the VA to forward CDR records to an IBM Cloudant database. In the Event Forwarding section of the Watson Voice Agent configuration, perform the following steps.

  1. Click the checkbox to Enable Event Forwarding
  2. Select the Cloudant service where the events will be stored
  3. Choose the Call Detail Records database
Image for post
Image for post
Image 1 — Enable Event Forwarding

Configure Cloudant CDR Database

Next, you’ll need to build your monitoring query. It’s easiest to do this using the Cloudant dashboard which is accessible from within the Cloudant service in the IBM Cloud dashboard. There are two primary steps that you need to do: 1) Create a query Index, 2) Create a query.

Query Index:

While not required, it’s good to use a query index to ensure good performance when searching the database. In the Cloudant tooling, go to the database where the Voice Agent CDR events are stored. Add the following text to the index builder window and click the Create Index button

{
"index": {
"fields": [
"event.endReason",
"event.failureOccurred",
"event.failureDetails",
"event.startTime"
]
},
"ddoc": "failure-json-index",
"name": "failure-json-index",
"type": "json"
}
Image for post
Image for post
Image 2 — Create Query Index
Image for post
Image for post
Image 3 — Create Query Index

Query:

Using the query builder, create and test a query to search for CDR events — using the index created in the previous step.

This query returns all Virtual Agent messages that failed except for two specific codes which do not represent a service failure. The startTime field is in milliseconds.

{
"selector": {
"event": {
"failureOccurred": true,
"endReason": "failed",
"$not": {
"failureDetails": {
"$regex": "^CWSGW0082E|^CWSGW0082F"
}
},
"startTime": {
"$gt": 158894192300
}
}
},
"use_index": "_design/failure-json-index"
}
Image for post
Image for post
Image 4 — Create Query
Image for post
Image for post
Image 5 — Create Query

This is just a sample query. Use the Watson Voice Agent system messages to tailor results specifically for the solution being monitored.

Automated Monitoring

The last step is to build an automated script that executes the query and sends notifications based on established business rules. The query will be run against the CDR database using the Cloudant API.

Configure API Query:

Create a data file in JSON format that contains the query developed in the previous steps.

VA_CDR_Events_Query.json{
"selector": {
"event": {
"failureOccurred": true,
"endReason": "failed",
"$not": {
"failureDetails": {
"$regex": "^CWSGW0082E|^CWSGW0082F"
}
},
"startTime": {
"$gt": 158894192300
}
}
},
"use_index": "_design/failure-json-index"
}

Cloudant API Query
curl "<CLOUDANT_EXTERNAL_ENDPOINT>/va-cdr-events/_find" \
-X POST \
-H "Content-Type: application/json" \
-d @VA_CDR_Events_Query.json

NOTE: If the VA_CDR_Events.json file is somewhere other than the directory from which the API command will run, use a fully qualified path name for the data parameter.

Build Monitoring Script

Finally, build an automated monitoring script that will run the query at regular intervals. This script will differ depending on the environment and business rules. A general health check might be to…

  • Query CDR repository for VA failures in the last 10 minutes
  • Alert on errors that have a count of 5 or more in current health check
  • Alert on error codes detected 3 or more times on the current and previous health checks
  • Flag error codes detected between 3 and 5 times
  • Repeat process every 10 minutes

Concluding Remarks

IBM® Voice Agent with Watson™ allows you to easily enable Watson AI for automated voice interactions over the telephone. Being able to retrieve and monitor the call detail records helps you ensure that the service is ready when customers call.

For help using and implementing Watson services, reach out to IBM Data and AI Expert Labs and Learning.

Resources

Enabling Event Forwarding for Watson Voice Agent
Finding Documents In Cloudant
Cloudant API Reference

Lalit Agarwalla and Leo Mazzoli are IBM Watson Cognitive Engineers. They specialize in educating and enabling clients with IBM’s wide catalog of Watson products and solutions.

IBM Data and AI

AI Trust | Automation | Language

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store