Skip to content
Field Notes

LangGraph builds the agent. AgentCore runs it.

LangGraph and AgentCore are different layers, not rivals. Who owns each design primitive, and why your runtime decides how hard checkpointing works.

Raj Murugan 8 min read
Two tiles. Lambda: 15 minutes, no memory between calls. AgentCore Runtime: 8 hours, checkpoint is a choice.
On this page
  1. The six things you design
  2. What AgentCore is
  3. Who owns each primitive
  4. Checkpoints: Lambda vs Runtime
  5. The human-in-the-loop catch
  6. Checkpoints are not idempotency
  7. Where the checkpoints live
  8. Harness: where AgentCore orchestrates
  9. How I would choose
  10. Sources

The question I keep getting from engineering teams is some version of “should we build on LangGraph or on Bedrock AgentCore?” It is the wrong question. They are not competitors. They sit at different layers of the stack.

Think of it like an architect and a construction company. The architect draws the blueprint: where the rooms are, how people move between them, which rooms are marked private. The construction company does not care whose blueprint it is. It pours the foundation, wires the electricity, keeps the lights on long after the architect has gone home, and staffs the security desk that checks ID at the door, on every blueprint it builds. (It also keeps a pre-drawn blueprint on hand, if you don’t want to draw your own; more on that below.) LangGraph is the blueprint. AgentCore is the building, the security desk included, and everything that keeps it running. The clearest way to see that split is to take the things you design when you build an agent and ask, for each one, which tool owns it.

In short

  • LangGraph and AgentCore are different layers: author the graph in LangGraph, run it on AgentCore Runtime.
  • On Lambda, the 15-minute hard limit forces a checkpoint every step. On AgentCore Runtime, checkpointing is mostly a choice, except for open-ended human approvals.
  • A checkpoint is not idempotency. Give every side-effecting tool call its own idempotency key.

The six things you design

When you author a real agent, not a demo, you are designing six things:

  • State: the typed object that carries everything the agent knows this turn, and the rules for what accumulates versus what gets overwritten.
  • Nodes: the discrete steps. Classify intent, plan, generate a query, validate it, run it, retrieve documents, check grounding, synthesise, format the answer.
  • Edges: how those steps are wired together.
  • Routing: the conditional logic that decides which edge to take, ideally deterministic code reading the state, not the model choosing freely.
  • Loops: the reason-act-observe cycle, and the bounds that force it to terminate instead of spinning.
  • Checkpoints: persisting the graph’s state so a run can survive a crash, pause for a human, or be replayed for audit.

If you have written anything non-trivial in LangGraph, you have hand-built all six. That is what LangGraph is: a framework for authoring the control flow of an agent as an explicit graph. It gives you StateGraph, reducers (the rules for how each node’s output merges into shared state, rather than overwriting it), conditional edges, a recursion_limit (25 steps by default before it raises GraphRecursionError), and a checkpointer. It is opinionated about how the agent thinks.

What AgentCore is

AgentCore is not that. It is a modular set of managed services for running and operating agents in production: Runtime, Memory, Gateway, Identity, Observability, plus built-in Code Interpreter and Browser tools, all generally available since 13 October 2025. Policy and Evaluations followed in March 2026, and Harness, a managed agent loop, reached general availability in June 2026, so the newer pieces have months of production hardening, not years.

Two design facts matter most:

  1. It is framework-agnostic and model-agnostic. It runs agents built in LangGraph, CrewAI, LlamaIndex, Strands, the OpenAI Agents SDK and others, against models inside or outside Bedrock (Claude, Nova, GPT, Gemini, Llama, Mistral). The Runtime service contract speaks HTTP, MCP, A2A and AGUI.
  2. AWS’s own framing: the framework owns the orchestration logic, AgentCore owns the runtime infrastructure it runs on. AgentCore does not ask you to redraw your graph. It asks you to deploy it.

So the useful mental model is not “LangGraph or AgentCore.” It is “author in LangGraph, operate on AgentCore,” and the interesting engineering is in the seam between them.

AgentCore is not the only place a LangGraph graph can run. LangChain’s own managed runtime (formerly LangGraph Platform, now LangSmith Deployment) runs your agent in LangChain’s cloud, or in a Kubernetes cluster you operate. AgentCore Runtime runs it inside your own AWS account on a managed microVM, a lightweight, fully isolated virtual machine, one per session, under the IAM you already administer, with CloudWatch metrics and a per-agent log group out of the box. If you want the infrastructure boundary to stay your account rather than a vendor’s, that is the concrete reason to choose AgentCore.

Who owns each primitive

What you designOwnerWhat the other layer adds
StateLangGraphAgentCore Memory: managed short-term and long-term memory across sessions and agents, scoped per actor and namespace. It does not define your state schema.
Nodes and edgesLangGraphNothing. AgentCore has no concept of your nodes, except in Harness.
RoutingLangGraphAgentCore Policy allows or denies every tool call at the Gateway against Cedar policies, outside your code. Governance, not routing.
LoopsLangGraphAgentCore Runtime: up to 8 hours per session on the microVM path (maxLifetime, never reset by activity; up to 14 days with a capacity provider), with session isolation.
CheckpointsLangGraphRuntime and Memory change why you checkpoint. See the next section.
ToolsEitherAgentCore Gateway turns your APIs and Lambda functions into MCP tools that any agent can reuse.

Checkpoints: Lambda vs Runtime

Here is the part I did not appreciate until I built an agent on Lambda.

Lambda gives you fifteen minutes, and nothing is guaranteed to survive between invocations (the execution environment can be reused opportunistically, but you cannot depend on it), and that ceiling is a hard execution limit: it fires even while the function is genuinely busy. A multi-step agent that calls a model, waits, calls a tool, waits and reasons again can hit it, and if the function dies mid-run you lose every tool call it already made. So on Lambda you need a checkpointer. You persist the graph state at every step, and on the next invocation you resume from the last checkpoint instead of re-running everything. The checkpointer is how you survive a stateless, time-boxed compute model.

AgentCore Runtime changes the shape of that problem. Sessions are isolated microVMs that can run for up to eight hours on the standard deployment path, with streaming. A document-parsing pass or a research loop that runs continuously for forty-five minutes has nowhere to go on Lambda without being chopped into checkpointed segments. On Runtime it just keeps going. Checkpointing becomes what it should have been all along: resilience against genuine failures, and a replayable trace for audit. Same primitive, completely different reason for reaching for it.

The human-in-the-loop catch

The eight hours caps the session’s total lifetime from the moment its microVM is created, and it never resets. Idle time is governed separately: AgentCore Runtime decides whether a session is idle from your own code’s /ping health check, which reports Healthy (idle, waiting for work) or HealthyBusy (still working). A session stuck on Healthy for 15 minutes is terminated by default (idleRuntimeSessionTimeout), a ceiling you can raise as far as maxLifetime; keep reporting HealthyBusy and the session survives the idle clock, right up to the eight-hour wall.

So a human-in-the-loop pause is a trade-off, not a free wait. You can hold the session open and let the wait burn the eight-hour budget, or checkpoint, let the session end, and resume a new one from that checkpoint once the human responds. If the wait is unbounded (overnight, a weekend, an approver on leave), checkpoint. It is the only option that survives anything, and it is the same discipline Lambda forces from minute one.

Checkpoints are not idempotency

A resumed run can replay a tool call whose side effect already landed, because durable state and exactly-once side effects are different guarantees. If a node charges a card or sends an email, resuming from the last checkpoint after a crash can fire it twice. Give every side-effecting call its own idempotency key, derived from the thread id, the checkpoint step, and the node or task name (a superstep can run more than one node in parallel, and thread id plus step alone collides across them), and make the downstream API reject duplicates. That holds on either runtime.

Where the checkpoints live

On AWS, the straightforward backend is DynamoDB through DynamoDBSaver from the langgraph-checkpoint-aws package. It keys checkpoints by thread_id, offloads checkpoints over 350 KB to S3, and expires old ones with TTL:

from langgraph_checkpoint_aws import DynamoDBSaver

checkpointer = DynamoDBSaver(
    table_name="langgraph-checkpoints",
    ttl_seconds=86400 * 7,                    # expire after 7 days
    enable_checkpoint_compression=True,
    s3_offload_config={"bucket_name": "my-checkpoint-bucket"},
)
graph = builder.compile(checkpointer=checkpointer)
graph.invoke(inputs, {"configurable": {"thread_id": session_id}})

Use the same thread_id on Lambda and on Runtime, and the resume path is identical on both.

The practical lesson: the compute layer you deploy onto quietly dictates how hard your persistence layer has to work. Pick the runtime first, and half your checkpointer decisions make themselves.

Harness: where AgentCore orchestrates

There is one real exception to “the framework owns the loop,” and it is the construction company’s own pre-drawn blueprint, for when you do not want to draw your own. AgentCore Harness is a managed agent loop, powered by Strands Agents under the hood. You define an agent with CreateHarness and run it with InvokeHarness: a model, a system prompt, tools, memory settings and execution limits as configuration, with no orchestration code to write. For many agents (a support assistant, a research task, a data-analysis helper) that is all you need, and reaching for LangGraph would be over-engineering.

The line I draw: if your control flow is “reason, pick a tool, repeat until done,” Harness is enough. The moment you need explicit routing, bounded repair loops, a grounding gate that can send the agent back to retrieve again, or a human approval step wired into a specific edge, you want a real graph, and that is LangGraph deployed onto Runtime.

How I would choose

  • Prototyping a straightforward agent, or you do not want to own orchestration code: Harness on AgentCore.
  • Non-trivial control flow, deterministic routing, bounded loops, auditability: author the graph in LangGraph.
  • Either way, when it goes to production: deploy onto AgentCore Runtime and adopt Memory, Gateway, Identity, Observability and Policy rather than hand-rolling session isolation, tool plumbing, auth and tracing yourself.
  • Non-negotiables like “the agent must never make an authorisation decision” or “this tool call needs approval” belong in Policy at the Gateway, outside the model, no matter which framework drew the graph.

The versus framing costs teams weeks, because they treat a runtime decision and an authoring decision as one choice and then relitigate it. Separate the two. LangGraph is how the agent thinks. AgentCore is where it lives. Design each on its own terms, and the seam between them is where the good architecture is.

This mapping is a snapshot, not a law. Policy, Evaluations and Harness all reached general availability well after the rest of AgentCore, so the “owner” column has already moved at least twice, and AWS ships AgentCore features almost monthly. If you are reading this months after publication, check the current docs before you redraw this table from memory.

Sources

Field Notes: 25 seconds to detect and hand off. Nothing executes until a human says yes.

Two agents, on two different frameworks, detect a real AWS incident and hand it off over A2A. One proposes a fix. Nothing executes until a human approves, enforced by Cedar.

Field Notes: Where the deny belongs in a multi-agent bank assistant, and the case policy cannot stop

A fictional bank assistant on AgentCore: Cedar policy on the user's token stopped what a missing permit can stop, and missed a stepped-up user with an injected memo.

The ML you need to operate LLMs, not train them

You do not need to train a transformer to run one well. What tokens, context budget and sampling knobs actually mean, verified against the current Bedrock Converse API, including a temperature/top_p gotcha that silently breaks on newer Claude models.

Share this article

Newsletter

A new AWS and AI engineering write-up every Tuesday, directly to your inbox.

Also published on dev.to.

Comments

  1. Loading comments…

Comments are reviewed before they appear.