Creating a continuing company cleverness dashboard for the Amazon Lex bots

Creating a continuing company cleverness dashboard for the Amazon Lex bots

You’ve rolled away a conversational software driven by Amazon Lex, with a target of enhancing the consumer experience for the clients. Now you like to monitor exactly how well it is working. Are your web visitors finding it helpful? Just exactly How will they be deploying it? Do they enjoy it adequate to keep coming back? How will you evaluate their interactions to add more functionality? Without having a view that is clear your bot’s user interactions, concerns like these is hard to answer. The present launch of conversation logs for Amazon Lex makes it simple to have visibility that is near-real-time exactly exactly how your Lex bots are doing, centered on actual bot interactions. All bot interactions can be stored in Amazon CloudWatch Logs log groups with conversation logs. You can make use of this conversation data to monitor your bot and gain insights that are actionable boosting your bot to enhance the consumer experience for the clients.

In a prior post, we demonstrated just how to enable discussion logs and make use of CloudWatch Logs Insights to assess your bot interactions. This post goes one action further by showing you the way to incorporate by having an Amazon QuickSight dashboard to get business insights. Amazon QuickSight allows you to effortlessly produce and publish dashboards that are interactive. You are able to select from a considerable collection of visualizations, maps, and tables, and include interactive features such as for example drill-downs and filters.

Solution architecture

In this company cleverness dashboard solution, you can expect to utilize an Amazon Kinesis information Firehose to continuously stream discussion log information from Amazon CloudWatch Logs to an amazon bucket that is s3. The Firehose delivery flow employs A aws that is serverless lambda to change the natural information into JSON information documents. Then you’ll use an AWS Glue crawler to automatically learn and catalog metadata with this information, therefore that you could query it with Amazon Athena. A template is roofed below that may produce an AWS CloudFormation stack for you personally containing most of these AWS resources, along with the required AWS Identity and Access Management (IAM) roles. By using these resources in position, you may then make your dashboard in Amazon QuickSight and hook up to Athena as being a databases.

This solution lets you make use of your Amazon Lex conversation logs information to produce real time visualizations in Amazon QuickSight. For instance, utilizing the AutoLoanBot through the mentioned before post, you can easily visualize individual demands by intent, or by user and intent, to achieve a knowledge about bot use and individual pages. The after dashboard shows these visualizations:

This dashboard shows that re re payment task and loan requests are many greatly utilized, but checking loan balances is utilized a lot less usually.

Deploying the perfect solution is

To have started, configure an Amazon Lex bot and enable conversation logs in the usa East (N. Virginia) Area.

For the instance, we’re utilizing the AutoLoanBot, but this solution can be used by you to create an Amazon QuickSight dashboard for almost any of the Amazon Lex bots.

The AutoLoanBot implements an interface that is conversational allow users to start that loan application, look at the outstanding stability of these loan, or make that loan re re payment. It includes the intents that are following

  • Welcome – reacts to a greeting that is initial the consumer
  • ApplyLoan – Elicits information including the user’s title, address, and Social Security quantity, and produces a brand new loan demand
  • PayInstallment – Captures the user’s account number, the past four digits of the Social Security quantity, and re payment information, and operations their month-to-month installment
  • CheckBalance – utilizes the user’s account quantity in addition to final four digits of these Social Security quantity to supply their outstanding stability
  • Fallback – reacts to your needs that the bot cannot process with all the other intents

To deploy this solution, finish the steps that are following

  1. Once you’ve your bot and conversation logs configured, use the following key to introduce an AWS CloudFormation stack in us-east-1:
  2. For Stack title, enter a true title for the stack. This post utilizes the true title lex-logs-analysis:
  3. Under Lex Bot, for Bot, enter the title of one’s bot.
  4. For CloudWatch Log Group for Lex discussion Logs, go into the true title associated with the CloudWatch Logs log team where your discussion logs are configured.

This post makes use of the bot AutoLoanBot and also the log team car-loan-bot-text-logs:

  1. Select Then.
  2. Include any tags you may desire for the CloudFormation stack.
  3. Select Upcoming.
  4. Acknowledge that IAM functions is supposed to be produced.
  5. Select Create stack.

After a couple of minutes, your stack ought to be complete and support the following resources:

  • A delivery stream that is firehose
  • An AWS Lambda change function
  • A CloudWatch Logs log team for the Lambda function
  • An bucket that is s3
  • An AWS Glue crawler and database
  • Four IAM roles

This solution utilizes the Lambda blueprint function kinesis-firehose-cloudwatch-logs-processor-python, which converts the data that are raw the Firehose delivery flow into specific JSON data documents grouped into batches. To find out more, see Amazon Kinesis information Firehose Data Transformation.

AWS CloudFormation should also provide effectively subscribed the Firehose delivery stream to your CloudWatch Logs log team. You can view the membership within the AWS CloudWatch Logs system, for instance:

At this point, you ought to be in a position to examine your bot, visit your log data flowing from CloudWatch Logs to S3 through the Firehose delivery flow, and query your discussion log information making use of Athena. You can use a test script to generate log data (conversation logs do not log interactions through the AWS Management Console) if you are using the AutoLoanBot,. To download the test script, choose test-bot. Zip.

The Firehose delivery flow runs every minute and channels the info towards the S3 bucket. The crawler is configured to operate every 10 minutes(you can also anytime run it manually through the system). Following the crawler has run, you’ll query your computer data via Athena. The after screenshot shows a test question you can look at within the Athena Query Editor:

This question implies that some users are operating into dilemmas wanting to always check their loan stability. It is possible to arranged Amazon QuickSight to do more in-depth analyses and visualizations for this information. To get this done, finish the following actions:

  1. Through the console, launch Amazon QuickSight.

If you’re maybe not already making use of QuickSight, you can begin with a free of charge test utilizing Amazon QuickSight Standard Edition. You ought to offer a merchant account notification and name email. As well as selecting Amazon Athena as an information source, be sure to are the bucket that is s3 your discussion log information is saved (you will get the bucket title in your CloudFormation stack).

It will take a couple of minutes to create up your account.

  1. Whenever your account is prepared, select New analysis.
  2. Select New information set.
  3. Select Anthena.
  4. Specify the information supply auto-loan-bot-logs.
  5. Select Validate connection and confirm connectivity to Athena.
  6. Select Create databases.
  7. Select the database that AWS Glue created (which includes lexlogsdatabase into the title).

Including visualizations

You will include visualizations in Amazon QuickSight. To produce the 2 visualizations shown above, finish the steps that are following

  1. From the + include icon towards the top of the dashboard, select Add visual.
  2. Drag the intent industry into the Y axis from the artistic.
  3. Include another artistic by saying the initial two actions.
  4. Regarding the 2nd visual, drag userid to your Group/Color industry well.
  5. To sort the visuals, drag requestid towards the Value field in each one of these.

You can easily produce some visualizations that are additional gain some insights into how good your bot is doing. As an example, you are able to effectively evaluate how your bot is giving an answer to your users by drilling on to the demands that dropped until the fallback intent. To work on this, replicate the preceding visualizations but change the intent measurement with inputTranscript, and put in a filter for missedUtterance = 1 ) The after graphs reveal summaries of missed utterances, and missed utterances by individual.

The screen that is following shows your word cloud visualization for missed utterances.

This sort of visualization offers a view that is powerful exactly exactly how your users are getting together with texas installment loans direct lenders your bot. In this instance, you could utilize this understanding to boost the current CheckBalance intent, implement an intent to aid users put up automatic re re re payments, field general questions regarding your car loan solutions, and even redirect users up to a sibling bot that handles home loan applications.


Monitoring bot interactions is crucial in building effective conversational interfaces. It is possible to know very well what your users want to accomplish and exactly how to streamline their consumer experience. Amazon QuickSight in tandem with Amazon Lex conversation logs allows you to produce dashboards by streaming the discussion information via Kinesis information Firehose. You are able to layer this analytics solution together with all of your Amazon Lex bots – give it a try!