Skip to content

build-on-aws/elevating-customer-support-with-rag-langchain-agent-bedrock-dynamodb-and-kendra

Elevating Customer Support With Rag Langchain Agent Bedrock Dynamodb And Kendra

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.


Digrama parte 1

βœ… AWS Level: Intermediate - 200

Prerequisites:

πŸ’° Cost To Complete:

Step 0: Activate WhatsApp account Facebook Developers

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

Step 1: Previous Configuration

βœ… 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.

Step 2: Deploy The App With CDK.

Follow steps here

βœ… Synthesize The Cloudformation Template With The Following Command:

cdk synth

βœ…πŸš€ The Deployment:

cdk deploy

βœ… Review what is deployed in the stack:

Then go to the resources tab and explore what's deployed:

Digrama parte 1

βœ… 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.

Digrama parte 1

Step 3: Activate WhatsApp Messaging In The App

Go to AWS Secrets Manager and edit the WhatsApp settings and replace them with Facebook Developer settings.

Digrama parte 1

Step 4: Configure Webhook In Facebook Developer Application

Digrama parte 1

LetΒ΄s try!

βœ… Q&A:

You can start asking for customer service information as if it were an airline customer service line.

Digrama parte 1

βœ… 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?

Digrama parte 1

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.

Digrama parte 1

πŸš€ Keep testing the agent, play with the prompt in this Amazon Lambda function and adjust it to your need.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors