LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Configuration
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsConfigurationTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsConfiguration

Configuration

Deep agents are highly configurable. This page covers the main configuration options for customizing agent behavior.

Learn more: For comprehensive customization guides, see the Customization documentation.

Model Configuration

By default, deep agents use claude-sonnet-4-5-20250929. You can use any LangChain-compatible chat model.

import { ChatAnthropic } from "@langchain/anthropic";
import { ChatOpenAI } from "@langchain/openai";
import { createDeepAgent } from "deepagents";

// Using Anthropic
const agent = createDeepAgent({
  model: new ChatAnthropic({
    model: "claude-sonnet-4-20250514",
    temperature: 0,
  }),
});

// Using OpenAI
const agent2 = createDeepAgent({
  model: new ChatOpenAI({
    model: "gpt-5",
    temperature: 0,
  }),
});

System Prompt

Deep agents include a comprehensive built-in system prompt. Add use-case specific instructions to guide agent behavior.

import { createDeepAgent } from "deepagents";

const researchInstructions = `You are an expert researcher. 
Your job is to conduct thorough research, and then write a polished report.`;

const agent = createDeepAgent({
  systemPrompt: researchInstructions,
});

Interrupt Configuration (Human-in-the-Loop)

Configure which tools require human approval before execution.

Learn more: See Human-in-the-Loop for detailed patterns.

import { createDeepAgent } from "deepagents";

const agent = createDeepAgent({
  tools: [getWeather],
  interruptOn: {
    get_weather: {
      allowedDecisions: ["approve", "edit", "reject"],
    },
  },
});

API Reference

Functions

Function

createSettings

Create a Settings instance with detected environment.

Function

findProjectRoot

Find the project root by looking for .git directory.

Interfaces

Interface

Settings

Settings interface for project detection and path management.

Interface

SettingsOptions

Options for creating a Settings instance.

Interface

CreateDeepAgentParams

Configuration parameters for creating a Deep Agent