AWS Contact Center
Make your Amazon Connect chat experience more engaging with custom participants and generative AI-powered chatbots
Today’s customers demand more than just quick answers. They want interactions that feel natural, intuitive, and tailored to their individual preferences. Generative artificial intelligence (AI) offers the potential to transform customer service by empowering agents with intelligent tools that can understand complex queries, generate human-like responses, and even anticipate future customer needs. Customers have invested in building external systems that use generative AI to enhance and streamline customer experiences. Integrating Amazon Connect chat with third-party AI allows customers to extend their in-house generative AI applications and provide a seamless experience.
By integrating Amazon Connect chat with Amazon Bedrock or third-party AI tools, businesses can harness the power of generative AI to enhance their customer interactions. This integration allows for sophisticated and natural conversations, enabling companies to provide personalized support that goes beyond simple FAQs.
At Adobe Inc., “building our own bots has been crucial for scaling our Digital Media customer service automation. Amazon Connect’s seamless integration with our in-house bots through custom bot participants has revolutionized our customer experience. By harnessing this innovative feature, we’ve unlocked unprecedented efficiency and agility, empowering our agents to deliver personalized, timely support like never before. With Amazon Connect, our custom bots seamlessly blend into our workflow, ensuring smooth interactions and unparalleled customer satisfaction.”
In this blog post, we will demonstrate the above pattern by integrating an AI virtual agent that is backed by Amazon Bedrock for generative AI-powered messaging using the Claude v2 foundation model into your Amazon Connect chat flows using the recently rereleased CreateParticipant API. Through the integration of custom participants, you’ll be able to infuse a personal touch into your chat conversations, as the same pattern can be extended to integrate with your desired AI tools giving your customers a more personalized experience.
Overview of solution
The architecture (Figure 1.a) integrates the Amazon Connect chat flow with a custom generative AI chatbot powered by the Amazon Bedrock Claude v2 foundation model, enabling AI-driven responses to customer queries via the chat channel. This design enables customers to integrate the Amazon Bedrock Claude v2 foundation model and any 3rd party AI solution of their choice that is supported by Amazon Bedrock.
Deep dive of solution
In the sequence diagram shown below (figure 1.b), end user starts the new Amazon Connect chat flow thereby invoking the “Custom Bot Example” entry contact flow.
The entry flow greets the user and invokes the AWS Lambda Function “StartBot” which is responsible for three main operations: (1) adding the custom participant to the chat (via CreateParticipant API), (2) starting the chat streaming (via StartContactStreaming API with the Amazon Simple Notification Service topic as the streaming endpoint) and (3) initiating the first message back to the customer (via SendMessage API). On successful initialization, the customer and the custom participant are connected to the chat session.
The end user can now interact by asking questions in the chat. The questions are published to the SNS topic and delivered to the chatBot AWS Lambda function via SNS trigger. The chatBot Lambda function posts the customer’s messages as inputs to Amazon Bedrock Claude v2 foundation model (via InvokeModel API) and returns the generative AI-powered responses back to the customer (via SendMessage API).
Lastly, all the chat contacts and participant connection details are stored in the chatContacts Amazon DynamoDB table.
Prerequisites
For this walkthrough, you should have the following prerequisites:
- An AWS account
- Amazon Connect Instance (you will need the ARN of your Amazon Connect instance)
- NodeJS (Long Term Support version v18.20.4 or higher)
- Install Git
- Basic knowledge of Amazon Connect and AWS Cloud Development Kit v2 (AWS CDK)
- Install AWS CDK
Deployment steps
For deploying the solution, execute the following steps in the same region where your Amazon Connect instance is deployed:
-
-
- Using Git, clone the repository from GitHub
- Get the ARN of your Amazon Connect Instance which will be used to host the chat flow.
- In your terminal, move into the root directory
- Set the environment variables with your AWS credentials
- Install the dependencies for the CDK project and Bootstrap the CDK environment
- Run cdk deploy to deploy the solution. Replace INSTANCE_ARN with ARN you captured from step #2. You will be prompted with the summary of IAM changes that this solution will deploy, please type “y” to proceed with the install.
- On completion, following AWS resources will be created in your target AWS account & region where you have your existing Amazon Connect instance.
- AmazonConnectCustomBotStack-startBot: Lambda Function
- AmazonConnectCustomBotStack-bedrockBot: Lambda Function (triggered by SNS topic)
- AmazonConnectCustomBotStack-chatStreaming: SNS topic
- AmazonConnectCustomBotStack-chatContacts: DynamoDB table
- Custom Bot Example: Contact Flow in the provided Amazon Connect Instance. (see figure 2)
- Confirm, your AWS account has access to Amazon Bedrock -> Claude model. To enable use the below steps:
- From AWS console, go to “Amazon Bedrock”.
- Click on left navigation icon and scroll to the bottom, then Select “Model access” under “Bedrock configurations”.
-
-
-
-
- On the right, filter for “Claude” and check the access status. If status says “Available to request” then click on “Enable specific models” from the top. If the status says “Access granted” that means you already have access and you can skip section 10.
-
-
-
-
-
- On edit model access page, filter for “claude”, select the “claude” model and click Next.
- Review and click on “submit”
-
-
Test the solution
Once installed you can use the test chat within the Amazon Connect console using the below steps:
- Login to your Amazon Connect instance and from the home screen click on “Test Chat”
- Click “Test Settings”
- Select the contact flow “Custom Bot Example”
- Click “Apply”
- Test!
Figure 8 shows screenshots of the sample interaction of the chat where Amazon Bedrock is the Custom Participant (the AI bot). It uses Claude foundation model to provide the answers to your questions.
Disclaimer: The response text a customer sees will not 100% match, since this is using non-deterministic models. So, the response for the same below question can be different in your case.
Cleaning up
To avoid incurring future charges, delete the resources using following steps:
- In your terminal, move into the root directory
- Set the environment variables with your AWS credentials
- Run the below CDK command to delete the stack, and then select “y” to confirm the deletion:
- Revoke access to Amazon Bedrock -> Claude model, using below steps
-
- From AWS console, go to “Amazon Bedrock”.
- Click on left navigation icon and scroll to the bottom, then Select “Model access” under “Bedrock configurations
- Click on “Modify model access”.
- Filter for “Claude”, and “uncheck” the checkbox next to “claude”, then click “Next”.
- On review and submit screen, click on “submit.
Conclusion
In this post, we demonstrated how to add custom participants to Amazon Connect chat flows and integrate Amazon Bedrock for generative AI capabilities. This approach can be extended to work with any third-party application that supports APIs—such as surveys, external bots, or CAPTCHAs—allowing businesses to create more personalized and interactive chat experiences for their customers.
This flexibility opens endless possibilities for enhancing customer interactions, from collecting feedback to handling complex inquiries more efficiently. However, there are important considerations, such as ensuring the AI is trained on relevant data, introducing guardrails to maintain response accuracy, and monitoring costs to balance value with investment. With careful planning, these integrations can significantly elevate customer engagement while maintaining control over the interaction quality and costs.