langgraph-orchestration
Use this skill for LangGraph, Deep Agents, LangChain agents built on LangGraph, MCP-to-LangGraph tool bridging, stateful workflows, subgraphs, subagents, interrupts, checkpointing, streaming, and multi-agent orchestration. Trigger when code imports langgraph, deepagents, langchain_mcp_adapters, langchain.agents, or when the user asks for agent graphs, orchestration, durable execution, HITL, or LangGraph architecture and patterns.
LangGraph Orchestration
Use this skill when the task is about building or fixing an orchestrated agent system on the LangGraph stack.
This skill is written for the agent, not as user-facing docs. Favor shipped patterns and official APIs over improvised orchestration.
First Move
Classify the request before touching code:
- High-level agent harness: prefer
deepagents.create_deep_agent(...) - General-purpose tool-calling agent: prefer
langchain.agents.create_agent(...) - Custom workflow / graph topology: prefer
langgraph.graph.StateGraph - MCP tool integration: prefer
langchain_mcp_adapters - Human approval / resumability: prefer
interrupt()+ checkpointer - Specialist delegation: prefer deep-agent subagents, or explicit subgraphs
If more than one applies, choose the highest abstraction that still preserves
the required control. Do not drop to raw StateGraph just because it is more
familiar.
Read Only What You Need
references/decision-guide.mdfor framework choice and migration choicesreferences/langgraph-patterns.mdforStateGraph,Command,Send, reducers, routing, and durable executionreferences/deep-agents.mdforcreate_deep_agent, middleware, skills, filesystem, memory, and subagentsreferences/mcp-bridging.mdforlangchain_mcp_adapterspatternsreferences/subagents-and-subgraphs.mdfor delegation boundaries and isolation rulesreferences/interrupts-hitl.mdfor approval gates, resumability, and thread handlingreferences/claude-sdk-adapter.mdwhen embedding Claude Agent SDK workers into a LangGraph / Deep Agents orchestrator
Defaults That Age Well
- Prefer
langchain.agents.create_agent(...)over deprecated LangGraph prebuilt agent helpers. - Prefer
deepagentswhen you want planning, file tools, subagents, skills, or long-running coding/research behavior. - Prefer
StateGraphwhen topology matters: parallel branches, orchestrator / worker, cycles, reducer-controlled state, explicit routing. - Prefer
CompiledSubAgentonly when you already have a compiled runnable / graph that should be embedded. - Prefer
langchain_mcp_adapters.client.MultiServerMCPClientinstead of custom MCP transport code. - Prefer a durable checkpointer in production. Memory checkpointers are for local dev.
- Prefer typed state (
TypedDictor Pydantic) and reducer annotations over ad hoc dict mutation. - Prefer
thread_idas the stable resume cursor whenever checkpointing is in play.
Decision Table
| Need | Default |
|---|---|
| Fastest path to a capable agent with tools | create_agent(...) |
| Coding / research agent with planning, skills, files, delegation | create_deep_agent(...) |
| Deterministic workflow or custom branching | StateGraph(...) |
| Fan-out workers created at runtime | Send(...) |
| Pause for approval or data from outside the graph | interrupt() + Command(resume=...) |
| Expose MCP servers as tools | MultiServerMCPClient + load_mcp_tools(...) |
| Reuse a graph inside another orchestrator | subgraph or CompiledSubAgent |
Working Rules
- Do not hand-roll agent loops when
create_agentorcreate_deep_agentalready covers the shape. - Do not put LLM reasoning into MCP servers. MCP servers should expose tools, data, or side effects.
- Do not treat checkpointing as optional if you need interrupts, resumability, or durable execution.
- Do not call
asyncio.run()inside an already-running loop when loading MCP tools. - Do not share the full toolset with every subagent by default. Narrow tool scopes.
- Do not let parent and child agents silently share mutable state. Pass narrow typed context instead.
- Do not bury control flow in prompt text when the graph should express it in code.
What Good Looks Like
Good LangGraph-stack code usually has:
- one clear abstraction level
- explicit state schema
- explicit routing edges or delegation boundaries
- resumability model chosen up front
- streaming or logging path for observability
- tool isolation for specialist workers
- approval gates around risky side effects
Output Style
When implementing:
- State which abstraction you picked and why
- Use the smallest viable graph / agent shape
- Add typed state or typed runtime context
- Add checkpointing if the flow can pause, fail, or span turns
- Keep prompts specific to the node or subagent role
- Verify the invoked APIs match current LangGraph / LangChain patterns