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!
- Python 3.10 or higher (the default macOS Python 3.9 is too old)
- Homebrew (for installing Python on macOS)
brew install python@3.11# Create the virtual environment
/opt/homebrew/bin/python3.11 -m venv .venv
# Activate it
source .venv/bin/activatepip install -r requirements.txtOr install strands-agents directly:
pip install strands-agentspython -c "import strands; print('strands-agents installed successfully!')"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/activateSet your AWS profile
export AWS_PROFILE=AeroAvaPowerUserYour prompt will show (.venv) when activated.
Start the agent
python react-chat-agent.pyThen just type your questions! Type quit, exit, q, or press Ctrl+C to stop.
When finished with runtime deactivate
deactivate