跪拜 Guibai
← All articles
Frontend · Backend · JavaScript

LangChain Ships DeepAgents: Built-In Planning, File System, and Sub-Agents for Long-Running AI Tasks

By tangdou369098655 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Most agent frameworks collapse on tasks that span more than a few dozen steps because context windows fill up and sub-goals get lost. DeepAgents bakes in the scaffolding — file offloading, sub-agent isolation, persistent memory — that turns a demo into something that can run unattended overnight.

Summary

DeepAgents replaces the standard think-tool-observe loop with a structured runtime that writes to-do lists, offloads large results to a file system, and spawns isolated sub-agents for parallel work. It ships with both Python and TypeScript SDKs, a pluggable backend system (in-memory, local disk, or LangGraph Store), and a skills system that loads domain instructions on demand.

A terminal CLI, modeled after Claude Code, is included for direct coding and file operations. The framework targets multi-hour or multi-day autonomous workflows where vanilla LangChain agents typically exhaust their context windows or forget intermediate goals.

LangChain positions DeepAgents as the top layer in a three-tier stack: LangGraph provides deterministic runtime control, LangChain supplies the core agent loop and middleware, and DeepAgents adds the planning, memory, and delegation primitives needed for complex, long-lived tasks.

Takeaways
DeepAgents auto-generates to-do lists via write_todos/read_todos so agents don't lose track of multi-step goals.
Large tool outputs are automatically saved to a virtual file system instead of piling into the context window.
Sub-agents run in isolated contexts, preventing cross-task pollution when the main agent delegates work.
Long-term memory persists across sessions through LangGraph Store or a user-editable AGENTS.md file.
A skills system loads SKILL.md files on demand, giving agents domain-specific workflows without burning context.
Pluggable backends let you choose in-memory scratch storage, local disk, or persistent store per use case.
The included CLI works like Claude Code for terminal-based coding and file manipulation.
Both Python and TypeScript APIs are available, with near-identical feature sets.
Conclusions

LangChain is layering opinionated structure on top of its own low-level primitives, moving from 'build anything' toward 'build this kind of thing quickly'.

The file system as context offload is a pragmatic fix for token limits that avoids the complexity of full RAG pipelines for intermediate results.

Sub-agent isolation solves a real failure mode: when one sub-task's output contaminates another's reasoning, the whole plan degrades.

Progressive skill loading mirrors how human teams pull in specialists only when needed, keeping the main agent's working memory lean.

Shipping a CLI alongside the library signals that LangChain sees agentic coding tools as a primary use case, not an afterthought.

Concepts & terms
Agent Harness
A pre-assembled runtime that bundles planning, file I/O, sub-agent delegation, and memory, as opposed to a bare agent loop that only thinks and calls tools.
Sub-agent
A child agent spawned by the main agent to handle a specific sub-task in an isolated context window, preventing cross-task interference.
Progressive Disclosure
A design pattern where skills or instructions are loaded only when needed, rather than all at once, to conserve the agent's limited context window.
Pluggable Backend
A storage abstraction that lets the agent's file system run in-memory, on local disk, or backed by LangGraph's persistent store, chosen per deployment.
LangGraph Store
A persistent key-value store built into LangGraph that survives agent restarts, enabling cross-session memory.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗