Skip to content

awslabs/amazon-bedrock-agentcore-samples

Amazon Bedrock AgentCore Samples

Deploy and operate AI agents securely at scale - using any framework and model

GitHub commit activity GitHub open issues GitHub open pull requests License

DocumentationPython SDKStarter Toolkit Discord

Welcome to the Amazon Bedrock AgentCore Samples repository!

Amazon Bedrock AgentCore is both framework-agnostic and model-agnostic, giving you the flexibility to deploy and operate advanced AI agents securely and at scale. Whether you’re building with Strands Agents, CrewAI, LangGraph, LlamaIndex, or any other framework—and running them on any Large Language Model (LLM)—Amazon Bedrock AgentCore provides the infrastructure to support them. By eliminating the undifferentiated heavy lifting of building and managing specialized agent infrastructure, Amazon Bedrock AgentCore lets you bring your preferred framework and model, and deploy without rewriting code.

This collection provides examples and tutorials to help you understand, implement, and integrate Amazon Bedrock AgentCore capabilities into your applications.

Important

The examples provided in this repository are for experimental and educational purposes only. They demonstrate concepts and techniques but are not intended for direct use in production environments.

🎥 Video

Build your first production-ready AI agent with Amazon Bedrock AgentCore. We’ll take you beyond prototyping and show you how to productionize your first agentic AI application using Amazon Bedrock AgentCore.

📁 Repository Structure

Interactive Learning & Foundation

This folder contains notebook-based tutorials that teach you the fundamentals of Amazon Bedrock AgentCore capabilities through hands-on examples.

The structure is divided by AgentCore component:

  • Runtime: Amazon Bedrock AgentCore Runtime is a secure, serverless runtime capability that empowers organizations to deploy and scale both AI agents and tools, regardless of framework, protocol, or model choice—enabling rapid prototyping, seamless scaling, and accelerated time to market

  • Gateway: AI agents need tools to perform real-world tasks—from searching databases to sending messages. Amazon Bedrock AgentCore Gateway automatically converts APIs, Lambda functions, and existing services into MCP-compatible tools so developers can quickly make these essential capabilities available to agents without managing integrations.

  • Memory: Amazon Bedrock AgentCore Memory makes it easy for developer to build rich, personalized agent experiences with fully-manged memory infrastructure and the ability to customize memory for your needs.

  • Identity: Amazon Bedrock AgentCore Identity provides seamless agent identity and access management across AWS services and third-party applications such as Slack and Zoom while supporting any standard identity providers such as Okta, Entra, and Amazon Cognito.

  • Tools: Amazon Bedrock AgentCore provides two built-in tools to simplify your agentic AI application development: Amazon Bedrock AgentCore Code Interpreter tool enables AI agents to write and execute code securely, enhancing their accuracy and expanding their ability to solve complex end-to-end tasks. Amazon Bedrock AgentCore Browser Tool is an enterprise-grade capability that enables AI agents to navigate websites, complete multi-step forms, and perform complex web-based tasks with human-like precision within a fully managed, secure sandbox environment with low latency

  • Observability: Amazon Bedrock AgentCore Observability helps developers trace, debug, and monitor agent performance through unified operational dashboards. With support for OpenTelemetry compatible telemetry and detailed visualizations of each step of the agent workflow, Amazon Bedrock AgentCore Observability enables developers to easily gain visibility into agent behavior and maintain quality standards at scale.

  • AgentCore end-to-end: In this tutorial we will move a customer support agent from prototype to production using Amazon Bedrock AgentCore services.

The examples provided as perfect for beginners and those looking to understand the underlying concepts before building AI Agents applications.

End-to-end Applications

Explore practical use case implementations that demonstrate how to apply Amazon Bedrock AgentCore capabilities to solve real business problems.

Each use case includes complete implementation focused on the AgentCore components with detailed explanations.

Framework & Protocol Integration

Learn how to integrate Amazon Bedrock AgentCore capabilities with popular Agentic frameworks such as Strands Agents, LangChain and CrewAI.

Set agent-to-agent communication with A2A and different multi-agent collaboration patterns. Integrate agentic interfaces and learn how to use Amazon Bedrock AgentCore with different entry points.

Step 1: Prerequisites

  • An AWS account with credentials configured (aws configure)
  • Python 3.10 or later
  • Docker or Finch installed and running - only for local development
  • Model Access: Anthropic Claude 4.0 enabled in Amazon Bedrock console
  • AWS Permissions:
    • BedrockAgentCoreFullAccess managed policy
    • AmazonBedrockFullAccess managed policy
    • Caller permissions: See detailed policy here

Step 2: Install and Create Your Agent

# Install both packages
pip install bedrock-agentcore strands-agents bedrock-agentcore-starter-toolkit

Create my_agent.py:

from bedrock_agentcore import BedrockAgentCoreApp
from strands import Agent

app = BedrockAgentCoreApp()
agent = Agent()

@app.entrypoint
def invoke(payload):
    """Your AI agent function"""
    user_message = payload.get("prompt", "Hello! How can I help you today?")
    result = agent(user_message)
    return {"result": result.message}

if __name__ == "__main__":
    app.run()

Create requirements.txt:

cat > requirements.txt << EOF
bedrock-agentcore
strands-agents
EOF

Step 3: Test Locally

# Start your agent
python my_agent.py

# Test it (in another terminal)
curl -X POST http://localhost:8080/invocations \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Hello!"}'

Success: You should see a response like {"result": "Hello! I'm here to help..."}

Step 4: Deploy to AWS

# Configure and deploy (auto-creates all required resources)
agentcore configure -e my_agent.py
agentcore launch

# Test your deployed agent
agentcore invoke '{"prompt": "tell me a joke"}'

Congratulations! Your agent is now running on Amazon Bedrock AgentCore Runtime!

Follow quickstart guides for Gatway, Identity, Memory, Observability, and builtin-tools.

🔗 Related Links:

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details on:

  • Adding new samples
  • Improving existing examples
  • Reporting issues
  • Suggesting enhancements

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributors

About

Amazon Bedrock Agentcore accelerates AI agents into production with the scale, reliability, and security, critical to real-world deployment.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published