Skip to content

ava-collins/bedrock-react-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bedrock-react-chat

Demo

Watch the demo video

How it works

User Question → Agent → search_react_docs tool → Bedrock KB (Y3DV2SUPP9) → S3 React Docs → Answer

The agent will use RAG to search React documentation in S3 and provide answers based on the retrieved content!

Setup Instructions

Prerequisites

  • Python 3.10 or higher (the default macOS Python 3.9 is too old)
  • Homebrew (for installing Python on macOS)

1. Install Python 3.11 (macOS)

brew install python@3.11

2. Create and activate virtual environment

# Create the virtual environment
/opt/homebrew/bin/python3.11 -m venv .venv

# Activate it
source .venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

Or install strands-agents directly:

pip install strands-agents

Verify Installation

python -c "import strands; print('strands-agents installed successfully!')"

Usage

NOTE This demo requires an AWS SSO connection to an account with a Bedrock Knowledge Base, see .env_example for required params.

Login with AWS CLI at https://d-90661d9b10.awsapps.com/start

Set a profile with name to be used in AWS_PROFILE var below

Each time you open a new terminal, activate the virtual environment:

source .venv/bin/activate

Set your AWS profile

export AWS_PROFILE=AeroAvaPowerUser

Your prompt will show (.venv) when activated.

Start the agent

python react-chat-agent.py

Then just type your questions! Type quit, exit, q, or press Ctrl+C to stop.

When finished with runtime deactivate

deactivate

About

Demo app for AWS Bedrock

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages