This sample repository accompanies a hands-on workshop, aimed at developers and solution builders, introducing how to leverage AI foundation models through Amazon Bedrock on AWS.
Find the full guided instructions for the workshop at: https://catalog.workshops.aws/amazon-bedrock
The code samples are organized into numbered sub-folders corresponding to the modules of the workshop.
To get started, you'll first need to set up your AWS Account and the development environment where you'll run the samples. In AWS-hosted events, these may already be provided for you.
For full instructions, refer to the workshop introduction and the prerequisites steps. At a high level, you'll need:
- Access to an AWS Account with AWS IAM permissions for:
- Amazon Bedrock for all labs (including AWS Marketplace permissions to subscribe to new models)
- Amazon OpenSearch Serverless and Amazon S3 for knowledge base / RAG-related labs
- Amazon Bedrock AgentCore, AWS CloudFormation, Amazon DynamoDB, and AWS IAM access for agent-related labs
- A development environment with:
- AWS CLI access configured with the access above
- (Recommended) uv installed, for Python version and Python virtual environment management
- Python 3.11+
- This repository downloaded, for example by running,
git clone https://github.com/aws-samples/amazon-bedrock-workshop
⚠️ Cost warning: Running these samples in your own AWS Account will incur costs!Refer to the workshop website for more details, and be sure to run cleanup steps promptly when you're finished experimenting, to avoid unnecessary cost.
The main required libraries for the workshop are detailed in pyproject.toml.
If you're at an AWS-led event where a temporary account and VS Code Server instance has been provided for you, these dependencies will already be installed in an environment at .venv in this folder: you can skip to the next section.
If you're using uv in your own local IDE (like Kiro or VSCode), you can perform the same setup by opening a terminal and running:
uv venv .venv
uv sync --all-extras --all-groupsIf you're using plain pip with some other tool for managing environments, you can run:
pip install .[all]For a lighter footprint, you could instead choose to install only the extras for the lab(s) you want to follow. For example, pip install .[lab2,lab4].
The lab exercises make extensive use of .ipynb Python notebook files.
Notebooks bring together rich formatted explanations with interactive code "cells" that run against a live Python interpreter environment. You can run each cell of code by selecting it and either pressing Shift+Enter on the keyboard, or clicking the
When you first open or run a code cell in a notebook, you may be asked to select a kernel. If so, choose: Python Environments > .venv (.venv/bin/python)
If you don't see this option, check that the .venv folder has been created and follow the "Install dependencies" instructions above if needed. If using your own local IDE like VSCode or Kiro, check you've installed the recommended extensions for Jupyter and Python environment discovery. If you're at an AWS-led event and need help, don't hesitate to ask one of your facilitators!
When you're ready, why not go ahead and try running the first notebook:
Keen to explore further beyond this workshop? Check out:
- aws-samples/amazon-bedrock-samples for a more comprehensive range of code and notebook samples covering different features and use-cases of Amazon Bedrock
- The Amazon Bedrock User Guide for detailed documentation
- The AI category in the AWS Solutions Library
If you're building solutions powered by generative and agentic AI, it's also well worth exploring Amazon Bedrock AgentCore - a unified platform to build, connect, and optimize AI agents!
We welcome community contributions! Please see CONTRIBUTING.md for more information.