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.

 Figure 1.a: Solution architecture – conversation flows in the order from A through G.


Figure 1.a: Solution architecture – conversation flows in the order from A through G.

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.

Figure 1.b: Sequence diagram that illustrates how the customer interaction flows and processed by different AWS services.

Figure 1.b: Sequence diagram that illustrates how the customer interaction flows and processed by different AWS services.

Prerequisites

For this walkthrough, you should have the following prerequisites:

Deployment steps

For deploying the solution, execute the following steps in the same region where your Amazon Connect instance is deployed:

      1.  Using Git, clone the repository from GitHub
        git clone https://github.com/aws-samples/amazon-connect-chat-with-custom-participants
      2.  Get the ARN of your Amazon Connect Instance which will be used to host the chat flow.
      3.  In your terminal, move into the root directory
        cd amazon-connect-chat-with-custom-participants
      4. Set the environment variables with your AWS credentials
      5.  Install the dependencies for the CDK project and Bootstrap the CDK environment
        npm ci
        cdk bootstrap
      6.  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.
        cdk deploy AmazonConnectCustomBotStack --parameters instanceArn=INSTANCE_ARN
        
      7. 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)

        Figure 2: Custom Bot Example Contact Flow.

        Figure 2: Custom Bot Example Contact Flow.

      8. 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.
Figure 3: Claude model access

Figure 3: Claude model access

        • On edit model access page, filter for “claude”, select the “claude” model and click Next.

          Figure 4: Request model access

          Figure 4: Request model access

        • Review and click on “submit”

          Figure 5: Review and submit screen

          Figure 5: Review and submit screen

Test the solution

Once installed you can use the test chat within the Amazon Connect console using the below steps:

  1. Login to your Amazon Connect instance and from the home screen click on “Test Chat”
  2. Click “Test Settings”
  3. Select the contact flow “Custom Bot Example”
  4. Click “Apply”
  5. 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.

Figure 8: Example chat interaction

Figure 8: Example chat interaction

Cleaning up

To avoid incurring future charges, delete the resources using following steps:

  1. In your terminal, move into the root directory
    cd amazon-connect-chat-with-custom-participants
  2. Set the environment variables with your AWS credentials
  3. Run the below CDK command to delete the stack, and then select “y” to confirm the deletion:
    cdk destroy AmazonConnectCustomBotStack
  4. 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.

Meet the Authors

Amit Bagga

Amit Bagga

Amit Bagga is an Amazon Connect Specialty Consultant with Amazon Web Services Professional Services group. With over 15 years of contact center experience, Amit is passionate about diving deep with customers in building solutions that is simple but yet powerful and most importantly delivers the utmost customer benefit.

Michael Goligorsky

Michael Goligorsky

Michael Goligorsky is a Senior Solutions Architect with Amazon Web Services. With 25+ years of enterprise IT experience in Fortune 100 companies, Michael is passionate about diving deep with customers to architect creative solutions to some of the most complex challenges in cloud computing. In his spare time, he can be found traveling the world with his family.

Charles Phillips

Charles Phillips

Charles Phillips is a Senior Specialty Consultant with over 20 years of experience developing web applications and contact center solutions. Leveraging his deep technical knowledge and extensive experience, he ensures customers receive solutions tailored to both their current needs and future growth. As part of the AWS Professional Services group, Charles specializes in providing Amazon Connect contact center solutions customized for each client’s unique requirements.

Karl White

Karl White

Karl White is a Senior Amazon Connect Specialty Consultant within the Amazon Web Services (AWS) Professional Services group. With 23 years of experience in the contact center domain, Karl has dedicated his career to the art and science of customer engagement. He is passionate about leveraging Amazon Connect to craft dynamic, configuration-driven experiences to solve complex customer problems.