Overview
This integration enables Amazon Connect to receive calls and Kore.ai AgentAssist helps agents during voice conversations. We use Amazon Kinesis Video Streams (KVS) to store audio streams of both users and agents.
High-level architecture
Prerequisites
- Amazon Connect instance with admin privileges.
- Kore.ai AgentAssist account.
- Basic know-how of Amazon Connect.
- Ability to receive voice calls on Amazon Connect agent desktop.
Components Required
This integration consists of the following components:
- Kore.ai AgentAssist
- AWS Lambda
- Amazon Kinesis Video Streams
- Amazon Connect
AWS Lambda
KVS Trigger
- This function pulls the call stream’s metadata and the Amazon Web Services (AWS) credentials from the environment and generates credentials set (SessionToken, AccessKeyId, SecretAccessKey) for accessing the relevant KVS.
- It then triggers the Transcriber to start consuming the KVS and send the transcripts to the specified Kore.ai bot with context of the current Conversation ID.
IFrame Token Generator
- Generates Kore.ai AgentAssist IFrame widget token to display properly within Amazon Connect agent workspace.
Transcription Trigger
- This is a microservice that extracts the required parameters from the request body and generates the KVS Processing executable as a separate process with the parameters (like Contact Details, Credentials, and Voice Gateway).
AWS Connect Third Party Application
- This includes the Kore.ai AgentAssist widget that renders within the Amazon Connect Agent Workspace with the context of the current conversation.
Integration Setup Guide
Kore.ai AgentAssist
To onboard the Kore.ai AgentAssist account and create dialog tasks, refer to the AgentAssist Setup Guide.
AWS Lambda
KVS Trigger
- Download the Lambda from here and upload to AWS.
- Change the Lambda handler to “kvs_trigger.handler”.
- Create the following environment variables within the Lambda:
- kvsAccessKeyId – AWS Client ID
- kvsSecretAccessKey – AWS Client Secret
- region – AWS Region – Region of KVS
- transcriberURL – https://agentassist.kore.ai/<AMAZON VOICE ENDPOINT>
- The AMAZON VOICE ENDPOINT is available with your Kore.ai representative.
- Ensure the account associated with AWS Client ID and Secret has Read permissions to Amazon KVS.
IFrame Token Generator
- Download the Lambda from here and upload to AWS.
AWS Connect Third Party Application Configuration
- Click Third-party applications.
- Click Add application.
- Enter a Display name for your app – for example, Kore.ai AgentAssist Application.
- Enter a Namespace for the app – for example, kore.ai-example-ns.
- Enter “https://agentassist.kore.ai/integrations/amzn/tpa-voice/” in the Access URL field.
- Select all the instances that you want to enable AgentAssist for in the Instance association – optional field.
Note: Third Party Apps are not supported for SAML based Amazon Connect instances. To use Kore.ai AgentAssist with SAML based Amazon Connect Instances, refer to this doc.
- Click Add application.
Amazon Connect
Configuring Amazon Connect Instance
- Select your Amazon Connect instance. (To create a new instance, follow Create an Amazon Connect instance.)
- Click Data storage.
- Click Edit next to Live media streaming. Here, you must create instances of Kinesis Video Streams.
- Add an appropriate Prefix for the Kinesis Video Streams and select an AWS Key Management Service.
- Set an appropriate Data retention period – 1 hour should be enough for Kore.ai AgentAssist use cases.
- Click Save.
- Click Data streaming.
- Select the Enable data streaming checkbox.
- Select Kinesis Stream.
- Click Create a new Kinesis Stream for this application, or select an existing one from the dropdown list. You can use the same stream for Contact Trace Records (CTRs) and Agent Events.
- Click Save.
- Click Flows.
- Click Choose an option under AWS Lambda.
- Select KVS Trigger Lambda from the dropdown list.
- Click Add Lambda Function.
- Follow the above two steps for the IFrame Token Generator Lambda.
Configuring Amazon Connect Contact Flow
- Sign in to your Amazon Connect Instance.
- Click Flows.
- Click Create flow.
- Click the dropdown list icon.
- Click Import.
- Select KoreAgentAssist.json from the file upload menu. You can download it from here.
- Click Import.
- Click Set contact attributes and enter the required fields:
- Click Save.
- Click Start Stream and Transcription in Kore Lambda.
- Select your Trigger Lambda Function from the dropdown list.
- Click Save.
- Click Kore Token Generator for TPA Lambda.
- Select your IFrame token generation Lambda.
- Click Save.
- For the Transfer to Flow, select a flow you want to move the user to.
- To use agent dispositions, configure the Set Event Flow block with Disconnect flow for Agent UI hook by importing this flow and selecting it. If not, you can delete the block and connect the remaining blocks to the disconnect block.
Note: The disposition saving logic is at your discretion. Implement as per your use case. Some examples are: - Click Save, and publish the flow.
Attaching Contact Flow to Phone Number
- Click Channels > Phone numbers.
- Select the Phone Number to attach to the flow. If you don’t have a number, go through How to get an Amazon Connect phone number in your current country to claim a phone number.
- Click the dropdown list to select the Contact flow.
- Click the AgentAssist flow you created.
- Click Save.