aws-samples/amazon-bedrock-samples

This repository contains examples for customers to get started using the Amazon Bedrock Service. This contains examples for all available foundational models

What this project is

amazon-bedrock-samples is a GitHub repository from AWS that contains ready-made code examples for Amazon Bedrock, AWS's service for building generative AI applications. The examples are meant to help customers get started quickly with the service.

The repository also powers a companion website (linked in the README) that presents the same content in a more browsable format.

What's inside

The repo is organized into folders, each covering a different topic:

  • Introduction to Bedrock — basics of the service
  • Prompt Engineering — tips for writing effective prompts
  • Agents — building generative AI agents and their components
  • Custom Model Import — bringing your own models into Bedrock
  • Multimodal — working with multimodal data
  • Generative AI Use cases — example applications
  • Retrieval Augmented Generation (RAG) — implementing RAG
  • Responsible AI — using Bedrock responsibly and ethically
  • Workshops — workshop materials
  • POC to Prod — moving workloads from proof-of-concept to production
  • Embeddings — using Bedrock's embedding models
  • Observability & Evaluation — monitoring and evaluating models and applications

Each folder has its own README with detailed instructions.

How to use it

  1. Make sure you have access to Amazon Bedrock (you need an AWS account).
  2. Clone the repository.
  3. Navigate to the folder for the topic you're interested in and follow its README.

Permissions you'll need

The AWS identity you use (for example, a SageMaker notebook execution role, or an IAM role/user for self-managed notebooks) must have IAM permissions to call Amazon Bedrock. The README shows how to attach an inline policy granting full Bedrock access (the bedrock:* action on all resources).

Two important caveats from the README:

  • If you use SageMaker, your notebook execution role is typically separate from the console user/role you log in with. You'll need to grant Bedrock permissions to your console identity too if you want to explore the Bedrock console.
  • For changes to top-level folders, you should contact the GitHub maintainers.

Contributing and license

  • Community contributions are welcome — see CONTRIBUTING.md for guidelines.
  • Security issues are handled per the instructions in CONTRIBUTING.md.
  • The project is licensed under the MIT-0 License (see the LICENSE file).

Related

  • Project
  • Project
  • Project
  • Project