This assistant app understands multiple languages and aims to provide self-service support through natural conversation or voice messages for common travel issues, present in this documentation. You can check the status of your flights, as well as data related to your trip using your reservation number or passenger identification.
And the best... ready to deploy using AWS Cloud Development Kit.
β AWS Level: Intermediate - 200
Prerequisites:
π° Cost To Complete:
- Amazon Bedrock Pricing
- Amazon Lambda Pricing
- Amazon DynamoDB Pricing
- Amazon Kendra Pricing
- Amazon ApiGateway
- Amazon Transcribe Pricing
- Whatsapp pricing
1- Get Started with the New WhatsApp Business Platform
2- How To Generate a Permanent Access Token β WhatsApp API
3- Get started with the Messenger API for Instagram
β Clone the repo
git clone https://github.com/build-on-aws/elevating-customer-support-with-rag-langchain-agent-bedrock-dynamodb-and-kendra.git
β Go to:
cd re-invent-agent
β Create The Virtual Environment: by following the steps in the README
python3 -m venv .venv
source .venv/bin/activate
for windows:
.venv\Scripts\activate.bat
β Install The Requirements:
pip install -r requirements.txt
β Set Values:
In customer_support_bot_stack.py edit this line with the whatsapp Facebook Developer app number:
DISPLAY_PHONE_NUMBER = 'YOU-NUMBER'
This agent maintains the history of the conversation, which is stored in the session_tabble Amazon DynamoDB table, also have control session management in the session_active_tabble Amazon DynamoDB table, and sets the time here in this line:
if diferencia > 300: #session time in seg
Tip: Kenton Blacutt, an AWS Associate Cloud App Developer, collaborated with Langchain, creating the Amazon Dynamodb based memory class that allows us to store the history of a langchain agent in an Amazon DynamoDB.
Follow steps here
β Synthesize The Cloudformation Template With The Following Command:
cdk synth
β π The Deployment:
cdk deploy
β Review what is deployed in the stack:
- Go to the AWS Cloudformation console, select the region where you deployed and click on
CustomerSupportBotStack:
Then go to the resources tab and explore what's deployed:
β Wait a few minutes:
This stack automatically creates an Amazon Kendra Index with the data source that contains the Q&A database of the airline "La inventada", you must wait a few minutes for all the data to be synchronized.
Go to AWS Secrets Manager and edit the WhatsApp settings and replace them with Facebook Developer settings.
β Q&A:
You can start asking for customer service information as if it were an airline customer service line.
β Passenger information:
The CDK stack creates the dynamoDB table named Passenger_ID with the sample passenger dataset from Kaggle. Select one and request information regarding it. What if I now change the language and ask the AI in Spanish?
The multilanguage function depends on the LLM you use.
β Send it voice notes:
Amazon Transcribe is able to automatically identify the languages spoken in your media without you having to specify a language code.
π Keep testing the agent, play with the prompt in this Amazon Lambda function and adjust it to your need.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.







