Amazon Lex builds conversational interfaces using voice and text. Processing conversation logs enhances understanding of user intents and improves natural language capabilities of applications.
Welcome to the Amazon Lex documentation for Dimension! Integrating Dimension into your Amazon Lex application is quick and easy.
If you have any questions, comments, or suggestions, please feel free to contact us.
Create an API Key
Each chatbot or voice skill, needs its own API Key for tracking.
Add a Chatbot and select Lex as the Platform.
The Key will be used below as the value for DIMENSION_API_KEY in the instructions for sending logs to Dimension.
Create Cloudformation Stack [Optional]
In the steps below, you create a Cloudwatch Logs log-group, a IAM role with permissions for allowing lex to write to Cloudwatch Logs,
and a Lambda function with code we provide to feed conversation logs from Cloudwatch Logs to Dimension.
For convenience, we have also provided a Cloudformation file in the link below, which provides the same resources but with less flexibility
in customization.
After you create your cloudformation stack, attach the log-group and the role to the lex bot alias as instructed below.
Enable Conversation Logs on Amazon Lex
Step 1: Create a new Log Group in CloudWatch Logs.
For example, with the name “my-bot-text-logs”
Step 2: Create an IAM role and provide write permissions to the Log Group created above.
For example, with the name “MyBotLogRole”
Step 3: Enable Logs in Amazon Lex
- In the Lex console, select the chatbot
- Choose Settings
- Choose Conversation Logs
- Choose the Settings gear icon for Prod
- Under Log Type, select Text logs
- For Log Group name, select the group
“my-bot-text-logs”
created above - For IAM role, select the role,
“MyBotLogRole”
created above - Save
Integrate Amazon Lex Conversation Logs into Dimension
Now that conversations are being logged to Cloudwatch, configure a subscription to send these to Dimension.
- Navigate to AWS Lambda service on the Console.
- Choose Create function
- Provide a Function name such as lex-dimension-integration
- Choose the latest version of Node.js in the Runtime language
- Select Create new role with basic permissions
- Click on Create function
- In the function code select “Upload a file from Amazon S3” and enter this URL: https://dashbot-us-east-1-public-lex-cloudwatch-import.s3.amazonaws.com/f74c2e8da62424e6107afebb248acc4f
- In Environment variables, add DIMENSION_API_KEY with the Dimension API Key created above
- Click on Add trigger and add CloudWatch Logs in the trigger configuration
- Select the appropriate Log group from the drop down
Note: Use the same CloudWatch Log group selected during Conversation logs setup - Choose a Filter name and click Add
Test Integration
To test the integration, send messages to your chatbot.
Open Dimension reports, and from the Real Time section in the left nav, select Live Transcripts.
The messages should appear in the Live Transcripts.
If you have any questions, comments, or suggestions, please feel free to contact us.