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
JavaScriptdeepagentsmiddlewareSubAgentMiddlewareOptions
Interface●Since v1.4

SubAgentMiddlewareOptions

Options for creating subagent middleware

Copy
interface SubAgentMiddlewareOptions

Properties

property
defaultInterruptOn: Record<string, boolean | __type> | null

The tool configs for the default general-purpose subagent

property
defaultMiddleware: AgentMiddleware<any, any, any, readonly ClientTool | ServerTool[]>[] | null

Default middleware to apply to custom subagents (WITHOUT skills from main agent)

property
defaultModel: string | LanguageModelLike

The model to use for subagents

property
defaultTools: StructuredTool<ToolInputSchemaBase, any, any, any>[]

The tools to use for the default general-purpose subagent

property
generalPurposeAgent: boolean

Whether to include the general-purpose agent

property
generalPurposeMiddleware: AgentMiddleware<any, any, any, readonly ClientTool | ServerTool[]>[] | null

Middleware specifically for the general-purpose subagent (includes skills from main agent). If not provided, falls back to defaultMiddleware.

property
subagents: SubAgent | CompiledSubAgent<ReactAgent<any> | Runnable<any, any, RunnableConfig<Record<string, any>>>>[]

A list of additional subagents to provide to the agent

property
systemPrompt: string | null

Optional custom system prompt override

property
taskDescription: string | null

Custom description for the task tool

View source on GitHub