First Cloud Journey Cloud Day - Generative AI Call Center
This guide provides step-by-step instructions to create a call center solution that integrates Amazon Bedrock as an AI assistant and uses OpenAI's Whisper model for real-time voice-to-text transcription. The implementation will utilize Amazon SageMaker to deploy Whisper and Amazon Bedrock to enhance the interaction with AI-driven responses.
Table of Contents
Prerequisites
or using
git clone https://github.com/vuongbachdoan/fcj-cd-demo.git
Before getting started, ensure you have the following:
-
An AWS account with access to:
- Amazon Connect
- Kinesis Video Stream
- Bedrock
- SQS
- Lambda
- SageMaker
- DynamoDB
Basic knowledge of Python, Jupyter Notebook, and familiarity with AWS services.
AWS CLI and SageMaker Studio set up on your machine.
Architecture Overview
Setup Instructions
Step 1: Create Whisper Endpoint
About Whisper
The Whisper endpoint is a powerful tool for speech recognition, offering extensive capabilities for transcription and understanding spoken language across various applications. It leverages advanced machine learning techniques to deliver accurate and efficient transcriptions.
How it Works
The Jupyter notebook deploys a SageMaker endpoint with a custom inference script similar to this example in the SageMaker SDK documentation. The components required to deploy a pre-trained model to an endpoint in SageMaker are:
- A serialized model artifact (tar file) in Amazon S3.
- The code and requirements that run inference.
These components are packaged into a SageMaker endpoint, which serves the serialized model with custom code behind it as an API. See the architecture below for a visual description.
Setup SageMaker Notebook
- Navigate to the SageMaker dashboard.
- Go to Application and IDEs > Notebooks in the left sidebar.
- Click Create notebook instance and complete the following configurations:
- For Notebook instance name, enter a unique name.
- For Notebook instance type, choose ml.m5.2xlarge.
- Expand Additional configuration and set the Volume size in GB to 10GB.
- Leave other fields as default.
- Wait until the status of the notebook instance changes to In service before using the instance.
- Open JupyterLab to run your notebook.
Run Notebook
- Navigate to the
/whisper
folder in your current repository. - Copy all files and folders, upload them to the current notebook, and run the notebook.
- It is recommended to run every cell one by one.
- The folder structure will look like this:
You will have an endpoint named whisper-endpoint under Inference > Endpoints.
Step 2: Deploy Lambda Function
- Navigate to
/amazon-connect
in your current repository. -
Run the following command on your local computer:
aws configure
Then enter your AWS Access Key ID, AWS Secret Access Key, and Default region name (us-west-2).
-
Clone the repository:
git clone https://github.com/vuongbachdoan/fcj-cd-demo.git cd amazon-connect
-
Create a
.env
file:
cat << EOF > .env WHISPER_ENDPOINT="whisper-endpoint" EOF
-
Execute the following script once:
./scripts/create_deployment_bucket.sh dev
-
To deploy, execute this script as often as required:
./scripts/serverless_deploy.sh dev
-
Set up a contact flow that starts media streaming and passes the following parameters to the ProcessStream Lambda:
-
kvsStreamArn
: the stream ARN from the contact attribute in Connect. -
kvsStartFragment
: the KVS start fragment number from the contact attribute in Connect.
-
-
Add any Lambda functions used to the Amazon Connect instance. The
ContactId
is fetched from the standard request attribute:
event.Details.ContactData.ContactId
This should start populating an IVR real-time transcript into DynamoDB.
Enable KVS media streaming in your Amazon Connect instance and set a sane retention period for KVS (24 hours minimum during testing).
Step 3: Set Up Amazon Connect Flow
- Access your Amazon Connect instance with your account credentials.
- Create a flow using the template located at
amazon-connect/contact_flow/prsv-aws-connect-flow.json
. - Claim a phone number by navigating to Phone numbers > Voice > Toll free > Choose the flow you imported previously.
- You're all set! Call your contact center now.
DEMO
https://github.com/user-attachments/assets/dfa474e0-186e-428e-873c-f7f2c991da4d
ð Congratulations! ð
In this workshop, you have learned how to implement a call center using Amazon Connect and Generative AI. Youâve gained valuable insights into setting up efficient customer support systems that leverage cutting-edge technology to enhance user experience.
Feel free to ask me any questions about this solution! Connect with me on LinkedIn.