Skip to main content

Documentation Index

Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-naomid-1779801766-572e290.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The easiest way to start building agents and applications powered by LLMs—with built-in capabilities for task planning, file systems for context management, subagent-spawning, and long-term memory. You can use deep agents for any task, including complex, multi-step tasks. Deep Agents is an “agent harness”. It is the same core tool calling loop as other agent frameworks, but with built-in capabilities that make agents reliable for real tasks:

Take actions in an environment

Take actions via tools, read and write files, execute code

Connect to your data

Load memories, skills, and domain knowledge at the right moment

Manage growing context

Summarize history and offload large results across long runs

Parallelize tasks

Delegate to general or specialized subagents running in isolated context windows

Stay in the loop

Pause for human approval at critical decision points

Improve over time

Update memory, skills, and prompts based on real usage
See Harness capabilities for a full breakdown of each component.
The LangSmith Engine detects issues in your Deep Agents traces and proposes fixes. You can open a pull request with the proposed fix directly from the Engine tab.
deepagents is a standalone library built on top of LangChain’s core building blocks for agents and using LangGraph’s tooling for running agents in production. The deepagents repository contains:
  • Deep Agents SDK: A package for building agents that can handle any task
  • Deep Agents Code: A terminal coding agent built on the Deep Agents SDK
  • ACP integration: An Agent Client Protocol connector for using deep agents in code editors like Zed
LangChain is the framework that provides the core building blocks for your agents. To learn more about the differences between LangChain, LangGraph, and Deep Agents, see Frameworks, runtimes, and harnesses. For a side-by-side comparison with Anthropic’s harness, see Deep Agents vs. Claude Agent SDK.

Create a deep agent

import * as z from "zod";
// npm install deepagents langchain @langchain/core
import { createDeepAgent } from "deepagents";
import { tool } from "langchain";

const getWeather = tool(
  ({ city }) => `It's always sunny in ${city}!`,
  {
    name: "get_weather",
    description: "Get the weather for a given city",
    schema: z.object({
      city: z.string(),
    }),
  },
);

const agent = createDeepAgent({
  tools: [getWeather],
  systemPrompt: "You are a helpful assistant",
});

console.log(
  await agent.invoke({
    messages: [{ role: "user", content: "What's the weather in Tokyo?" }],
  })
);
See the Quickstart and Customization guide to get started building your own agents and applications with Deep Agents.
Trace requests, debug agent behavior, and evaluate outputs with LangSmith. Follow the tracing quickstart to get set up. When ready for production, deploy to LangSmith Cloud for managed hosting.

When to use Deep Agents

Use the Deep Agents SDK 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 and summarization
  • Swap filesystem backends to use in-memory state, local disk, durable stores, sandboxes, or your own custom backend
  • Execute shell commands via the execute tool when using a sandbox backend
  • Run interpreter code with interpreters for tool composition, subagent orchestration, and structured data transformations
  • Delegate work to specialized subagents for context isolation
  • Persist memory across conversations and threads
  • Control filesystem access with declarative permission rules that restrict which files agents can read or write
  • Require human approval for sensitive operations with human-in-the-loop workflows
  • Use any model through provider-agnostic model support
For building simpler agents, consider using LangChain’s createAgent or building a custom LangGraph workflow.

Core capabilities

Deep Agents gives an agent the scaffolding it needs to work across long-running, multi-step tasks. The capabilities fall into a few categories:
QuestionCapabilityWhat it gives the agent
What should happen next?PlanningBreak a request into steps, track progress, and revise the plan as new information appears.
Where does the work go?Context managementStore files, intermediate outputs, and large tool results outside the model context window.
How does work get done?Tool use, shell execution, and interpretersCall your tools, run shell commands in sandboxes, and execute small programs for data transformation or orchestration.
How does the agent go deeper without losing focus?SubagentsDelegate focused work to isolated agents and return only the result to the main agent.
How does the agent learn over time?Memory and skillsPersist useful information across threads and load reusable procedures when they match the task.
How do you control risk?Backends, permissions, and human approvalChoose where files live, limit what the agent can read or write, and pause sensitive actions for review.
These pieces work together as a harness around the model:
  • Plan work: A built-in write_todos tool helps agents decompose complex tasks, track progress, and adapt their plan.
  • Manage context: File system tools (ls, read_file, write_file, edit_file) let agents move large results into files. Summarization compacts older conversation history during long runs.
  • Run code and commands: Sandbox backends provide an execute tool for tests, builds, git operations, and system tasks. Interpreters run JavaScript in an in-memory runtime for tool composition, subagent orchestration, and structured data transformations.
  • Delegate focused work: A built-in task tool lets agents spawn subagents for isolated subtasks, keeping the main agent focused on coordination.
  • Remember and reuse knowledge: Long-term memory persists information across threads, and skills package reusable workflows, domain knowledge, and instructions.
  • Control execution: Pluggable backends determine where files are stored. Permission rules restrict filesystem access, and human-in-the-loop workflows require approval for sensitive tool operations.
  • Start from useful defaults: Deep Agents includes system prompts that guide models to plan before acting, verify work, and manage context. You can customize or replace the defaults.

Get started

Quickstart

Build your first deep agent

Customization

Learn about customization options

Models

Configure models and providers

Backends

Choose and configure pluggable filesystem backends

Interpreters

Compose tools and transform data in QuickJS

Permissions

Control filesystem access with permission rules

Human-in-the-loop

Configure approval for sensitive operations

Code

Use Deep Agents Code

Reference

See the deepagents API reference