# Deep Agents

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

- Skill: `langchain-ai/deep-agents` (Agent Skill)
- Install (CLI): `npx get-skill add langchain-ai/deep-agents`
- Raw SKILL.md: https://api.skillmd.com/api/skills/langchain-ai/deep-agents/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: langchain-ai (https://skillmd.com/u/langchain-ai)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/langchain-ai/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](https://docs.langchain.com/oss/langchain/overview) and the [LangGraph](https://docs.langchain.com/oss/langgraph/overview) runtime.

Start with [Managed Deep Agents](/langsmith/managed-deep-agents-overview): 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](/oss/deepagents/overview#self-host-with-the-sdk) and host agents yourself, or run a custom [Agent Server](/langsmith/deployment).

## 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](https://docs.langchain.com/oss/langchain/overview) agents instead—lighter weight
- For custom graph-based orchestration with explicit control flow, use [LangGraph](https://docs.langchain.com/oss/langgraph/overview) directly
- Deep Agents is the **highest-level abstraction**—it trades flexibility for convenience

## Install

```bash
# Python
pip install deepagents

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

## Quick reference

### Create a deep agent

```python
# 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

```bash
# Install Deep Agents Code
pip install deepagents-code

# Run an interactive terminal agent
deepagents
```

### Built-in capabilities

| Capability | Description |
|-----------|-------------|
| Planning | Automatic task decomposition for complex requests |
| File system | Virtual filesystem for reading, writing, and managing context |
| Subagents | Spawn child agents for parallel subtask execution |
| Context management | Automatic context compression for long conversations |
| Sandboxed execution | Run code in isolated environments (Modal, Runloop, Daytona) |
| Protocols | ACP, MCP, and A2A support for interoperability |

## Key documentation

- [Managed Deep Agents](https://docs.langchain.com/langsmith/managed-deep-agents-overview)—Build deep agents with managed deployment infrastructure
- [Overview](https://docs.langchain.com/oss/python/deepagents/overview)—Harness overview and Managed vs self-host decision
- [SDK quickstart](https://docs.langchain.com/oss/python/deepagents/quickstart)—The same deep agents harness, self-hosted
- [Customization](https://docs.langchain.com/oss/python/deepagents/customization)—Configure models, tools, and behavior
- [Context engineering](https://docs.langchain.com/oss/python/deepagents/context-engineering)—Manage context for complex tasks
- [Subagents](https://docs.langchain.com/oss/python/deepagents/subagents)—Delegate work to child agents
- [Sandboxes](https://docs.langchain.com/oss/python/deepagents/sandboxes)—Run code in isolated environments
- [Code](https://docs.langchain.com/oss/deepagents/code/overview)—Deep Agents Code, the terminal agent interface

## API reference

For SDK class and method details, use the [LangChain API Reference](https://reference.langchain.com) 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

