Skip to main content

An SDK for using Bedrock AgentCore

Project description

Bedrock AgentCore SDK

Deploy your local AI agent to Bedrock AgentCore with zero infrastructure

GitHub commit activity GitHub open issues GitHub open pull requests License PyPI version Python versions

DocumentationSamplesDiscordBoto3 Python SDKRuntime Python SDK

Overview

Amazon Bedrock AgentCore enables you to deploy and operate highly effective agents securely, at scale using any framework and model. With Amazon Bedrock AgentCore, developers can accelerate AI agents into production with the scale, reliability, and security, critical to real-world deployment. AgentCore provides tools and capabilities to make agents more effective and capable, purpose-built infrastructure to securely scale agents, and controls to operate trustworthy agents. Amazon Bedrock AgentCore services are composable and work with popular open-source frameworks and any model, so you don’t have to choose between open-source flexibility and enterprise-grade security and reliability.

🚀 From Local Development to Bedrock AgentCore

from bedrock_agentcore import BedrockAgentCoreApp
app = BedrockAgentCoreApp()

from strands import Agent # or bring your agent.

@app.entrypoint
async def handler(request):
    prompt = request.get("prompt")

    agent = Agent()

    async for event in agent.stream_async(prompt):
        yield (event)

app.run()

What you get with Bedrock AgentCore:

  • Keep your agent logic - Works with Strands, LangGraph, CrewAI, Autogen, or custom frameworks
  • Zero infrastructure management - No servers, containers, or scaling concerns
  • Enterprise-grade platform - Built-in auth, memory, observability, security
  • Production-ready deployment - Reliable, scalable, compliant hosting

Amazon Bedrock AgentCore services

  • 🚀 Runtime - Secure and session isolated compute: Get started
  • 🧠 Memory - Persistent knowledge across sessions: Get started
  • 🔗 Gateway - Transform APIs into MCP tools: Get started
  • 💻 Code Interpreter - Secure sandboxed execution: Get started
  • 🌐 Browser - Cloud-based web automation: Get started
  • 📊 Observability - OpenTelemetry tracing: Get started
  • 🔐 Identity - AWS & third-party auth: Get started

AG-UI Protocol Support

Deploy agents using the AG-UI protocol with zero boilerplate. A single entrypoint handler is served over both SSE (POST /invocations) and WebSocket (/ws).

from bedrock_agentcore.runtime import serve_ag_ui

# Framework agent with a .run() method — one line
serve_ag_ui(agui_agent)

Or write a custom agent with the decorator form:

from bedrock_agentcore.runtime import AGUIApp
from ag_ui.core import RunAgentInput, RunStartedEvent, RunFinishedEvent

app = AGUIApp()

@app.entrypoint
async def my_agent(input_data: RunAgentInput):
    yield RunStartedEvent(thread_id=input_data.thread_id, run_id=input_data.run_id)
    # ... your agent logic, yield AG-UI events ...
    yield RunFinishedEvent(thread_id=input_data.thread_id, run_id=input_data.run_id)

app.run()

Install with: pip install "bedrock-agentcore[ag-ui]"

See the AG-UI protocol contract for full details.

🏗️ Deployment

AgentCore CLI (Recommended)

The fastest way to deploy your agent to Bedrock AgentCore. Install via npm:

npm i -g @aws/agentcore

Then create and deploy your agent:

agentcore create --name MyAgent --defaults
cd MyAgent
agentcore deploy

The CLI handles packaging, infrastructure provisioning, and deployment automatically. See the AgentCore CLI documentation for full details.

AWS CDK (Advanced)

The AgentCore CLI generates AWS CDK under the hood. For full infrastructure-as-code control, customize the generated CDK project directly or refer to the L1 CDK documentation.

A2A Protocol Support

Serve your agent using the A2A (Agent-to-Agent) protocol on Bedrock AgentCore Runtime. Works with any framework that provides an a2a-sdk AgentExecutor (Strands, LangGraph, Google ADK, or custom).

pip install "bedrock-agentcore[a2a]"
from strands import Agent
from strands.a2a import StrandsA2AExecutor
from bedrock_agentcore.runtime import serve_a2a

agent = Agent(model="us.anthropic.claude-sonnet-4-20250514", system_prompt="You are a helpful assistant.")
serve_a2a(StrandsA2AExecutor(agent))

See A2A Protocol Examples for LangGraph, Google ADK, and advanced usage.

📝 License & Contributing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bedrock_agentcore-1.15.1.tar.gz (935.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bedrock_agentcore-1.15.1-py3-none-any.whl (431.0 kB view details)

Uploaded Python 3

File details

Details for the file bedrock_agentcore-1.15.1.tar.gz.

File metadata

  • Download URL: bedrock_agentcore-1.15.1.tar.gz
  • Upload date:
  • Size: 935.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bedrock_agentcore-1.15.1.tar.gz
Algorithm Hash digest
SHA256 65405b0f207526b665884a8f21e594b53ab60f86c663eb180072c9d26cba3eb5
MD5 ef6bf7da7adadb2d8d1c892d94b61e16
BLAKE2b-256 5d360f4030c19e903bbbee93d3abc82d3f26f896d095102e1bc37317eca3cbca

See more details on using hashes here.

Provenance

The following attestation bundles were made for bedrock_agentcore-1.15.1.tar.gz:

Publisher: release-publish.yml on aws/bedrock-agentcore-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bedrock_agentcore-1.15.1-py3-none-any.whl.

File metadata

File hashes

Hashes for bedrock_agentcore-1.15.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8506e5d19d015120c3632b341cb487dd925ec5a1b01a45d5a87cc12b8570eb86
MD5 741c1c80636203645e3ef9f9405e1693
BLAKE2b-256 e7902377c579d59cfc0dff720daf6178141064539d118513cb80cf7392b2f676

See more details on using hashes here.

Provenance

The following attestation bundles were made for bedrock_agentcore-1.15.1-py3-none-any.whl:

Publisher: release-publish.yml on aws/bedrock-agentcore-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page