Open-source project
awslabs/amazon-bedrock-agent-samples avatar
awslabs/amazon-bedrock-agent-samples

Amazon Bedrock Agent Samples: Practical Examples for Bedrock Agents and Multi-Agent Collaboration

Example Jupyter notebooks πŸ““ and code scripts πŸ’» for using Amazon Bedrock Agents πŸ€– and its functionalities

813 stars283 forksPythonApache-2.0

At a glance

What is it?
The awslabs/amazon-bedrock-agent-samples repository is an Apache-2.0 collection of Jupyter notebooks and Python scripts for experimenting with Amazon Bedrock Agents. It is explicitly marked as experimental and educational, not for production, and was last pushed on 2026-04-05.
Who is it for?
This repository suits developers learning Amazon Bedrock Agents who want working code to read, run, and adapt. It is not for production: the README's caution notice states examples are for experimental and educational purposes only and instructs users to implement Bedrock Guardrails before any production deployment.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 177 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Amazon Bedrock Agents Are and What This Repository Provides

Amazon Bedrock Agents is an AWS service that lets you create AI-powered assistants capable of calling APIs, querying knowledge bases, and executing multi-step workflows without managing a separate orchestration server. An agent receives a user request, reasons about which action to take, calls the appropriate tool or API, and returns a result.

This repository does not implement an agent framework; it demonstrates how to use Amazon Bedrock Agents through practical code examples. Each example in `examples/agents/` and `examples/multi_agent_collaboration/` is a self-contained directory with its own README that describes the pattern it demonstrates and the deployment steps. The shared utilities in `src/` provide helper classes that the examples reuse, reducing boilerplate in each individual notebook.

What Is an Amazon Bedrock Agent?

An Amazon Bedrock agent is a configured AI assistant that uses a foundation model from Bedrock (such as Claude) to understand user intent and take actions through Action Groups, which are Lambda functions or API schemas the agent can invoke. Agents can also query a Knowledge Base backed by a vector store for retrieval-augmented generation.

The README describes Amazon Bedrock Agents as enabling you to automate complex workflows, build robust and scalable end-to-end solutions from experimentation to production, and quickly adapt to new models and experiments.

Multi-agent collaboration extends this: a supervisor agent can direct other specialised agents, route between them based on detected intent, and fall back to a different mode when a single intention cannot be identified. Bedrock provides traces so developers can observe agent behaviour through multi-agent flows, and it applies Bedrock Guardrails, security, and privacy consistently across agent calls.

Repository Layout: Examples, Shared Modules, and Utilities

The repository is organised into three areas. The `examples/agents/` directory holds standalone agent examples, each in its own subdirectory. The `examples/multi_agent_collaboration/` directory holds multi-agent examples, also self-contained. The `src/` directory provides shared code used across examples.

The README documents the structure:

bash
β”œβ”€β”€ examples/agents/
β”‚   β”œβ”€β”€ agent_with_code_interpretation/
β”‚   β”œβ”€β”€ user_confirmation_agents/
β”‚   β”œβ”€β”€ inline_agent/
β”œβ”€β”€ examples/multi_agent_collaboration/
β”‚   β”œβ”€β”€ 00_hello_world_agent/
β”‚   β”œβ”€β”€ devops_agent/
β”‚   β”œβ”€β”€ energy_efficiency_management_agent/
β”œβ”€β”€ src/shared/
β”‚   β”œβ”€β”€ working_memory/
β”‚   β”œβ”€β”€ stock_data/
β”‚   β”œβ”€β”€ web_search/
β”œβ”€β”€ src/utils/
β”‚   β”œβ”€β”€ bedrock_agent_helper.py
β”‚   β”œβ”€β”€ bedrock_agent.py
β”‚   β”œβ”€β”€ knowledge_base_helper.py

The `src/shared/` module contains reusable Action Group tools: Web Search, Working Memory, and Stock Data Lookup. The `src/utils/` module provides `bedrock_agent_helper.py` and `knowledge_base_helper.py`, which offer a higher-level abstraction over the raw boto3 API. The README notes that examples can also be built using the C++, Go, Java, JavaScript, Kotlin, .NET, PHP, Ruby, Rust, SAP ABAP, or Swift AWS SDKs, though the examples here use Python.

What People Use Amazon Bedrock For: Example Patterns

The README lists 16 agent examples that illustrate different Amazon Bedrock capabilities.

The `agent_with_code_interpretation` example demonstrates analyst assistant behaviour where the agent can write and execute code as part of its reasoning. The `agent_with_long_term_memory` example shows how to persist agent memory across sessions. The `inline_agent` example configures a Bedrock agent at runtime rather than through the console, which is useful for dynamic agent configuration.

For multi-agent collaboration, examples include a DevOps agent, an energy efficiency management agent, and a startup advisor agent. These run under either supervisor mode, where a top-level agent directs subagents to complete complex tasks, or supervisor with routing mode, where built-in intent classification determines which subagent should handle a request. A `00_hello_world_agent` example provides a minimal starting point for first-time users.

The `agent_with_guardrails_integration` example demonstrates Bedrock Guardrails in practice. The README caution at the top specifically mentions prompt injection protection through Bedrock Guardrails as a prerequisite for any production deployment.

Can You Give Me an Example of Bedrock? Getting Started

The README's getting-started instructions are three steps. Navigate to `src/` for shared module setup details. Then navigate to the example you want in `examples/*/`. Follow the deployment steps in the `README.md` of that specific example.

Each example's README documents its own prerequisites, IAM permissions, and deployment method. Some examples deploy infrastructure using AWS CDK (the `cdk_agent` example) while others use CloudFormation or direct boto3 calls. The `agent_observability/` directory under `examples/` addresses tracing and monitoring across agent calls.

Because each example is self-contained, there is no top-level installer. The starting point is always the specific example subdirectory. The shared utilities in `src/` should be reviewed before running any example that references them, since some examples depend on those modules being available in the Python path.

Limitations: Experimental Status, Prompt Injection Risk, and Last Push Date

The README begins with a CAUTION block: examples are for experimental and educational purposes only, are not intended for direct use in production environments, and require Amazon Bedrock Guardrails to protect against prompt injection. This is not boilerplate; prompt injection is a real risk in agent systems where user input reaches the model alongside tool descriptions and memory.

The last push was on 2026-04-05, which is about six months before the current date. The repository has no GitHub releases. Active AWS Labs repositories tend to receive frequent updates as the underlying Bedrock service evolves, so some examples may reference patterns or API calls that have been superseded by newer Bedrock capabilities.

The examples require active AWS accounts with Bedrock enabled in a supported region. Running them incurs AWS charges for model inference, Lambda execution, and any additional services (S3, DynamoDB, Bedrock Knowledge Bases) the example provisions. The README does not provide cost estimates for running specific examples.

Comparing Amazon Bedrock Agents to LangGraph

LangGraph is an open-source framework from the LangChain team for building stateful, multi-step AI agents. It provides a graph-based abstraction where nodes are agent steps and edges represent transitions, and it can orchestrate tool calls, branching logic, and human-in-the-loop interrupts. LangGraph runs anywhere Python runs and integrates with any LLM API.

Amazon Bedrock Agents is a managed AWS service. The orchestration logic, action group invocation, and knowledge base retrieval run on AWS infrastructure. This means less code to write and maintain for the orchestration layer, but tighter coupling to AWS. Bedrock Agents requires Lambda functions for action groups and an AWS account; LangGraph has no such prerequisite.

For teams already committed to AWS infrastructure, Bedrock Agents provides a first-party managed agent runtime with Guardrails, tracing, and IAM integration. For teams that want provider flexibility or that need to run agents in environments without AWS access, LangGraph is the more portable option.

Editorial conclusion

This repository suits developers learning Amazon Bedrock Agents who want working code to read, run, and adapt. It is not for production: the README's caution notice states examples are for experimental and educational purposes only and instructs users to implement Bedrock Guardrails before any production deployment. Before starting, confirm your AWS account has Bedrock access enabled in your region and that your IAM role has the permissions the specific example's README requires.

Frequently asked questions

What is an Amazon Bedrock agent?

An Amazon Bedrock agent is a configured AI assistant that uses a Bedrock foundation model to understand user requests and take actions through Action Groups (Lambda functions or API schemas) and Knowledge Bases. The README describes agents as enabling automation of complex workflows from experimentation to production.

Can you give me an example of Bedrock?

The repository contains 16 agent examples including a code-interpretation analyst assistant, an inline agent configured at runtime, an agent with long-term memory, and a computer use agent. Multi-agent examples include a DevOps agent and a startup advisor. Each example lives in its own subdirectory with deployment instructions.

What do people use Amazon Bedrock for?

Amazon Bedrock is used to build AI-powered assistants that automate complex workflows, query knowledge bases for retrieval-augmented generation, and coordinate multiple specialised agents. This repository demonstrates patterns including code interpretation, user confirmation flows, guardrails integration, and multi-agent task routing.

Official sources

  1. awslabs/amazon-bedrock-agent-samples on GitHub
  2. Issues
  3. License: Apache-2.0
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/awslabs-amazon-bedrock-agent-samples.svg)](https://hysenlabs.com/projects/awslabs-amazon-bedrock-agent-samples)