Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

4.4.5. Deploying Agents with Amazon Bedrock AgentCore

💡 First Principle: An agent is an application that loops: reason, call a tool, observe, repeat. Deploying one means solving four problems that a model endpoint never had: isolating each user's session, connecting to tools securely, remembering context across turns and sessions, and releasing new agent code without breaking live conversations.

Amazon Bedrock AgentCore provides those pieces as modular services that work with any framework (Strands Agents, LangGraph, CrewAI, LlamaIndex and others) and any model, inside or outside Bedrock.

ServiceSolves
RuntimeServerless hosting; each session runs in its own microVM with isolated CPU, memory and filesystem
GatewayTurns APIs, Lambda functions and existing services into MCP tools; fronts other agents and model providers
MemoryShort-term (turn-by-turn events) and long-term (extracted insights) memory
IdentityInbound auth for callers (IdP or SigV4) and outbound OAuth or API-key access to third-party tools
Code Interpreter / BrowserSandboxed code execution and managed web browsing
Observability / EvaluationsOpenTelemetry-compatible traces in CloudWatch; automated quality scoring of agent sessions
PolicyDeterministic Cedar rules that Gateway checks before every tool call

Runtime facts that shape designs. Agents are packaged as ARM64 container images in Amazon ECR or as a .zip direct code deployment. A microVM session idles out after idleRuntimeSessionTimeout (default 900 seconds) and ends at maxLifetime (default and maximum 28,800 seconds, 8 hours); runtimes on the Instances compute type allow up to 14 days and GPU workloads. CPU billing tracks active processing, so time spent waiting on LLM responses is typically not charged. Payloads up to 100 MB are accepted, and networkMode can be PUBLIC or VPC to reach private resources.

Agent communication protocols. Runtime hosts servers for four protocols, each with its own port and path:

ProtocolPurposePort / pathDiscovery
HTTPDirect request/response or WebSocket streaming8080, /invocations, /wsNone
MCP (Model Context Protocol)Agent-to-tool: expose tools to agents8000, /mcpTool listing
A2A (Agent-to-Agent)Agent-to-agent collaboration9000, /Agent Cards
AG-UIAgent-to-user-interface event streams8080, /invocations, /wsNone

Agent state management. State lives at three levels and each belongs somewhere different:

  • Within a turn and session: the Runtime microVM holds in-process state for the life of the session; a new runtimeSessionId gets a fresh microVM, so never rely on process memory across sessions.
  • Conversation history: AgentCore Memory short-term events are written with CreateEvent, keyed by actorId and sessionId. eventExpiryDuration (3 to 365 days) controls how long raw events are kept.
  • Knowledge about the user: long-term memory records are extracted asynchronously by strategies. Built-in strategies are semantic, user preference, summary and episodic; built-in overrides let you customise prompts; self-managed strategies let you run your own pipeline. No strategy means no long-term records.

Amazon Bedrock Agents Classic. The original Bedrock Agents (action groups, aliases, sessionAttributes that last for a session and promptSessionAttributes that last for one turn) entered maintenance mode on 30 July 2026. Accounts without prior usage cannot create new agents; AWS recommends AgentCore for new development and migration.

⚠️ Exam Trap: MCP and A2A are not interchangeable. MCP connects an agent to tools; A2A lets independently deployed agents discover (through Agent Cards) and delegate to each other. If a scenario asks how a supervisor agent built in one framework calls a specialist agent owned by another team, the answer is A2A; if it asks how to expose an internal REST API to agents, the answer is Gateway turning the API into MCP tools.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•20 professional certifications