Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Builds a LangGraph 1.0 Deep Agent with planner, subagents, virtual filesystem eviction, and bounded reflection loop.
64% 91%+27 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 14 of 22 without it.
To prevent infinite execution loops when subagents fail to complete tasks, what maximum depth cap should be placed on the reflection node, and what action is taken when exceeded?
Caps reflection depth at 5 rounds
3 of 3 safety checks passed
Two pains bite every team reproducing LangChain's late-2025 Deep Agents blueprint.
Virtual-FS state grows unboundedly (P51). The planner and every subagent
write plans, scratch notes, intermediate drafts, and tool outputs into
state["files"]. Nothing ever evicts them. After 50 tool calls, the checkpointed
state is 8 MB; every MemorySaver.put() takes 400 ms; a run that started
at 1.2 s per node visit ends at 2.5 s per node visit. The LangSmith trace viewer
times out loading the thread. The user sees latency doubling over the run with
no obvious tool-level culprit.
Subagent persona leak (P52). The naive prompt-composition inside the
blueprint APPENDS the subagent role message to the parent's system message
instead of replacing it. The research-specialist subagent receives:
"You are a senior planner coordinating subagents..." + "You are a research specialist..." — and responds as the planner. It produces generic task
decomposition instead of the specific lookup you asked for. The bug is invisible
in unit tests because both messages "sound right" to a reviewer.
This skill pins to langgraph 1.0.x + langchain-core 1.0.x and walks through
the four-component Deep Agent pattern — planner, subagent pool of 3-8
role-specialized workers, virtual filesystem with eviction, reflection
node with bounded depth 3-5 — and shows exactly how to avoid P51 (cleanup
node + checkpoint-on-boundary) and P52 (explicit SystemMessage(override=True)
for every subagent). Pain-catalog anchors: P51, P52.
langgraph >= 1.0, < 2.0 and langchain-core >= 1.0, < 2.0pip install langchain-anthropic or langchain-openailangchain-langgraph-agents (L26) — you already know create_react_agent,
tool schemas, recursion limitslangchain-langgraph-subgraphs (L30) — subagent ≈ subgraph with a bounded
contract; if L30 is not yet installed, the subagent construction in Step 3
is self-containedSkills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.