Deep Agents are an opinionated agent framework built on LangChain/LangGraph with built-in middleware:
- Task Planning: TodoListMiddleware for breaking down complex tasks
- Context Management: Filesystem tools with pluggable backends
- Task Delegation: SubAgent middleware for spawning specialized agents
- Long-term Memory: Persistent storage across threads via Store
- Human-in-the-loop: Approval workflows for sensitive operations
- Skills: On-demand loading of specialized capabilities
The agent harness provides these capabilities automatically - you configure, not implement.
| Use Deep Agents When | Use LangChain's create_agent When |
|---|
| Multi-step tasks requiring planning | Simple, single-purpose tasks |
| Large context requiring file management | Context fits in a single prompt |
| Need for specialized subagents | Single agent is sufficient |
| Persistent memory across sessions | Ephemeral, single-session work |
| If you need to... | Middleware | Notes |
|---|
| Track complex tasks | TodoListMiddleware | Default enabled |
| Manage file context | FilesystemMiddleware | Configure backend |
| Delegate work | SubAgentMiddleware | Add custom subagents |
| Add human approval | HumanInTheLoopMiddleware | Requires checkpointer |
| Load skills | SkillsMiddleware | Provide skill directories |
| Access memory | MemoryMiddleware | Requires Store instance |
Create a basic deep agent with a custom tool and invoke it with a user message.
Create a basic deep agent with a custom tool and invoke it with a user message.
Configure a deep agent with all available options including subagents, skills, and persistence.
Configure a deep agent with all available options including subagents, skills, and persistence.
Every deep agent has access to:
- Planning:
write_todos - Track multi-step tasks
- Filesystem:
ls, read_file, write_file, edit_file, glob, grep
- Delegation:
task - Spawn specialized subagents
Skills use **progressive disclosure** - agents only load content when relevant.
Directory Structure
| Skills | Memory (AGENTS.md) |
|---|
| On-demand loading | Always loaded at startup |
| Task-specific instructions | General preferences |
| Large documentation | Compact context |
| SKILL.md in directories | Single AGENTS.md file |
Set up an agent with skills directory and filesystem backend for on-demand skill loading.
Set up an agent with skills directory and filesystem backend for on-demand skill loading.
Load skill content into a Store backend for environments without filesystem access.
- Model selection and parameters
- Additional custom tools
- System prompt customization
- Backend storage strategy
- Which tools require approval
- Custom subagents with specialized tools
- Core middleware removal (TodoList, Filesystem, SubAgent always present)
- The write_todos, task, or filesystem tool names
- The SKILL.md frontmatter format
Interrupts require a checkpointer.
Interrupts require a checkpointer.
StoreBackend requires a Store instance for persistent memory across threads.
StoreBackend requires a Store instance for persistent memory across threads.
Use consistent thread_id to maintain conversation context across invocations.
Use consistent thread_id to maintain conversation context across invocations.
Skills require a proper backend to load from the filesystem.
Use specific descriptions to help agents decide when to use a skill.
Skills are not inherited by subagents - provide them explicitly.