Skip to content
/

Amazon Bedrock AgentCore Samples

agentcore-samples · awslabs/agentcore-samples · ★ 2.9k · last commit 2026-05-26

Primitive shape 1 total
MCP tools 1
00

Summary

awslabs/agentcore-samples — Summary

Amazon Bedrock AgentCore Samples is AWS's official code sample repository for Amazon Bedrock AgentCore — a managed cloud infrastructure platform for deploying and operating AI agents at production scale. The repo provides getting-started tutorials, deep-dive feature examples, end-to-end use cases, framework integrations, infrastructure-as-code templates, and full reference blueprints.

Problem it solves: Moving AI agents from prototype to production requires solving infrastructure problems (compute, memory, identity, security, observability) that most developers don't want to build themselves. AgentCore provides managed infrastructure; this samples repo shows developers exactly how to use each capability.

Distinctive trait: This is the only framework in the corpus that is a cloud runtime infrastructure for agents rather than a workflow or skill system. AgentCore provides: managed agent harness (serverless runtime), MCP Gateway (convert any API to MCP tools), Identity (OAuth/OIDC for cross-service auth), Memory (managed vector+semantic store), Code Interpreter, Browser Tool, Observability (OpenTelemetry), and Cedar-policy-based access control. The repo demonstrates all of these with framework-agnostic samples (Strands, LangGraph, CrewAI, OpenAI Agents SDK, Google ADK all supported).

Target audience: AWS developers building production-grade AI agents who want to avoid building agent infrastructure themselves; ML engineers deploying agent workloads.

Scope: 2,868 GitHub stars, Apache-2.0, 30 contributors, actively maintained with daily pushes.

Differs from seeds: No seed framework matches — AgentCore is cloud infrastructure (AWS Lambda/ECS equivalent for agents), not a workflow or skill framework. Closest to how cloud-flow's hive-mind patterns operate at scale, but AgentCore is a managed AWS service with Cedar policies, IAM integration, and SOC-2 posture.

01

Overview

awslabs/agentcore-samples — Overview

Origin

Amazon Bedrock AgentCore is a new AWS service (announced in 2025) for deploying AI agents at production scale. The samples repo was originally called the "Bedrock AgentCore Starter Toolkit" but transitioned to use the new AgentCore CLI. The MIGRATION.md documents the old-path to new-path mapping.

Philosophy

"Deploy and operate AI agents securely at scale — using any framework and model" "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."

Key principles:

  1. Framework agnostic: Works with Strands Agents, CrewAI, LangGraph, LlamaIndex, OpenAI Agents SDK, Google ADK — no lock-in to one framework
  2. Model agnostic: Any LLM via Amazon Bedrock — Claude, Llama, Mistral, etc.
  3. Managed infrastructure: "Eliminating the undifferentiated heavy lifting of building and managing specialized agent infrastructure"
  4. Security by default: Cedar policies for fine-grained access control, AWS IAM integration, VPC support

Service Components

Component What it provides
Runtime (Harness) Serverless compute for agent execution — 3 API calls to deploy
Gateway Convert APIs/Lambda/OpenAPI/Smithy to MCP-compatible tools
Identity OAuth/OIDC agent identity for cross-service authentication
Memory Managed semantic + episodic memory infrastructure
Tools Built-in Code Interpreter + Browser Tool
Observability OpenTelemetry traces, logging, metrics
Evaluation Built-in + custom evaluators for online/offline eval
Policy Cedar-policy-based fine-grained access control

AgentCore CLI

The primary developer experience tool:

npm install -g @aws/agentcore
agentcore create --name myagent --model-provider bedrock
agentcore deploy
agentcore invoke --session-id "$(uuidgen)" "My prompt"
02

Architecture

awslabs/agentcore-samples — Architecture

Distribution

  • Type: standalone-repo (sample collection) + CLI tool (@aws/agentcore)
  • Primary SDK: Python SDK (github.com/aws/bedrock-agentcore-sdk-python) + TypeScript SDK
  • CLI: npm install -g @aws/agentcore (AgentCore CLI)
  • License: Apache-2.0

Repository Structure

awslabs/agentcore-samples/
├── 00-getting-started/          # Quick start with AgentCore CLI
│   ├── python/                  # Python agent samples
│   └── typescript/              # TypeScript agent samples
├── 01-features/                 # Feature-specific deep dives
│   ├── 01-harness/              # Managed agent runtime
│   │   ├── 00-getting-started/
│   │   ├── 01-advanced-examples/ (custom containers, gateway, MCP, OAuth)
│   │   └── 02-use-cases/
│   ├── 02-host-your-agent/
│   ├── 03-connect-your-agent-to-anything/ # Gateway/MCP
│   ├── 04-manage-context-of-your-agent/   # Memory
│   ├── 05-authenticate-and-authorize/     # Identity + Cedar policies
│   ├── 06-observe-evaluate-optimize/      # Observability + Eval
│   ├── 07-centralize-and-govern/          # Gateway + Policy + Registry
│   │   ├── 01-gateway/
│   │   ├── 02-policy/
│   │   └── 03-registry/
│   └── 08-agents-that-transact/
├── 02-use-cases/               # (see below — mapped to end-to-end)
├── 03-integrations/
│   ├── identity-providers/     # Okta, Entra, Cognito
│   ├── observability/          # Grafana, Datadog, Dynatrace
│   ├── data-platforms/         # Data lake/warehouse integrations
│   └── ux-examples/            # Streamlit, AG-UI frontends
├── 04-infrastructure-as-code/  # CloudFormation, CDK, Terraform
├── 05-blueprints/              # Full-stack reference applications
├── 06-workshops/
├── pyproject.toml
└── requirements.txt

AgentCore Architecture (Service Layer)

Developer → AgentCore CLI → AWS CloudFormation
                                ↓
                         AgentCore Runtime (Lambda-like)
                                ↓
              ┌─────────────────┼─────────────────┐
           Gateway           Memory            Identity
        (MCP converter)   (vector store)   (OAuth/OIDC)
              ↓                 ↓                 ↓
        External APIs    Semantic recall    Cross-service auth

Required Runtime

  • node >= 20 (AgentCore CLI)
  • python >= 3.9 (Python samples)
  • uv >= 0.4 (for sample execution)
  • AWS CLI v2 (for credential setup)
  • boto3 (Python SDK)
  • AWS account with Bedrock access
03

Components

awslabs/agentcore-samples — Components

AgentCore CLI Commands

Command Purpose
agentcore create Create a new agent project (interactive wizard)
agentcore deploy Deploy agent to AgentCore Runtime
agentcore invoke Send a prompt to deployed agent
agentcore dev Local development server
agentcore status Check deployment status
agentcore add memory Add memory capability to agent
agentcore add gateway Add gateway capability
agentcore add gateway-target Add gateway target (Lambda, MCP, OpenAPI, Smithy)
agentcore info Show project config and CLI version

AgentCore Service Capabilities (MCP-Exposed)

Managed Harness

  • create_harness_agent — Define agent (model, tools, instructions)
  • invoke_harness_agent — Run agent with session
  • execute_command — Run arbitrary commands within agent context

Gateway (API→MCP Converter)

  • Supports: Lambda function ARNs, MCP servers, OpenAPI specs, Smithy models
  • Converts any API to MCP-compatible tools automatically

Memory

  • Semantic memory (vector-based recall)
  • Episodic memory (conversation history)
  • agentcore add memory → auto-provisions memory infrastructure

Identity

  • OAuth/OIDC agent identity
  • Supported IdPs: Okta, Microsoft Entra, Cognito
  • Token exchange for cross-service authentication

Observability

  • OpenTelemetry integration
  • Supported backends: Grafana, Datadog, Dynatrace
  • agentcore observability commands

Evaluation

  • Built-in evaluators + custom evaluator support
  • Online eval (running in production) + offline eval (test suite)

Policy (Cedar)

  • Fine-grained access control with Cedar policy language
  • Resource-level permissions for agent actions

Sample Categories

Category Count Description
Getting Started 2 (python/ts) Quick deploy tutorial
Harness Features 8+ Runtime deep dives
Governance 3 Gateway, Policy, Registry
Integrations 4 types IdP, observability, data, UX
IaC Templates 3 types CloudFormation, CDK, Terraform
Blueprints 3+ Full reference apps
05

Prompts

awslabs/agentcore-samples — Prompts

Note on Prompt Content

AgentCore Samples is a cloud infrastructure toolkit, not a prompt engineering framework. The samples demonstrate how to configure and deploy agents — they contain Python/TypeScript code, not prompts. However, key architectural patterns embedded in the documentation constitute prompting guidance for the agent.

Verbatim Excerpt 1: Harness README — Agent Configuration

File: 01-features/01-harness/README.md Technique: Infrastructure-as-code pattern for agent definition

## AgentCore CLI

The fastest path to a running harness:

agentcore create --name myresearchagent --model-provider bedrock
agentcore deploy

# Invoke
agentcore invoke --session-id "$(uuidgen)" \
  "Research three tropical vacation options under $3k."

# Local development
agentcore dev

# Check status
agentcore status

# Add memory
agentcore add memory
agentcore deploy

The tutorials in this folder use boto3 directly for full visibility into every API call and parameter — the CLI abstracts these details away. Both approaches produce the same result.


**Pattern**: The harness is configured declaratively (model, tools, instructions as API parameters) rather than through prompt files. The agent's "system prompt" is passed as a parameter in the API call.

## Verbatim Excerpt 2: Getting Started README — Agent Architecture

**File**: `00-getting-started/README.md`
**Technique**: Service-oriented agent composition description

```markdown
A customer support agent that can:
- Look up product information and specifications
- Answer questions about return policies
- Combine tool results with LLM reasoning to provide helpful responses

Amazon Bedrock AgentCore supports various interfaces for developing and deploying
your agent code. At the lowest level, you can interact with the AgentCore APIs
directly or through the AWS SDKs. For a simpler development experience, the
AgentCore Python SDK and TypeScript SDK provide higher-level abstractions for
integrating with AgentCore services like runtime, memory, and tools. The AgentCore
CLI builds on top of these, offering the best developer experience that lets you
quickly scaffold, configure, and deploy agents.

Pattern: Agent capability definition through tool specification (what the agent can do) rather than prompt instruction. The LLM reasoning is implicit — what's explicit is the tool inventory and capability scope.

09

Uniqueness

awslabs/agentcore-samples — Uniqueness & Positioning

Differs from Seeds

No seed framework compares — AgentCore is a cloud infrastructure platform (like AWS Lambda but for AI agents), not a workflow or skill framework. The seeds are local process frameworks; AgentCore provides the runtime those processes would run on.

The closest conceptual relationship is to claude-flow (Archetype 3 — MCP-anchored toolserver with multi-agent patterns) — but claude-flow is a local tool coordination system while AgentCore is a managed cloud service with IAM, Cedar policies, serverless compute, and SOC-2 posture.

Distinctive Properties

  1. Only managed cloud runtime in the corpus: AgentCore provides the infrastructure that developer-facing frameworks assume exists (compute, scaling, auth, storage). All other frameworks in the corpus run on the developer's local machine.

  2. Cedar policy access control: Fine-grained resource permissions using Amazon's Cedar policy language — no other framework in the corpus ships a formal policy model for agent actions.

  3. Framework-agnostic design: Strands, LangGraph, CrewAI, LlamaIndex, OpenAI Agents SDK, Google ADK all work without code changes — the abstraction layer is at the infrastructure level.

  4. MCP Gateway as API converter: Any Lambda, OpenAPI spec, or Smithy model becomes an MCP tool automatically — solving the "connecting agents to enterprise APIs" problem without custom MCP server development.

  5. Production-grade evaluation: Built-in online (real-time) and offline (test suite) evaluation with custom evaluator support — no other framework ships managed eval infrastructure.

Observable Failure Modes

  • AWS vendor lock-in: All state (memory, compute, Gateway configs) is in AWS — migrating to another provider requires architectural changes
  • Cost at scale: Serverless compute + managed memory + Gateway routing all incur AWS costs — no cost model visible in samples for budget estimation
  • Complex IAM setup: The required IAM permissions (CloudFormation, S3, IAM role management, Lambda, CloudWatch, Bedrock) create initial setup friction
  • Sample staleness: With the transition from Starter Toolkit to AgentCore CLI, some samples in legacy/ are outdated — MIGRATION.md helps but adds discovery friction

Governance Posture

As an official awslabs repo, AgentCore Samples carries:

  • Enterprise security scanning in the repo (.checkov.yaml, .secrets.baseline, .github/ workflows)
  • Apache-2.0 license
  • CODE_OF_CONDUCT.md + CONTRIBUTING.md + CONTRIBUTORS.md
  • Daily maintenance cadence (last pushed 2026-05-26)
04

Workflow

awslabs/agentcore-samples — Workflow

Agent Deployment Workflow (via CLI)

1. INSTALL CLI
   npm install -g @aws/agentcore

2. CONFIGURE CREDENTIALS
   aws configure (or set AWS env vars)

3. CREATE PROJECT
   agentcore create --name myagent --model-provider bedrock
   (wizard selects: harness type, model, tool integrations)

4. DEVELOP LOCALLY
   agentcore dev (local development server)
   Edit agent code, test with local invocations

5. DEPLOY
   agentcore deploy → CloudFormation stack creation
   AWS provisions: compute, IAM roles, networking

6. INVOKE
   agentcore invoke --session-id "$(uuidgen)" "prompt"

7. ADD CAPABILITIES (optional)
   agentcore add memory → managed memory infrastructure
   agentcore add gateway → MCP tool gateway
   agentcore deploy (re-deploy with new capabilities)

8. OBSERVE
   CloudWatch metrics + traces (or Grafana/Datadog)
   agentcore status

9. EVALUATE
   Built-in or custom evaluators for quality scoring

Phase-to-Artifact Map

Phase Artifact
create agentcore.json project config
deploy CloudFormation stack + IAM roles + agent endpoint
memory add DynamoDB/vector store resources
gateway add API Gateway + Lambda connector
eval run Evaluation report (JSON)

Approval Gates

No mandatory human approval gates — this is a developer toolkit, not a workflow enforcement system. Human decisions happen outside the tooling.

Framework-Specific Workflows

Each supported framework (Strands, LangGraph, CrewAI, etc.) has its own samples showing framework-specific patterns for connecting to AgentCore services. No framework is preferred — the samples directory is organized by feature, not framework.

06

Memory Context

awslabs/agentcore-samples — Memory & Context

Memory Architecture

AgentCore provides managed memory infrastructure — not a local file system or SQLite database, but a cloud-native managed service.

Memory Types

Type Description Use Case
Semantic Memory Vector-based recall of past interactions "What did we discuss last week about..."
Episodic Memory Conversation/session history Recall previous session context

Memory Provisioning

agentcore add memory
agentcore deploy

This provisions AWS-managed vector store infrastructure (likely Amazon OpenSearch or DynamoDB with vector support) — no developer-managed database required.

Memory Access in Agents

The Python SDK provides high-level abstractions:

# Memory is available as a service, injected into agent execution
# Agents query memory before responding, store interactions after

Session Management

  • Session IDs are UUIDs: agentcore invoke --session-id "$(uuidgen)" "prompt"
  • Sessions are persisted by AgentCore Runtime
  • Cross-session memory available through the managed Memory service

Context Window Management

AgentCore Runtime handles context window management as part of the managed harness:

  • Automatic context compaction
  • Tool result truncation
  • History summarization (platform-managed)

State Files (per-project)

File Purpose
agentcore.json Project config: model, tools, capabilities
CloudFormation stack AWS-managed state for deployed resources
Agent endpoint Permanent URL for the deployed agent

No Local State Files

Unlike file-based frameworks (superpowers, spec-driver), AgentCore stores all runtime state in AWS services — there are no local markdown files for state management.

07

Orchestration

awslabs/agentcore-samples — Orchestration

Multi-Agent

Yes — AgentCore supports multi-agent architectures. The Registry feature provides a catalog of deployed agents that can be orchestrated together. The Gateway feature allows agents to call other agents as MCP tools.

Orchestration Patterns

AgentCore supports multiple patterns depending on the framework used:

  • Strands Agents: Sequential + hierarchical patterns
  • LangGraph: Graph-based orchestration (directed acyclic + cyclic graphs)
  • CrewAI: Role-based multi-agent crews
  • OpenAI Agents SDK: Sequential handoffs

AgentCore itself is framework-agnostic — it provides the infrastructure, not the orchestration logic.

Isolation Mechanism

Container — each AgentCore agent runs in its own managed container (serverless, Lambda-like). Agents are isolated by default; communication happens via:

  • MCP Gateway (agent A calls agent B's tools)
  • AWS SDK calls (agent A invokes agent B's endpoint)

Multi-Model

Yes — AgentCore supports any model available on Amazon Bedrock:

  • Anthropic Claude (Sonnet, Opus, Haiku)
  • Meta Llama
  • Mistral
  • Amazon Titan

Different agents in a system can use different models. The --model-provider bedrock flag selects the provider; model selection is per-agent-configuration.

Execution Mode

Event-driven — agents respond to invocations. The managed harness handles the execution loop. No persistent daemon — serverless execution model.

Deployment Scale

  • Auto-scaling: Yes (managed by AgentCore Runtime)
  • Concurrency: Managed (configurable min/max)
  • Regions: Multi-region AWS support

Consensus

None specified in samples. Multi-agent coordination is framework-dependent.

08

Ui Cli Surface

awslabs/agentcore-samples — UI/CLI Surface

Dedicated CLI Binary

Yes — the AgentCore CLI is the primary developer tool.

Attribute Value
Binary name agentcore
Install npm install -g @aws/agentcore
Repo https://github.com/aws/agentcore-cli
Is thin wrapper No — own runtime, not a wrapper over claude/codex

CLI Subcommands

agentcore create        — scaffold new agent project
agentcore deploy        — deploy to AgentCore Runtime (CloudFormation)
agentcore invoke        — send prompt to deployed agent
agentcore dev           — local development server
agentcore status        — check deployment status
agentcore add memory    — add managed memory
agentcore add gateway   — add MCP gateway
agentcore add gateway-target — add gateway endpoint (Lambda, MCP, OpenAPI, Smithy)
agentcore info          — project config + CLI version
agentcore update        — update CLI

Local UI / Dashboard

No dedicated local dashboard. AgentCore observability is cloud-based:

  • AWS CloudWatch (built-in)
  • AWS X-Ray traces (OpenTelemetry)
  • Third-party: Grafana, Datadog, Dynatrace (via integrations in 03-integrations/observability/)

UX Examples

The 03-integrations/ux-examples/ directory includes:

  • Streamlit frontends for agent chat interfaces
  • AG-UI patterns for agent interaction UIs

These are not local dashboards bundled with AgentCore — they are sample patterns for building your own UI.

IDE Integration

No IDE-specific integration (no Claude Code plugin, no VS Code extension). AgentCore is a cloud service accessed via CLI and SDK.

Observability Stack

Layer Tool
Traces AWS X-Ray / OpenTelemetry
Metrics AWS CloudWatch
Logs AWS CloudWatch Logs
Dashboards Grafana / Datadog / Dynatrace (sample integrations)

Related frameworks

same archetype · same primary tool · same memory type

Claude-Flow / Ruflo ★ 55k

Eliminates single-agent context limits and sequential bottlenecks by orchestrating fault-tolerant swarms of specialized AI agents…

Hermes Agent (NousResearch) ★ 168k

Self-improving personal AI agent with closed learning loop, 7 terminal backends, and messaging gateway — not tied to any AI…

OpenCode ★ 165k

Terminal-first AI coding agent with multi-model routing, native desktop app, and a typed .opencode/ configuration system for…

OpenHands ★ 75k

Open-source AI software development platform (open-source Devin alternative) with Docker sandbox isolation, 77.6% SWE-bench…

DeerFlow ★ 70k

Long-horizon superagent that researches, codes, and creates by orchestrating parallel sub-agents with isolated contexts in Docker…

oh-my-openagent (omo) ★ 60k

Multi-provider AI agent orchestration for OpenCode: escape vendor lock-in by routing Sisyphus (Claude/Kimi/GLM) and Hephaestus…