You will turn Python code into a professional Web Chatbot GUI (Graphical User Interface) that is user-friendly (similar to the ChatGPT interface) in just a few minutes.
We use:
Part I: Configure AWS Credentials
Step 1: Install AWS CLI
Open Terminal on your computer.
# macOS
brew install awscli
# Linux
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Step 2: Configure credentials
aws configure
Enter the information when prompted:
YOUR_ACCESS_KEYYOUR_SECRET_KEYus-east-1jsonStep 3: Verify configuration
# Check credentials
aws sts get-caller-identity
# Check Bedrock connection
aws bedrock-agent-runtime list-knowledge-bases --region ap-southeast-1
Security notes:
Required permissions:
IAM User needs the following permissions:
bedrock:InvokeModelbedrock:RetrieveAndGeneratebedrock:Retrieves3:GetObject (for Knowledge Base)Troubleshooting:
Error “Unable to locate credentials”:
aws configure againError “AccessDeniedException”:
Error “ExpiredToken”:
Part II: Clone Project from pre-made GitHub
Step 1: Access the following GitHub link
Please download and open the folder above using Visual Studio Code:
https://github.com/DazielNguyen/chatbot_with_bedrock.git
Step 2: Install libraries and Python environment
Install environment:
python3 -m venv .venvpython -m venv .venvActivate environment:
source .venv/bin/activate.venv\Scripts\activateInstall libraries:
pip install -r requirements.txtStep 3: Get the ID of the created Knowledge Base


Step 4: Run Streamlit - Chatbot UI and Experience
streamlit run start.py


Congratulations on successfully building a Web Chatbot built with Amazon Bedrock