Deep Agents is an agent harness. An opinionated, ready-to-run agent out of the box. Instead of wiring prompts, tools, and context management yourself, you get a working agent immediately and customize what you need.
What's included:
write_todos for task breakdown and progress trackingread_file, write_file, edit_file, ls, glob, grep for working memorytask for delegating work with isolated context windows[!NOTE] Looking for the Python package? See langchain-ai/deepagents.
npm install deepagents
# or
pnpm add deepagents
# or
yarn add deepagents
import { createDeepAgent } from "deepagents";
const agent = createDeepAgent();
const result = await agent.invoke({
messages: [
{
role: "user",
content: "Research LangGraph and write a summary in summary.md",
},
],
});
The agent can plan, read/write files, and manage longer tasks with sub-agents and filesystem tools.
[!TIP] For developing, debugging, and deploying AI agents and LLM applications, see LangSmith.
deepagents now publishes environment-specific entrypoints:
deepagents - default Node.js/server entrypoint with the full API.deepagents/browser - recommended browser entrypoint (no Node-only exports).deepagents/node - optional explicit Node.js entrypoint (same full API as deepagents).// Browser-safe usage
import { createDeepAgent, StateBackend } from "deepagents/browser";
// Node.js usage (recommended)
import { createDeepAgent, FilesystemBackend } from "deepagents";
// Optional explicit Node.js usage
// import { createDeepAgent, FilesystemBackend } from "deepagents/node";
Add tools, swap models, and customize prompts as needed:
import { ChatOpenAI } from "@langchain/openai";
import { createDeepAgent } from "deepagents";
const agent = createDeepAgent({
model: new ChatOpenAI({ model: "gpt-5", temperature: 0 }),
tools: [myCustomTool],
systemPrompt: "You are a research assistant.",
});
See the JavaScript Deep Agents docs for full configuration options.
createDeepAgent returns a compiled LangGraph graph, so you can use streaming, Studio, checkpointers, and other LangGraph features.
Deep Agents follows a "trust the LLM" model. The agent can do anything its tools allow. Enforce boundaries at the tool/sandbox level, not by expecting the model to self-police. See the security policy for more information.
Base sandbox implementation with execute() as the only abstract method.
Backend that routes file operations to different backends based on path prefix.
Backend that stores files in a LangSmith Hub agent repo (persistent).
Backend that reads and writes files directly from the filesystem.
LangSmith Sandbox backend for deepagents.
Filesystem backend with unrestricted local shell command execution.
Custom error class for sandbox operations.
Backend that stores files in agent state (ephemeral).
Backend that stores files in LangGraph's BaseStore (persistent).
Base sandbox implementation with execute() as the only abstract method.
Backend that routes file operations to different backends based on path prefix.
Backend that stores files in a LangSmith Hub agent repo (persistent).
LangSmith Sandbox backend for deepagents.
Custom error class for sandbox operations.
Backend that stores files in agent state (ephemeral).
Backend that stores files in LangGraph's BaseStore (persistent).
Thrown when createDeepAgent receives invalid configuration.
Thrown when createDeepAgent receives invalid configuration.
Backend that reads and writes files directly from the filesystem.
Filesystem backend with unrestricted local shell command execution.
Base sandbox implementation with execute() as the only abstract method.
Backend that routes file operations to different backends based on path prefix.
Thrown when createDeepAgent receives invalid configuration.
Backend that stores files in a LangSmith Hub agent repo (persistent).
LangSmith Sandbox backend for deepagents.
Custom error class for sandbox operations.
Backend that stores files in agent state (ephemeral).
Backend that stores files in LangGraph's BaseStore (persistent).
Base sandbox implementation with execute() as the only abstract method.
Backend that routes file operations to different backends based on path prefix.
Thrown when createDeepAgent receives invalid configuration.
Backend that stores files in a LangSmith Hub agent repo (persistent).
Backend that reads and writes files directly from the filesystem.
LangSmith Sandbox backend for deepagents.
Filesystem backend with unrestricted local shell command execution.
Custom error class for sandbox operations.
Backend that stores files in agent state (ephemeral).
Backend that stores files in LangGraph's BaseStore (persistent).
Create a Deep Agent.
Adapt a v1 BackendProtocol to BackendProtocolV2.
Adapt a sandbox backend from v1 to v2 interface.
Group structured matches into the legacy dict form used by formatters.
Check if content is empty and return warning message.
Create a FileData object.
Convert FileData to plain string content.
Format file content with line numbers (cat -n style).
Format structured grep matches using existing formatting logic.
Format grep search results based on output mode.
Format file data for read response with line numbers.
Determine MIME type from a file path's extension.
Search files dict for paths matching glob pattern.
Return structured grep matches from an in-memory files mapping.
Search file contents for literal text pattern.
Type guard to check if FileData contains binary content (Uint8Array).
Type guard to check if FileData is v1 format (content as line array).
Check whether a MIME type represents text content.
Convert FileData to v2 format, joining v1 line arrays into a single string.
Perform string replacement with occurrence validation.
Sanitize tool_call_id to prevent path traversal and separator issues.
Truncate list or string result if it exceeds token limit (rough estimate: 4 chars/token).
Update FileData with new content, preserving creation timestamp.
Validate and normalize a file path for security.
Validate and normalize a directory path.
Type guard to check if a backend supports execution.
Type guard to check if a backend is a sandbox protocol (v1 or v2).
Compute summarization defaults based on model profile.
Create a completion callback middleware for async subagents.
Create filesystem middleware with all tools and features.
Create a frozen HarnessProfile from user-provided options.
Create middleware for loading agent memory from AGENTS.md files.
Create middleware that enforces strict tool call / tool response parity in
Create backend-agnostic middleware for loading and exposing agent skills.
Create subagent middleware with task tool
Create summarization middleware with backend support for conversation history offloading.
Look up the HarnessProfile for a model spec string.
Type guard to distinguish async SubAgents from sync SubAgents/CompiledSubAgents.
Type guard to check if a backend supports execution.
Type guard to check if a backend is a sandbox protocol (v1 or v2).
Parse an untrusted JSON/YAML object into a validated
Register a harness profile for a provider or specific model.
Serialize a HarnessProfile to a JSON-compatible object.
Adapt a v1 BackendProtocol to BackendProtocolV2.
Adapt a sandbox backend from v1 to v2 interface.
Create a Deep Agent.
Native transformer that correlates task tool calls into
Create a Settings instance with detected environment.
Find the project root by looking for .git directory.
List skills from user and/or project directories.
Parse YAML frontmatter from a SKILL.md file per Agent Skills spec.
Adapt a v1 BackendProtocol to BackendProtocolV2.
Adapt a sandbox backend from v1 to v2 interface.
Compute summarization defaults based on model profile.
Create a completion callback middleware for async subagents.
Create a Deep Agent.
Create filesystem middleware with all tools and features.
Create a frozen HarnessProfile from user-provided options.
Create middleware for loading agent memory from AGENTS.md files.
Create middleware that enforces strict tool call / tool response parity in
Create a Settings instance with detected environment.
Create backend-agnostic middleware for loading and exposing agent skills.
Create subagent middleware with task tool
Native transformer that correlates task tool calls into
Create summarization middleware with backend support for conversation history offloading.
Find the project root by looking for .git directory.
Look up the HarnessProfile for a model spec string.
Type guard to distinguish async SubAgents from sync SubAgents/CompiledSubAgents.
Type guard to check if a backend supports execution.
Type guard to check if a backend is a sandbox protocol (v1 or v2).
Parse an untrusted JSON/YAML object into a validated
Register a harness profile for a provider or specific model.
Serialize a HarnessProfile to a JSON-compatible object.
Append text to a system message.
Create a preview of content showing head and tail with truncation marker.
Patch tool call / tool response parity in a messages array.
Prepend text to a system message.
Compute summarization defaults based on model profile.
Create a completion callback middleware for async subagents.
Create filesystem middleware with all tools and features.
Create middleware for loading agent memory from AGENTS.md files.
Create middleware that enforces strict tool call / tool response parity in
Create backend-agnostic middleware for loading and exposing agent skills.
Create subagent middleware with task tool
Create summarization middleware with backend support for conversation history offloading.
Type guard to distinguish async SubAgents from sync SubAgents/CompiledSubAgents.
Adapt a v1 BackendProtocol to BackendProtocolV2.
Adapt a sandbox backend from v1 to v2 interface.
Compute summarization defaults based on model profile.
Create a completion callback middleware for async subagents.
Create a Deep Agent.
Create filesystem middleware with all tools and features.
Create a frozen HarnessProfile from user-provided options.
Create middleware for loading agent memory from AGENTS.md files.
Create middleware that enforces strict tool call / tool response parity in
Create a Settings instance with detected environment.
Create backend-agnostic middleware for loading and exposing agent skills.
Create subagent middleware with task tool
Native transformer that correlates task tool calls into
Create summarization middleware with backend support for conversation history offloading.
Find the project root by looking for .git directory.
Look up the HarnessProfile for a model spec string.
Type guard to distinguish async SubAgents from sync SubAgents/CompiledSubAgents.
Type guard to check if a backend supports execution.
Type guard to check if a backend is a sandbox protocol (v1 or v2).
List skills from user and/or project directories.
Parse an untrusted JSON/YAML object into a validated
Parse YAML frontmatter from a SKILL.md file per Agent Skills spec.
Register a harness profile for a provider or specific model.
Serialize a HarnessProfile to a JSON-compatible object.
Evaluate permission rules against an operation + path and return the
Test whether path matches a glob pattern.
Canonicalize and validate an absolute path before permission checking.
Validate permission rule paths at setup time. Throws if any path is
Apply a profile's prompt overlay to a base prompt string.
Merge two harness profiles, layering override on top of base.
Normalize and validate a profile registry key.
Create a frozen HarnessProfile from user-provided options.
Look up the HarnessProfile for a model spec string.
Parse an untrusted JSON/YAML object into a validated
Register a harness profile for a provider or specific model.
Serialize a HarnessProfile to a JSON-compatible object.
Type guard: is this a fully-constructed HarnessProfile (frozen with
Apply a profile's prompt overlay to a base prompt string.
Create a frozen HarnessProfile from user-provided options.
Look up the HarnessProfile for a model spec string.
Merge two harness profiles, layering override on top of base.
Parse an untrusted JSON/YAML object into a validated
Register a harness profile for a provider or specific model.
Serialize a HarnessProfile to a JSON-compatible object.
List skills from user and/or project directories.
Parse YAML frontmatter from a SKILL.md file per Agent Skills spec.
Native transformer that correlates task tool calls into
Detect whether a model is an Anthropic model.
Create middleware for loading agent-specific long-term memory.
Create middleware for loading agent-specific long-term memory.