Skip to main content
Deep agents are the easiest way to start building agents and applications powered by LLMs. With under 10 lines of code, you can connect to OpenAI, Anthropic, Google, and more. You can build agents in two ways: use deep agents for a batteries-included experience, or use LangChain for complete customization. Both the deepagents library and LangChain are built on LangGraph, our low-level agent orchestration framework and runtime which provides durable execution, streaming, human-in-the-loop, persistence, and more. To learn more about the differences, see Frameworks, runtimes, and harnesses.

When to use which

Use Deep Agents when you want to build agents that can:
  • Handle complex, multi-step tasks that require planning and decomposition
  • Manage large amounts of context through file system tools
  • Swap filesystem backends to use in-memory state, local disk, durable stores, sandboxes, or your own custom backend
  • Delegate work to specialized subagents for context isolation
  • Persist memory across conversations and threads
LangChain is the framework that provides the core building blocks for your agents, it uses the same core tool calling loop as deep agents but provides you with full control. Use LangChain when you want simpler agents or complete control for customization.
If in doubt, start with deep agents.

Create an agent

See the Quickstart and Customization guide to get started.
Use LangSmith to trace requests, debug agent behavior, and evaluate outputs. Set LANGSMITH_TRACING=true and your API key to get started.

Benefits

Both deep agents and LangChain agents share the same core benefits:

Standard model interface

Different providers have unique APIs for interacting with models, including the format of responses. LangChain standardizes how you interact with models so that you can seamlessly swap providers and avoid lock-in.

Easy to use, highly flexible agent

The agent abstraction is designed to be easy to get started with, letting you build a simple agent in under 10 lines of code. But it also provides enough flexibility to allow you to do all the context engineering your heart desires.

Built on top of LangGraph

All agents are built on top of LangGraph. This allows us to take advantage of LangGraph’s durable execution, human-in-the-loop support, persistence, and more.

Debug with LangSmith

Gain deep visibility into complex agent behavior with visualization tools that trace execution paths, capture state transitions, and provide detailed runtime metrics.

Deep Agents builtin capabilities

When you use Deep Agents, you get these built-in capabilities:

Planning and task decomposition

Deep agents include a built-in write_todos tool that enables agents to break down complex tasks into discrete steps, track progress, and adapt plans as new information emerges.

Context management

File system tools (ls, read_file, write_file, edit_file) allow agents to offload large context to in-memory or filesystem storage, preventing context window overflow and enabling work with variable-length tool results.

Pluggable filesystem backends

The virtual filesystem is powered by pluggable backends that you can swap to fit your use case. Choose from in-memory state, local disk, LangGraph store for cross-thread persistence, sandboxes for isolated code execution (Modal, Daytona, Deno), or combine multiple backends with composite routing. You can also implement your own custom backend.

Subagent spawning

A built-in task tool enables agents to spawn specialized subagents for context isolation. This keeps the main agent’s context clean while still going deep on specific subtasks.

Long-term memory

Extend agents with persistent memory across threads using LangGraph’s Memory Store. Agents can save and retrieve information from previous conversations.

Get started

Agents Quickstart

Build your first deep agent

Deep Agents CLI

Use a customizable coding agent on the command line