/aws-qa-agent-with-bedrock-kendra-and-memory

Agent with memory capable of following a more fluid conversation 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.

Primary LanguagePythonMIT No AttributionMIT-0

RAG with history memory agents using Amazon Bedrock, Amazon Kendra, Amazon Lambda Function, and Amazon DynamoDB qa-agent-with-bedrock-kendra-and-history-memory

πŸ‡»πŸ‡ͺπŸ‡¨πŸ‡± Dev.to Linkedin GitHub Twitter Instagram Youtube Linktr


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/elizabethfuentes12/aws-qa-agent-with-bedrock-kendra-and-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.


🚨 Did you like this blog? πŸ‘©πŸ»β€πŸ’» Do you have comments?🎀 tell me everything here


Β‘Gracias!

πŸ‡»πŸ‡ͺπŸ‡¨πŸ‡± Dev.to Linkedin GitHub Twitter Instagram Youtube Linktr


Security

See CONTRIBUTING for more information.

License

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