Two builders hit the same wall in the same week. Both say the same sentence: "my agent loses the plot on long tasks." It starts strong, then somewhere around step fifteen it forgets the original goal, re-does work it already did, or confidently answers the wrong question.

Builder A reaches for a deep-agent harness — planning tool, virtual file system, subagents, the whole rig. Builder B looks harder and finds his loop was choking on one bloated tool that dumped 8,000 tokens of raw JSON into context every call; he trims the tool output and the "long task" now fits in one clean loop.

Both fixes are real. Both builders can also be wrong. Reach for the harness on a task that never needed it and you've bought latency and a debugging headache. Trim the tool loop on a task that genuinely runs for fifty steps and you'll drift again next week. The question isn't which architecture is better. It's which one this task earns.

What a plain tool-calling loop actually is#

A plain loop is the ReAct pattern: the model reasons, picks an action (a tool call), observes the result, and repeats until it decides it's done (Yao et al., ICLR 2023). That's it. There is no separate memory, no plan artifact, no orchestration. All state — the goal, every intermediate result, every dead end — lives in the growing message history.

That simplicity is the strength. One transcript tells you everything that happened. It's cheap: no extra tool calls, no prompt bloat. It's fast: the model acts directly.

The failure mode is also structural. Because every observation piles into the same window, long horizons cause context rot. The original instruction slides toward the top and loses salience. Old tool outputs you no longer need still consume budget and dilute attention. The model starts pattern-matching on recent noise instead of the actual objective. This is the "loses the plot" symptom — and on a genuinely long task, no amount of prompt-tweaking fixes it, because the problem is that one linear context is doing too many jobs at once.

What a deep agent adds#

The LangChain Deep Agents framing names four ingredients that applications like Claude Code, Manus, and deep-research agents use to escape the shallow-loop ceiling. The deepagents package bundles them on top of LangGraph (repo, docs):

Notice what every one of these actually buys: bounded context growth over a long horizon. The planning tool anchors the goal. The file system evicts state from the window. Subagents quarantine exploratory mess. That's the whole value proposition — and it's a tax. Each planning call, each file read, each subagent spawn is extra latency and tokens, and the orchestrator prompt is a fixed context cost on every turn.

A deep agent's harness is a context-window and latency tax you pay up front to survive long tasks — on a task that fits in one loop, you're paying the tax and getting nothing back.

It's not either/or#

The cleanest way to think about this: a deep agent is a tool-calling loop with extra tools. Underneath, it's still reason-act-observe. The planning tool and file operations are just more tools the model can call; a subagent is the same loop nested one level down. There's no architectural chasm to leap.

That means you adopt the pattern incrementally, not all at once. Losing the goal? Add only the planning tool — a write_todos your model checks against. That alone fixes a surprising share of "drift" cases. Carrying too much intermediate state? Add one scratch file — a read/write pair — and let the model offload. You don't need subagents until you actually have independent sub-questions worth exploring in parallel.

If you want the full mental model, start with what deep agents are, then the hands-on build with deepagents, subagents, and planning. Not on LangChain? The same four ingredients port cleanly, as shown in deep agents on Pydantic AI. And if you're weighing the framework layer itself, see LangChain vs LangGraph vs the deepagents harness.

The decision rule#