Skip to content

build-on-aws/qa-agent-with-bedrock-kendra-and-history-memory

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.

Digrama parte 1

AWS Level: Intermediate - 200

Prerequisites:

💰 Cost To Complete:

Let's build!

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:

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

Digrama parte 1

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

Digrama parte 1

Choose the Test tab.

Digrama parte 1

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"
}

Digrama parte 1

Saved event and Test.

Check the response when finished.

Digrama parte 1

When we ask for ID, the agent consults Amazon DynamoDB

Digrama parte 2

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.


¡Gracias!


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

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published