Developing company cleverness dashboard for the Amazon Lex bots

You’ve rolled away a conversational screen powered by Amazon Lex, with a target of enhancing the consumer experience for the clients. Now you wish 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, questions such as these could be tough to respond to. The present release of conversation logs for Amazon Lex makes it simple to have visibility that is near-real-time just how your Lex bots are performing, centered on real bot interactions. All bot interactions can be stored in Amazon CloudWatch Logs log groups with conversation logs. You can make use of this conversation information to monitor your bot and gain actionable insights for improving your bot to enhance an individual experience for the clients.

In a previous post, we demonstrated how to allow conversation logs and make use of CloudWatch Logs Insights to evaluate your bot interactions. This post goes one action further by showing you the way to integrate having an Amazon QuickSight dashboard to get company insights. Amazon QuickSight allows you to effortlessly produce and publish interactive dashboards. You’ll select from a library that is extensive of, charts, and tables, and include interactive features such as for instance drill-downs and filters.

Solution architecture

In this company cleverness dashboard solution, you’ll make use of an Amazon Kinesis information Firehose to constantly 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 transform the natural information into JSON information documents. Then you’ll usage an AWS Glue crawler to automatically discover and catalog metadata for this information, therefore with Amazon Athena that you can query it. A template is roofed below which will create an AWS CloudFormation stack for your needs containing many of these AWS resources, along with the required AWS Identity and Access Management (IAM) roles. With your resources in position, after that you can create your dashboard in Amazon QuickSight and connect with Athena as a repository.

This solution enables you to make use of your Amazon Lex conversation logs information to produce visualizations that are live Amazon QuickSight. As an example, with the AutoLoanBot through the earlier mentioned article, it is possible to visualize individual demands by intent, or by user and intent, to achieve a knowledge about bot use and individual pages. The dashboard that is following these visualizations:

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

Deploying the answer

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

For the example, we’re utilising the AutoLoanBot, but you need to use this solution to construct an Amazon QuickSight dashboard for almost any of one’s Amazon Lex bots.

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

  • Welcome – reacts to a preliminary greeting from an individual
  • ApplyLoan – Elicits information like the user’s name, target, and Social Security quantity, and produces a brand new loan demand
  • PayInstallment – Captures the user’s account number, the final four digits of these Social Security quantity, and re re re payment information, and operations their month-to-month installment
  • CheckBalance – utilizes the user’s account quantity in addition to last four digits of these Social Security quantity to give their outstanding stability
  • Fallback – reacts to your needs that the bot cannot process using the other intents

To deploy this solution, complete the steps that are following

  1. After you have your bot and conversation logs configured, use the following key to introduce an AWS CloudFormation stack in us-east-1:
  2. For Stack name, enter a true title for the stack. This post makes use of 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 CloudWatch Logs log team where your discussion logs are configured.

The bot is used by this post AutoLoanBot as well as the log team car-loan-bot-text-logs:

  1. Select Then.
  2. Include any tags you may wish for the CloudFormation stack.
  3. Select Upcoming.
  4. Acknowledge that IAM functions will soon be developed.
  5. Select Create stack.

After a couple of minutes, your stack should really be complete and retain the following resources:

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

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

AWS CloudFormation should have successfully subscribed also the Firehose delivery flow to your CloudWatch Logs log team. You can view the registration when you look at the AWS CloudWatch Logs system, for instance:

Only at that point, you need to be in a position to examine your bot, see your log data moving from CloudWatch Logs to S3 through the Firehose delivery flow, and query your discussion log information utilizing Athena. If you work with the AutoLoanBot, you should use a test script to create log data (discussion logs usually do not log interactions through the AWS Management Console). To install the test script, choose test-bot. Zip.

The Firehose delivery flow operates every minute and channels the info towards the S3 bucket. The crawler is configured to perform every 10 minutes(you can also anytime run it manually through the system). Following the crawler has run, you are able to query important computer data via Athena. The screenshot that is following a test question you can test within the Athena Query Editor:

This question reveals that some users are operating into problems wanting to check always their loan stability. You can easily put up Amazon QuickSight to do more in-depth analyses and visualizations for this information. To get this done, finish the following actions:

  1. Through the system, launch Amazon QuickSight.

If you’re perhaps not already making use of QuickSight, you can begin with a totally free test making use of Amazon QuickSight Standard Edition. You’ll want to provide a merchant account notification and name current email address. Along with selecting Amazon Athena as being a information source, be sure to through the bucket that is s3 your conversation log information is kept (you are able to find the bucket name in your CloudFormation stack).

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

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

Including visualizations

You can now include visualizations in Amazon QuickSight. To produce the 2 visualizations shown above, finish the following actions:

  1. Through the + Add symbol near the top of the dashboard, select Add visual.
  2. Drag the intent industry to your Y axis in the artistic.
  3. Include another artistic by saying the very first two actions.
  4. Regarding the second visual, drag userid to your Group/Color industry well.
  5. To sort the visuals, drag requestid to your Value field in every one.

You can easily produce some extra visualizations to gain some insights into how well your bot is doing. For example, you’ll 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 replace the intent measurement with inputTranscript, and include a filter for missedUtterance = 1. The graphs that are following summaries of missed utterances, and missed utterances by individual.

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

This kind of visualization provides a view that is powerful just how your users are reaching your bot. In this instance, make use of this understanding to enhance the CheckBalance that is existing intent implement an intent to simply help users arranged automatic re re payments, industry basic questions about your car finance solutions, and even redirect users to a cousin bot that handles mortgage applications.


Monitoring bot interactions is crucial in building effective interfaces that are conversational. It is possible to determine what your users are attempting to achieve and exactly how to streamline their consumer experience. Amazon QuickSight in tandem with Amazon Lex conversation logs makes it simple to generate 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 go!