
Deep Agents Orchestration
Configure LangChain Deep Agents with subagent delegation, todo planning, and human-in-the-loop approval for production-grade agent workflows.
Overview
Deep Agents Orchestration is an agent skill for the Build phase that teaches subagent delegation, todo planning, and human approval middleware in LangChain Deep Agents.
Install
npx skills add https://github.com/langchain-ai/langchain-skills --skill deep-agents-orchestrationWhat is this skill?
- Documents three bundled orchestration layers: SubAgentMiddleware (task tool), TodoListMiddleware (write_todos), HumanInT
- Decision table for when to delegate to subagents vs keeping work on the main agent
- General-purpose default subagent shares main agent tools; supports custom subagents (e.g. researcher with search_papers)
- Subagent flow: task tool spawns isolated context, autonomous execution, final report back to main agent
- Automatically included when using create_deep_agent() from the Deep Agents stack
- 3 orchestration capabilities documented: SubAgentMiddleware, TodoListMiddleware, HumanInTheLoopMiddleware
Adoption & trust: 7.6k installs on skills.sh; 782 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
Your Deep Agent monoliths context, skips structured planning, or runs risky tools without a clear subagent or approval pattern.
Who is it for?
Solo builders using langchain deepagents who need task delegation, isolated subagent contexts, and approval gates in one stack.
Skip if: Simple single-turn chat wrappers with no LangChain Deep Agents dependency or teams avoiding Python agent middleware altogether.
When should I use this skill?
INVOKE THIS SKILL when using subagents, task planning, or human approval in Deep Agents.
What do I get? / Deliverables
You configure SubAgentMiddleware, TodoListMiddleware, and HITL so tasks delegate cleanly, plans persist via todos, and sensitive steps wait for human sign-off.
- Subagent configuration (default or custom)
- Todo-driven task plan via write_todos
- HITL-gated sensitive tool paths
Recommended Skills
Journey fit
Deep Agents orchestration is shelved under build because it implements runtime middleware while you assemble agent products. Agent-tooling is the right subphase for SubAgentMiddleware, TodoListMiddleware, and HITL patterns in create_deep_agent().
How it compares
Use as Deep Agents-specific orchestration guidance instead of generic prompt-only multi-agent roleplay.
Common Questions / FAQ
Who is deep-agents-orchestration for?
Indie developers and agent engineers implementing LangChain Deep Agents who must combine subagents, todos, and human-in-the-loop controls in production workflows.
When should I use deep-agents-orchestration?
During build/agent-tooling when you add the task tool for subagents, enable write_todos planning, or configure HITL interrupts before shipping an autonomous agent.
Is deep-agents-orchestration safe to install?
The skill documents HITL for sensitive ops but does not replace your threat model; check the Security Audits panel on this Prism page and review tool permissions you grant subagents.
SKILL.md
READMESKILL.md - Deep Agents Orchestration
<overview> Deep Agents include three orchestration capabilities: 1. **SubAgentMiddleware**: Delegate work via `task` tool to specialized agents 2. **TodoListMiddleware**: Plan and track tasks via `write_todos` tool 3. **HumanInTheLoopMiddleware**: Require approval before sensitive operations All three are automatically included in `create_deep_agent()`. </overview> --- ## Subagents (Task Delegation) <when-to-use-subagents> | Use Subagents When | Use Main Agent When | |-------------------|-------------------| | Task needs specialized tools | General-purpose tools sufficient | | Want to isolate complex work | Single-step operation | | Need clean context for main agent | Context bloat acceptable | </when-to-use-subagents> <how-subagents-work> Main agent has `task` tool -> creates fresh subagent -> subagent executes autonomously -> returns final report. **Default subagent**: "general-purpose" - automatically available with same tools/config as main agent. </how-subagents-work> <ex-custom-subagents> <python> Create a custom "researcher" subagent with specialized tools for academic paper search. ```python from deepagents import create_deep_agent from langchain.tools import tool @tool def search_papers(query: str) -> str: """Search academic papers.""" return f"Found 10 papers about {query}" agent = create_deep_agent( subagents=[ { "name": "researcher", "description": "Conduct web research and compile findings", "system_prompt": "Search thoroughly, return concise summary", "tools": [search_papers], } ] ) # Main agent delegates: task(agent="researcher", instruction="Research AI trends") ``` </python> <typescript> Create a custom "researcher" subagent with specialized tools for academic paper search. ```typescript import { createDeepAgent } from "deepagents"; import { tool } from "@langchain/core/tools"; import { z } from "zod"; const searchPapers = tool( async ({ query }) => `Found 10 papers about ${query}`, { name: "search_papers", description: "Search papers", schema: z.object({ query: z.string() }) } ); const agent = await createDeepAgent({ subagents: [ { name: "researcher", description: "Conduct web research and compile findings", systemPrompt: "Search thoroughly, return concise summary", tools: [searchPapers], } ] }); // Main agent delegates: task(agent="researcher", instruction="Research AI trends") ``` </typescript> </ex-custom-subagents> <ex-subagent-with-hitl> <python> Configure a subagent with HITL approval for sensitive operations. ```python from deepagents import create_deep_agent from langgraph.checkpoint.memory import MemorySaver agent = create_deep_agent( subagents=[ { "name": "code-deployer", "description": "Deploy code to production", "system_prompt": "You deploy code after tests pass.", "tools": [run_tests, deploy_to_prod], "interrupt_on": {"deploy_to_prod": True}, # Require approval } ], checkpointer=MemorySaver() # Required for interrupts ) ``` </python> </ex-subagent-with-hitl> <fix-subagents-are-stateless> <python> Subagents are stateless - provide complete instructions in a single call. ```python # WRONG: Subagents don't remember previous calls # task(agent='research', instruction='Find data') # task(agent='research', instruction='What did you find?') # Starts fresh! # CORRECT: Complete instructions upfront # task(agent='research', instruction='Find data on AI, save to /research/, return summary') ``` </python> <typescript> Subagents are stateless - provide complete instructions in a single call. ```typescript // WRONG: Subagents don't remember previous calls // task re