Skip to main content

LangGraph Deep Agents in Production: Managed or SDK

· 9 min read
Vadim Nicolai
Senior Software Engineer

A LangGraph deep agent that works on your laptop is a compiled graph plus a checkpointer in MemorySaver. Running it in production means threads that outlive a process, a store for memory, sandboxes for code, schedules, auth and traces. You have two ways to get there. Managed Deep Agents lets LangSmith run the harness and the runtime for you. The self-hosted SDK path, create_deep_agent on a LangSmith Deployment or in your own container, leaves the backend, store and checkpointer in your hands. The thesis of this last part is simple: Managed buys you sandboxes and schedules, and you self-host when you need your own backend, store or checkpointer.

LangGraph Deep Agents, a 10-part series. ← Part 9

What is Managed Deep Agents for LangGraph deep agents?​

Managed Deep Agents (MDA) is a hosted runtime for the same Deep Agents harness. You write the agent as a project of files and LangSmith runs it on Agent Server. The docs describe the split plainly: you provide the instructions, tools, skills and model, and MDA provides the loop, the threads, the runs, streaming and an MCP endpoint, "without operating the server yourself."

Each capability maps to a file. agent.py holds the definition, instructions.md holds the system prompt, skills/<name>/SKILL.md holds the skills, and tools/ holds your Python tools. The entry point is define_deep_agent, not create_deep_agent:

from managed_deepagents import define_deep_agent

from middleware.audit import log_tool_calls
from tools.search import internet_search

agent = define_deep_agent(
name="research-assistant",
model="openai:gpt-5.5",
tools=[internet_search],
middleware=[log_tool_calls],
)

The difference matters. As the migration guide puts it, create_deep_agent compiles an agent in your process, so it takes the backend, store and checkpointer as parameters. define_deep_agent returns a definition, and the managed runtime compiles it. You never pass a checkpointer because the runtime owns one.

The quickstart is three commands: uvx --from managed-deepagents mda init research-assistant, then mda dev to test locally in LangSmith Studio, then mda deploy. MDA is in public beta on LangSmith Cloud and Bring Your Own Cloud. The docs pin BYOC users to version 0.10 of the CLI and SDK.

Managed Deep Agents vs the self-hosted SDK: which should you pick?​

The harness is identical either way, so the agent behaves the same. What changes is everything around it. The migration guide lists the trade-offs:

  • Filesystem and shell. The SDK accepts any backend: state, local disk, a store, or a sandbox you provision. MDA gives you one managed sandbox, declared in a file, that LangSmith creates, snapshots and stops when idle.
  • Memory. On the SDK you run and wire up the storage. On MDA, durable memory is turned on by adding a file.
  • End-user credentials. MDA connections hold workspace secrets and run OAuth so users authorize services themselves. On the SDK you store credentials per user.
  • Chat surfaces and schedules. MDA channels connect Slack and other messaging services, and its schedules are managed cron. On the SDK you write the integration and run the scheduler.
  • Code around the agent. MDA hosts the agent only. Custom routes and application code need a LangSmith Deployment.

The guide also flags what does not carry over. A hand-written BackendProtocol has no equivalent, because the runtime owns the backend. That is the deciding test. If parts 4 and 5 of this series led you to a composite backend, a custom store or your own checkpointer, stay on the SDK. If the default sandbox and memory tree are enough, MDA removes a lot of infrastructure you would otherwise run.

How do you deploy a LangGraph deep agent with LangSmith Deployment?​

The SDK path is the one Going to production documents. You export the compiled agent from agent.py and point the deployment's application config file at it:

{
"dependencies": ["."],
"graphs": {
"agent": "./agent.py:agent"
},
"env": ".env"
}

A LangSmith Deployment gives you the threads, runs, store and checkpointer, plus auth, webhooks, cron jobs, and exposure over MCP or A2A. You can deploy to Cloud or self-host standalone servers with Docker or Kubernetes. Self-hosting also lets you swap in a custom checkpointer or a custom store in place of the built-in Postgres ones.

Before you ship, the production guide asks three scoping questions: what belongs to the thread (one conversation), what belongs to the user (identity from your auth layer), and what belongs to the assistant (a configured agent instance). Get those boundaries wrong and one user's files show up in another user's thread.

How do you stream LangGraph deep agent events, including subagents?​

A deep agent that runs for minutes needs to show progress. Streaming works the same on a laptop and behind Agent Server. The one flag people forget is subgraphs=True. Without it you only see the main agent, and everything the task tool delegates (part 8) stays invisible:

for chunk in agent.stream(
{"messages": [{"role": "user", "content": "Research quantum computing advances"}]},
stream_mode="updates",
subgraphs=True,
version="v2",
):
if chunk["type"] == "updates":
if chunk["ns"]:
print(f"[subagent: {chunk['ns']}]")
else:
print("[main agent]")
print(chunk["data"])

An empty ns means the main agent. A namespace such as tools:<id> points to the subagent started by that task call. Use stream_mode="messages" for tokens, "custom" for events your tools emit, or a list to get all three. One caveat: the page describes tuple-shaped chunks in one section and reads dicts in its examples. Check which shape your LangGraph version returns before you build a UI on it.

For frontends outside Python, the docs also expose deep agents over AG-UI. For code editors there is the Agent Client Protocol: pip install deepagents-acp, wrap the agent in AgentServerACP, and any ACP-compatible editor can launch it over stdio as a coding agent.

If you want a finished coding agent rather than one you assemble, Deep Agents Code (dcode) is an open source terminal agent built on the same SDK. It works with any model, keeps persistent memory across conversations, loads skills and MCP tools, gates code execution behind approvals, can run its tools in remote sandboxes and traces to LangSmith. It is a useful reference for what a production deep agent looks like end to end.

How do you trace and evaluate a deep agent in production?​

Tracing is mostly free. LangSmith Cloud deployments send traces automatically to a project named after the deployment. Hybrid and self-hosted setups configure it through the data plane. Since every planning step, file edit and subagent call is a span, the trace answers the question you will ask most often in production: why did step 140 do that? The production guide also recommends LangSmith Engine, which watches traces, detects issues and proposes fixes.

For evals, the CI/CD pipeline example wires LangSmith Evaluation into deployment, and preview builds stand up a temporary deployment per pull request. Together they give you a gate: a prompt or tool change ships only if it passes the eval set on a real Agent Server.

LangGraph Deep Agents vs Claude Agent SDK: how do they compare?​

The official comparison page is fair to both. The Claude Agent SDK runs the agent inside a sandbox and works with that sandbox's local filesystem. Deep Agents can do that too, and it can also run the agent outside a sandbox and call a remote sandbox as a tool, through pluggable backends. The Claude Agent SDK is built for Claude, available through Anthropic, Bedrock, Vertex or Azure. Deep Agents is model-agnostic and has beta harness profiles for tuning per model. On deployment, the Claude Agent SDK is self-hosted, so you build the API server, auth and multi-tenancy yourself. Deep Agents defaults to Managed Deep Agents or a standalone image, and comes with per-user sandboxes, scoped threads, RBAC and an agent server. Both SDKs are MIT-licensed.

The docs' own advice: choose Deep Agents for model and infrastructure flexibility with built-in multi-tenant deployment, and choose the Claude Agent SDK if you are already invested in Anthropic's ecosystem and willing to build the surrounding infrastructure yourself.

FAQ​

Can I move a create_deep_agent agent to Managed Deep Agents without a rewrite? Mostly. Tools, middleware and subagents carry over unchanged. The entry becomes define_deep_agent, and the prompt, skills and memory move into project files. Custom backends do not carry over.

Do I need subgraphs=True to see subagent output? Yes. Without it the stream shows only the main agent's events.

Where do traces go on a LangSmith Cloud deployment? They go automatically to a LangSmith project named after the deployment, with no extra setup.


Series: Harness · Quickstart · MCP tools · Virtual filesystem · Sandbox and permissions · Skills and memory · Context engineering · Subagents · Human-in-the-loop · Production (this post)