# Deep Agents Explained
<!--
ref: @content/youtube/langchain/2026-07-17-deep-agents-explained
version: 3
updated_at: 2026-10-31T18:14:17.576Z
-->

Sydney (LangChain, 2026-07-17): A basic model-plus-tools loop handles simple tasks well, but it breaks down on long-running work such as multi-topic research, file writing, and delegated planning.

**[Watch on YouTube](https://www.youtube.com/watch?v=GbzEDgcuGJU)**


*Synthesized from Sydney and Jake on LangChain, 2026-07-17.*

Sydney is a core maintainer of LangChain's open-source tooling (LangChain, LangGraph, and now mainly Deep Agents) who previously spent about a year and a half maintaining Pydantic and helped start Pydantic AI. Jake is a LangChain deployed engineer who works with teams building agents. This is a fireside chat with audience Q&A recorded at LangChain's headquarters.

## Core Thesis
A basic model-plus-tools loop handles simple tasks well, but it breaks down on long-running work such as multi-topic research, file writing, and delegated planning. Sydney describes Deep Agents as a "batteries included harness" that wraps that loop with planning, subagents, pluggable file-system backends, sandboxed execution, and automatic summarization. The aim is to keep the context window lean and to let developers stay model- and provider-agnostic. Sydney argues the next wave of agent impact outside software will come from agents that *write and run code*, not from coding agents themselves.

## Key Insights
- **What a "harness" means.** Sydney defines it as the engineering support built around every stage of the core loop, where a model with tools runs until it decides it is done. Claude Code counts as a deep agent. Deep research is the other flagship use case.
- **Core harness components, extending the 2023 ReAct pattern:**
  1. **Planning tool.** A to-do list the agent writes and checks off, much as humans do better when they write a plan down.
  2. **Subagents.** Assistants that go off, do work, and return a report.
  3. **File system / backend.** The central abstraction for files, memories, skills, and sandboxes.
  4. **Summarization.** Work continues until roughly **80%** of the context window is used, then the history is compacted so the agent never hits the limit.
- **File systems enable progressive disclosure.** The model gets just enough of a map of the file system to fetch relevant files when needed, without overloading context. Those files can hold skills (prompts), memory documents, or domain data.
- **"File system" really means abstract backends.** The file-system interface is easy for agents to understand, but in practice the data lives in databases, Notion, GitHub, and similar sources. Deep Agents provides:
  - built-in local file systems
  - LangGraph's short-term and long-term memory stores (Deep Agents runs on LangGraph)
  - a generic backend protocol for custom sources
  - a **composite backend** that merges sources, for example docs in Notion plus customer data elsewhere
- **Offloading large tool inputs and outputs** to the file system keeps huge results out of the prompt. Examples include data-analysis outputs and large multimodal payloads. The agent holds a pointer instead of the payload. This also delays summarization, which matters because summarizing always loses information and makes the agent more likely to drift from its goal.
- **Skills are just prompts that are easy to share.** The agent sees a short index, such as "you have a write-PowerPoint skill and a code-review skill," and loads the full instructions, which may run to hundreds of lines, only when a task calls for them. Sydney compares their spread to MCP's: a standard folder you can hand to a coworker to improve code quality or security.
- **Sandboxes are the route into non-coding industries.** Sydney expects agents to lean less on discrete tool calls and more on running code in sandboxes or REPLs, for example writing scripts to analyze a database and generate figures. Jake mentions sandbox providers Modal and Daytona and data-analysis agents that run SQL in isolated environments.
- **What a sandbox isolates.** In Sydney's view, auth and permissions are the biggest issue. Should a sandbox be scoped per conversation, per user across conversations, or per team? Probably never across a whole org.
- **Whole agent in the sandbox, or only tool calls?** Jake lays out the trade-off:
  - Running the whole agent inside the sandbox puts API keys and secrets in what is meant to be a safe zone.
  - Running only tool calls there adds network round-trip latency.
  - The market hasn't settled on either. LangChain CEO Harrison Chase has written a blog post on these paradigms.
- **Model and provider agnosticism is a core value.** The right model changes week to week, so avoiding vendor lock-in applies to sandbox providers as well as model providers. Jake's own model picks:
  - Gemini for image and video work
  - Claude/Anthropic for SQL and code generation
  - OpenAI's 5.2 for expressive writing and conversational, customer-facing responses
- **Deployment requirements Sydney lists:**
  - First-class human-in-the-loop, such as approving an email before it goes to your boss or approving a credit-card charge in a travel agent
  - Durable execution, so you can observe, roll back, and retry steps with different inputs
  - Streaming as a first-class primitive in LangGraph, so users see live updates and can interrupt or redirect the agent
- **Observability gets harder at scale.** Three, five, or ten tool calls are easy to reason about. Hundreds of tool calls over minutes of processing are not. LangSmith is adding AI insights through an assistant button in the bottom-right corner. It answers questions about a single trace or thread (a conversation) and aggregates failure statistics across runs.
- **Cost.** Jake says most cost comes from model calls, not hosting. Long-running research agents often make *fewer* model calls than quick-fire chat agents. Competition among providers keeps pushing inference and API prices down, and he does not see teams blocked by cost.
- **The four multi-agent architectures** LangChain's research found:
  1. Router
  2. Subagents (the one Deep Agents uses, because successful harnesses use it)
  3. Skills-as-personas
  4. Swarm (seen less often)
- **Deeply nested subagents.** Recursive patterns ("RLMs") are gaining popularity. Sydney thinks they are probably very effective but very slow.
- **Jake's framing of subagents:** a subagent is a tool that has its own tools. The same accuracy question applies at both levels. How many tools can a model choose between before it picks the wrong one? How many subagents can a planner route to before it routes badly? Only a very large problem space justifies deep trees.
- **Choosing between Deep Agents, workflows, and `create_agent`:**
  - Sydney sees Deep Agents as the future.
  - Custom middleware, which can plug in at any point in the loop, is the escape hatch for deterministic steps such as compliance checks.
  - `create_agent` from LangChain V1, the equivalent of `create_react_agent`, still fits simple cases with a few tools and no delegated planning. It also supports middleware.
  - The pieces compose. A mostly deterministic workflow can run a deep agent in its one agentic step.
- **Cross-provider content.** LangChain V1, released in October, introduced standard content blocks so content can pass between providers. One example is a subagent specialized in image generation on one provider working under a supervisor on another.
- **MCP and A2A.** Sydney thinks MCP may matter a bit less than it did three months ago as programmatic tool calling in REPLs and sandboxes grows. Provider-agnostic standards still matter, especially to enterprises. LangSmith deployments expose A2A endpoints and MCP endpoints.
- **Roadmap, as described for "March":**
  - A lightweight **REPL tool**, code-focused and lighter than a full sandbox.
  - **Model-controlled auto-compaction** (already available as opt-in). It lets the model decide when to summarize instead of using a fixed rule such as compacting at **85%**. This follows Lance's "learning the bitter lesson" blog post, which argues that giving the model more control tends to work better.

## Actionable Takeaways
1. **Start with a strong, use-case-specific prompt.** Deep Agents gets you running in about five lines of code: define your prompt and tools. Put the complexity in the prompt.
2. **Prompting tips from Sydney:**
   - Keep the prompt well organized.
   - Include both good and bad examples.
   - Don't neglect tool descriptions. Docstrings and argument types become part of the prompt, and an agent that misunderstands its tools will perform poorly.
3. **Set up evals early in LangSmith.** Run each prompt variant (for example, 10 versions) many times and compare results across runs. The earlier you commit to evals, the better your self-improving feedback loop.
4. **Offload large tool outputs to the file system** and give the agent references to them. This delays summarization and the information loss that comes with it.
5. **Package reusable instructions as skills** that load on demand, instead of putting long task-specific guidance in the system prompt.
6. **Use the composite backend** when context lives in several places, such as Notion docs, GitHub, and databases, so the agent sees one file-system-like interface.
7. **For data-heavy work, run code in a sandbox** (Modal, Daytona, etc.) or a REPL instead of adding many narrow tools. Decide sandbox scope (per conversation, per user, or per team) and where secrets live before deploying.
8. **Before production, add human-in-the-loop approval** for sensitive actions, use durable execution for rollback and retry, and stream progress to users.
9. **Try the Deep Agents CLI** for a Claude Code–like experience built on the Deep Agents SDK. It works with any model and sends traces to LangSmith automatically.
10. **Route models by strength,** since the harness is model-agnostic: Gemini for image and video, Anthropic for SQL and code, OpenAI for conversational writing.
11. **Keep subagent trees shallow** unless the problem space is very large. Every added level costs latency and routing accuracy.
12. **Use middleware for deterministic steps.** Use `create_agent` when you need only a few tools and no planning.

## Notable Quotes
> "Deep Agents is a batteries included harness for building agents that excel at complex and long running tasks." — Sydney

> "Skills are just prompts. They're fancy prompts, but they're really easy to share." — Sydney

> "I think the like avenue into that is not coding agents, but agents that write code. And sandboxes are the key to that." — Sydney

> "When you summarize you inherently lose information." — Sydney

> "Don't forget about your tools because the tool like descriptions also go into the prompt." — Sydney

> "The main cost comes from the model calls, not the actual infrastructure to host them." — Jake

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*