> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon Connect CCP Integration with Agent AI Voice

This document describes integrating Amazon Connect with Agent AI—Voice using the AWS CCP Integration approach. Amazon Connect receives voice calls while Agent AI provides real-time support to agents. The system captures audio streams from both the user and agent and processes them using Amazon Kinesis Streams. AWS Lambda functions manage transcription and token generation. Agent AI provides AI-powered assistance, including [Agentic Copilot](/ai-for-service/agentai/configuration/linked-services#agentic-configurations), [Next Best Action](/ai-for-service/agentai/agent-experience/agent-assist-widget-v3), [Agent Coaching](/ai-for-service/agentai/agent-experience/agent-realtime-coaching), [Agent Playbook](/ai-for-service/agentai/agent-experience/playbook), [sentiment analysis](/ai-for-service/agentai/agent-experience/agent-assist-widget-v3), [EOC Summary](/ai-for-service/agentai/agent-experience/agent-assist-widget-v3#assist-tab), and more throughout the conversation.

## High-Level Architecture

<img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/architecture_1.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=f4fd839a3061e7e6b8559e9e3c36a5aa" alt="architecture" width="793" height="553" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/architecture_1.png" />

## Prerequisites

| **Category**                                    | **Requirement**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **AWS / Amazon Connect**                        | - An Amazon Connect instance with Administrator privileges.<br />- The instance should be in a region that supports the required services, such as Kinesis Video Streams and Lambda.<br />- If using Telephony: claimed phone numbers (DID or toll-free) as needed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Contact Control Panel (CCP) / Agent Desktop** | - Supported browser for agents (latest version of Chrome recommended; Firefox may have limitations around sample rates and media usage). Refer to the [AWS Documentation](https://docs.aws.amazon.com/connect/latest/adminguide/ccp-agent-hardware.html?utm_source=chatgpt.com) for details.<br />- Workstations meeting minimum hardware/network standards (CPU, RAM, network bandwidth). Refer to the [AWS Documentation](https://docs.aws.amazon.com/connect/latest/adminguide/ccp-agent-hardware.html?utm_source=chatgpt.com) for details.<br />- Network/firewall settings configured: allow outbound HTTPS (443), WebRTC ports/domains, approved origins/domains in Connect for CCP, and any custom hosting of CCP. Refer to the [AWS Documentation](https://docs.aws.amazon.com/connect/latest/adminguide/ccp-networking.html?utm_source=chatgpt.com) for details. |
| **Streaming and Transcription Components**      | - Amazon Kinesis Video Streams (KVS) availability in region: permissions to create/stream video/audio data.<br />- AWS Lambda permissions to read from KVS, generate temporary AWS credentials for access, and trigger downstream processing such as the transcriber bot.<br />- Bot/webhook configuration to receive transcription/context.<br />- SSL/valid certificates for any custom-hosted CCP or widget, if hosted outside Amazon Connect's domain.                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Components**                                  | - Active Agent AI account with necessary roles/permissions for dialog tasks, webhook endpoints, and transcription configuration.<br />- Familiarity with dialog/task definitions and handling real-time input.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Security / Identity**                         | - Identity management in Amazon Connect / AWS IAM roles for Lambda and KVS.<br />- Approved origins configured for web apps (for custom CCP or embedded widget) in Amazon Connect.<br />- Appropriate policies for least-privilege on AWS services used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Migration / Versioning**                      | - If accounts were using AudioSockets, migrate to Voice Gateway.<br />- Verify version compatibility of the custom CCP or Streams API when making customizations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

## Components Required

You need the following components:

* Agent AI
* AWS Lambda
* Amazon Kinesis Streams
* Amazon Connect

## Pricing and Cost Considerations

When integrating Agent AI with Amazon Connect, consider potential AWS costs such as call usage (per-minute), phone number rental, Lambda executions, Kinesis Streams (ingestion/storage), transcription services, data storage/transfer, and regional telephony rates. Actual costs vary by usage and region.

## Setup Guide

### Agent AI

To onboard the Agent AI account and create dialog tasks, refer to the [About Agent AI](/ai-for-service/agent-ai) doc.

### AWS Lambda

#### Function 1: KVS Trigger (Choose any other name)

This function retrieves call stream metadata and AWS credentials from the environment, generates a credential set (SessionToken, AccessKeyId, SecretAccessKey) for KVS access, and triggers the Transcriber to send transcripts to the AI Agent with the current Conversation ID.

1. Download the Lambda [from here](https://github.com/Koredotcom/korecc-twilio/raw/master/AmazonConnect/lambdas/KVS_Trigger.zip) and upload it to the function you create.

2. Go to **Create function**.

3. Enter a name in the **Function name** field.
   <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/create-function_2.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=cb7992096080eb4994554b34c7e88950" alt="create-function" width="2048" height="1063" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/create-function_2.png" />

4. Go to **Upload from**.

   <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/upload-from_3.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=b35168c49abc00093283403b08bbac80" alt="upload-from" width="2046" height="1002" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/upload-from_3.png" />

   * Upload the **Lambda** zipped file.
   * Click **Save**.
   * Go to **Runtime settings**.
   * Click **Edit** and change the **Handler** name from **index.handler** to **kvs\_trigger.handler**.
     <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/runtime-settings_4.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=c4da44022b8285209fb61bb245c4b2a3" alt="runtime-settings" width="2048" height="296" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/runtime-settings_4.png" />

5. Go to **Configuration** > **Environment variables**.
   <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/environment-variable_5.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=815c6a98b650085f667c870ba42b75ac" alt="environment-variable" width="2048" height="468" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/environment-variable_5.png" />

6. Create the following environment variables in the Lambda:
   * **kvsAccessKeyId** - AWS Client ID
   * **kvsSecretAccessKey** - AWS Client Secret
   * **region** - your AWS Region
   * **transcriberURL** - [https://platform.kore.ai/integrations/amzn/voice/](https://agentassist.kore.ai/integrations/amzn/voice/)
   * For regions other than **US-prod**, replace the above domain with your Agent AI domain.

7. **Steps to get the AWS Client ID and Secret**
   * Ensure the account associated with the AWS Client ID and Secret has **Read** permissions to Amazon KVS Kinesis Streams.
   * Get your AWS Client ID and Secret from IAM:
     * Go to **IAM** > **Users**.
     * Click **Users** > **Security credentials** tab.
     * Click **Create access key**.
     * Select **Use case** as **Application running on an AWS compute service**.
     * Click **Next**.
     * Enter a description tag, then click **Create access key**.
       <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/create-access-key_6.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=22b34331f03f3840c25f79e243473769" alt="create-access-key" width="2047" height="918" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/create-access-key_6.png" />

8. The final configuration appears as shown:
   <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/final-configuration_7.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=2d0de3eaf68f79f372a8dc4cf46d63bd" alt="final-configuration" width="1744" height="456" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/final-configuration_7.png" />

#### Function 2: Retrieve Agent AI Widget Credentials

This function returns all credentials required to render the Agent AI widget on the Amazon Connect desktop. Store all required data in environment variables and expose them via the API Gateway URL, which is used later in the CCP-voice configuration page.

1. Download the Lambda [from here](https://github.com/Koredotcom/korecc-twilio/raw/master/AmazonConnect/lambdas/KoreAgentAssistCCP.zip) and upload it to a new Lambda function.

2. **Environment variable list**:

   * **agentassistUrl**: `https://agentassist.kore.ai/koreagentassist-sdk-v3/UI/agentassist-iframe.html`
   * **botId**: \[Agent AI Bot Id]
   * **clientId**: \[Agent AI Client Id]
   * **clientSecret**: \[Agent AI Client Secret]
   * **languageCode**: en
   * **awsConnectURL**: \[Aws Connect Access URL]/connect/ccp-v2/

   See the following image for the AWS Connect Access URL:

   <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/aws-connect-access-url_8.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=f8dc30a807c7cf6f0c6dc9edaf1f00e4" alt="aws-connect-access-url" width="1836" height="851" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/aws-connect-access-url_8.png" />

3. Add an **API Gateway** to access this Lambda:
   * Go to **Configuration** > **Triggers**.

   * Click **Add trigger**.

   * Select **API Gateway**.

   * Select **Create a new API**. (API Type: HTTP API)
     <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/create-a-new-api_9.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=f703a26a1776ba24f96b8bb3fe44ebae" alt="create-a-new-api" width="1577" height="670" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/create-a-new-api_9.png" />

   * Copy this **API endpoint URL** and paste it in the **URL** field of the [Contact Control Panel as Agent Desktop](#contact-control-panel-ccp-as-agent-desktop) section.

## Amazon Connect

1. Sign in to your **Amazon Connect instance**.

2. Go to **Amazon Connect** > **Instances**.

3. Create a new Amazon Connect instance or sign in to an existing one.
   <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/amazon-connect-instance_10.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=df9637e7492a68f65152d56fa4a85dc7" alt="amazon-connect-instance" width="912" height="399" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/amazon-connect-instance_10.png" />

4. Enable all required options under the **Telephony Options** section.
   <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/telephony-options_11.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=d0a555b37858769ad26c3bf4afdbd0ab" alt="telephony-options" width="1578" height="887" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/telephony-options_11.png" />

5. Go to **Approved origins**, and add the domain(s) where you have hosted your CCP instance(s).
   <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/approved-origins_12.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=e0a794d3a80b8d08b5d37548e093ddee" alt="approved-origins" width="1382" height="470" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/approved-origins_12.png" />

6. Purchase/claim a **phone number** from Amazon Connect. Use [this guide](https://docs.aws.amazon.com/connect/latest/adminguide/ag-overview-numbers.html) for reference.
   <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/claim-phone-number_13.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=a44827b3dd8a0ddd8e660fe3ab7e0625" alt="claim-phone-number" width="1818" height="700" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/claim-phone-number_13.png" />

7. Create or import a contact flow in the Amazon Connect instance. Refer to [this article](https://docs.aws.amazon.com/connect/latest/adminguide/contact-flow-import-export.html) for help.
   <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/import-contact-flow_14.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=99ae6d981dd95dc9b6d210cffdbfe53f" alt="import-contact-flow" width="1770" height="849" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/import-contact-flow_14.png" />

8. Import the contact flow from this [link](https://raw.githubusercontent.com/Koredotcom/korecc-twilio/master/AmazonConnect/flows/CCP-voice/KVSAgentAssist_CCP.json).

9. Click **Set contact attributes**, and enter the required fields:

   * **BotID**: Your Agent AI Bot ID.
   * **ClientId**: Your Agent AI Client ID.
   * **ClientSecret**: Your Agent AI Client Secret.
   * **SipUri**: Add `sip:XXXX@savg-us-prod-sbc-in-nlb-0d9a4c651955ff47.elb.us-east-1.amazonaws.com` and replace **XXXX** with your SIPREC Configuration of Agent AI.

   To get the SIP URI from Agent AI:

   1. Go to **Agent AI** > **Flows & Channels**, and click **Voice Gateway**.

   2. Click **SIP Numbers** > **Configure SIP Trunk**.

   3. On the **Configure SIP Trunk** page, in the **Product Selection** section, select **Agent AI**.

   4. Click the **Copy** button next to the **SIP URI** field.
      <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/configure-sip-trunk_15.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=a002c475bf4c7732c030ae3e2e24d0c6" alt="configure-sip-trunk" width="682" height="813" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/configure-sip-trunk_15.png" />

   5. Paste the copied SIP URI value into the **contact attributes sipUri** field in the Amazon Connect flow.

   To get the **agentassistURL** and **accountID** values:

   1. **agentassistUrl**: Your **Agent AI URL**.

   2. **wssUrl**: Add "wss\://savg-webserver.kore.ai".

   3. **accountId**: Your Agent AI **Account ID**.

   4. **languageCode**: Add "en".
      <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/set-contact-attributes_16.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=d9bf021954cb3e8fd9d5a8bf847c0e8c" alt="set-contact-attributes" width="658" height="916" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/set-contact-attributes_16.png" />

   5. Click **Save**.

   6. Click **Start Stream and Transcription in Kore** Lambda.
      <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/invoke-aws-lambda-function_17.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=c4b8554e396c8c4223a81ba9698cc6e3" alt="invoke-aws-lambda-function" width="498" height="912" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/invoke-aws-lambda-function_17.png" />

   7. Select your **Trigger Lambda Function** from the dropdown list, and select the first function created in the [initial step](#function-1-kvs-trigger-choose-any-other-name).

   8. Click **Save**.

   9. For **Transfer to Flow**, select a flow to route the user to. For example, save [KVSQueueFlow.json](/ai-for-service/agentai/integration/amazon-connect-voice/amazon-connect-with-agentai-voice-via-aws-third-party-applications#kvsqueueflowjson) in a file, import this flow to **Flows**, and add **Queue** details for routing.

   10. 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, 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.</Note>

   11. Click **Save** and publish the flow.

10. Attach the contact flow to the purchased phone number. Refer to [Attach a claimed or ported phone number to a flow](https://docs.aws.amazon.com/connect/latest/adminguide/associate-claimed-ported-phone-number-to-flow.html) for help.
    <img src="https://mintcdn.com/koreai/iAIEpL1zgi354c1D/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/amazon-connect-phone-number_18.png?fit=max&auto=format&n=iAIEpL1zgi354c1D&q=85&s=9c7644234e5093ac6a0e4101c98d17ef" alt="amazon-connect-phone-number" width="1838" height="663" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/amazon-connect-phone-number_18.png" />

11. Use the phone number to test the Amazon Connect CCP solutions with the Agent AI widget.

### Contact Control Panel (CCP) as Agent Desktop

* The CCP solution is hosted at [https://agentassist.kore.ai/integrations/amzn/ccp-voice/](https://agentassist.kore.ai/integrations/amzn/ccp-voice/). Use this URL to load your Amazon Connect instance and Agent AI on the same page.
* First-time users are redirected to the [configure](https://agentassist.kore.ai/integrations/amzn/ccp-voice/configure/) page, where they must paste the copied API Gateway URL.
* After pasting the URL and clicking **SAVE DETAILS**, you are redirected to the CCP screen and a dummy Agent AI widget loads. Sign in with your Amazon Connect credentials to make the Amazon Connect CCP visible.
* Amazon Connect Contact Control Panel is used as the Agent Desktop to track new conversations on the client side and render the conversation-specific Agent AI widget.
  <img src="https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/agentai-widget_20.png?fit=max&auto=format&n=IaMQplULZvUirzb0&q=85&s=726bc611175e6a42e7c13ffbb0f37e95" alt="agentai-widget" width="1848" height="932" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-voice/images/agentai-widget_20.png" />

<Note>Customers can host the above integration solution within their own domain by obtaining the Integration SDK from their representative.</Note>
