← Back
AWS ML Blog

Migrate agentic workloads to Amazon Bedrock AgentCore

•21 min read•
#agents#bedrock
Level:Advanced
For:AI Engineers
✦TL;DR

This article details a two‑stage migration of an existing LangGraph customer‑support agent to Amazon Bedrock AgentCore, first moving the runtime, gateway, and memory components while keeping the graph unchanged, then optionally refactoring the loop into model‑driven planning with Strands Agents. The migration touches four core constructs—AgentCore Runtime (BedrockAgentCoreApp), an AWS Lambda gateway published via Model Context Protocol (MCP), tool binding via `ToolNode` and `llm.bind_tools`, and durable state managed by `AgentCoreMemorySessionManager`. Engineers gain a hosted, managed agent environment with built‑in tool orchestration and persistent session state, reducing operational burdens such as session isolation, state persistence, authentication, and OS patching.

⚡ Key Takeaways

  • Migration stages: Stage 1 moves the agent to Bedrock AgentCore Runtime, Gateway, and Memory without altering the graph; Stage 2 rebuilds the loop using model‑driven planning on Strands Agents.
  • Runtime component: `BedrockAgentCoreApp` with an `@app.entrypoint` function runs on a microVM per session.
  • Tool integration: Tools are listed via `MCPClient.list_tools_sync()` and bound using `ToolNode(tools)` and `llm.bind_tools(tools)`.
  • State management: Persistent session state is handled by `AgentCoreMemorySessionManager(AgentCoreMemoryConfig(...))` with `MemorySaver()` keyed on `actor_id`.
  • Optional upgrade: Stage 3 hands the loop to an AgentCore harness, a capability documented separately.
💡 Why It Matters

By offloading session isolation, state durability, authentication, and OS maintenance to Bedrock AgentCore, engineers can focus on core reasoning logic and scale agents more reliably in production.

✅ Practical Steps

  1. Replace your LangGraph agent constructor with `Agent(model=..., system_prompt=..., tools=...)` and configure the runtime using `BedrockAgentCoreApp` and an `@app.entrypoint` function.
  2. Bind your tool set by retrieving them with `MCPClient.list_tools_sync()` and applying `ToolNode(tools)` and `llm.bind_tools(tools)`.
  3. Enable durable session state by instantiating `AgentCoreMemorySessionManager(AgentCoreMemoryConfig(...))` and using `MemorySaver()` with the appropriate `actor_id` in the invoke config.

Want the full story? Read the original article.

Read on AWS ML Blog ↗

More like this

New in AWS Quick: More capable flows, an updated web experience, and agents that work together

AWS ML Blog•#agents

How Google Duplex evolved to also call businesses for you in Gemini

Google Research•#agents

Genie ZeroOps, now in public beta: An autonomous agent that fixes data pipelines, with lessons from 80,000 customer issues

Databricks Blog•#agents

Towards a Science of Capable Autonomous Agents & Provable Safety — Part II

CMU ML Blog•#agents

EXPLORE AI NEWS

Daily hand-picked stories on LLMs, RAG, agents and production AI — curated for engineers who ship.

BROWSE NEWS

GET THE WEEKLY DIGEST

Join engineers getting the Monday signal-over-noise AI breakdown. No spam, unsubscribe anytime.

LEARN AI ENGINEERING

Curated courses, research papers, repos and tutorials built for engineers leveling up in AI.

START LEARNING