deep-agents

Build batteries-included agents with planning, context management, subagent delegation, and sandboxed execution. Use for complex, multi-step tasks that need…

npx skills add https://github.com/langchain-ai/docs --skill deep-agents

Deep Agents

Deep Agents is the agent harness for complex, multi-step work: planning, a virtual filesystem for context, subagent delegation, and long-term memory. It is built on LangChain and the LangGraph runtime.

Start with Managed Deep Agents: a managed open-source harness for agents that plan, use tools, delegate to subagents, and work over long horizons. Alternatively, for maximum flexibility while using the same Deep Agents harness, use the Deep Agents SDK and host agents yourself, or run a custom Agent Server.

When to use

Use Deep Agents when you need to:

  • Handle complex, multi-step tasks that benefit from automatic planning
  • Manage context with a built-in virtual filesystem for large inputs
  • Delegate subtasks to specialized subagents
  • Run code safely in sandboxed execution environments
  • Use a terminal agent via Deep Agents Code

Default to Managed Deep Agents for new agents. Use the self-hosted SDK when the user needs to own the backend, store, checkpointer, or Agent Server.

When NOT to use

  • For simple tool-calling agents without planning or subagents, use LangChain agents instead—lighter weight
  • For custom graph-based orchestration with explicit control flow, use LangGraph directly
  • Deep Agents is the highest-level abstraction—it trades flexibility for convenience

Install

# Python
pip install deepagents

# JavaScript/TypeScript
npm install deepagents langchain @langchain/core

Quick reference

Create a deep agent

# pip install deepagents langchain-anthropic
from deepagents import create_deep_agent

def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"It's always sunny in {city}!"

agent = create_deep_agent(
    model="anthropic:claude-sonnet-4-6",
    tools=[get_weather],
    system_prompt="You are a helpful assistant",
)

result = agent.invoke(
    {"messages": [{"role": "user", "content": "What is the weather in SF?"}]}
)

Use Deep Agents Code

# Install Deep Agents Code
pip install deepagents-code

# Run an interactive terminal agent
deepagents

Built-in capabilities

CapabilityDescription
PlanningAutomatic task decomposition for complex requests
File systemVirtual filesystem for reading, writing, and managing context
SubagentsSpawn child agents for parallel subtask execution
Context managementAutomatic context compression for long conversations
Sandboxed executionRun code in isolated environments (Modal, Runloop, Daytona)
ProtocolsACP, MCP, and A2A support for interoperability

Key documentation

API reference

For SDK class and method details, use the LangChain API Reference site:

  • MCP server: https://reference.langchain.com/mcp

Related skills

  • langchain—Core building blocks that Deep Agents is built on
  • langgraph—Runtime that powers Deep Agents' durable execution
  • langsmith—Trace, evaluate, and deploy your deep agents

More skills from langchain-ai

api-docs
langchain-ai
OpenAPI documentation and REST API design patterns
arxiv-search
langchain-ai
Search arXiv for preprints and academic papers by topic with abstract retrieval. Query-based search across physics, mathematics, computer science, biology, statistics, and related fields Configurable result limit (default 10 papers) with results sorted by relevance Returns title and abstract for each matching paper Requires the arxiv Python package; install via pip if not already present
arxiv-search
langchain-ai
Search arXiv preprint repository for papers in physics, mathematics, computer science, quantitative biology, and related fields
blog-post
langchain-ai
Long-form blog post writing with research delegation, structured content templates, and AI-generated cover images. Delegates research to subagents before writing, storing findings in markdown for reference and context Enforces a five-part post structure: hook, context, main content (3–5 sections), practical application, and conclusion with call-to-action Generates SEO-optimized cover images using detailed prompts covering subject, style, composition, color, and lighting Outputs posts to...
code-review
langchain-ai
Perform a structured code review of changes, checking for correctness, style, tests, and potential issues.
coding-prefs
langchain-ai
Read the user's coding preferences from /memory/coding-prefs.md before making non-trivial style decisions, and append new preferences when the user gives…
competitor-analysis
langchain-ai
When asked to analyze competitors:
cudf-analytics
langchain-ai
Use for GPU-accelerated data analysis on datasets, CSVs, or tabular data using NVIDIA cuDF. Triggers when tasks involve groupby aggregations, statistical…