RAG with history memory agents using Amazon Bedrock, Amazon Kendra, Amazon Lambda Function, and Amazon DynamoDB
🚨🚨🚨🚨🚨🚨🚨🚨 This repo is deprecated, learn how to build these types of applications in https://github.com/build-on-aws/rag-postgresql-agent-bedrock 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
In this repository you will find a use cases of RAG on AWS using CDK.
Additionally, you will find a notebook where you can run the agent localy.
Multilingual (limited to the LLM you use) agent with memory capable of following a more fluid conversation (learn more about using memories with agents here) to query the re:invent 2023 agenda by session ID or by description or general information, it also recommend a list of sessions according to your input.
✅ AWS Level: Intermediate - 200
Prerequisites:
💰 Cost To Complete:
✅ Clone the repo
git clone https://github.com/build-on-aws/qa-agent-with-bedrock-kendra-and-history-memory.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
✅ 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
ReInventAgentStack
:
Then go to the resources tab and explore what's deployed:
✅ Test The Agent Locally: Here
✅ Test The Agent:
Go to the Lamnda Function console, serarch and choose the lambda function that starts with the name ReInventAgentStack-Fnagent
Choose the Test tab.
Under Test event, choose Create new event, in Event Json create a event like this:
{
"prompt": "I'm looking for a session about generative ai",
"session_id": "1"
}
Saved event and Test.
Check the response when finished.
When we ask for ID, the agent consults Amazon DynamoDB
In this notebook you can find the code to test locally.
Play with the agent and improve the prompt, remember that he has memory storage and you can have a fluid conversation with it.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.