create_deep_agent(
model: str | BaseChatModel | None = None,
tools| Name | Type | Description |
|---|---|---|
model | str | BaseChatModel | None | Default: NoneThe model to use. Defaults to Use the |
tools | Sequence[BaseTool | Callable | dict[str, Any]] | None | Default: None |
system_prompt | str | SystemMessage | None | Default: None |
middleware | Sequence[AgentMiddleware] | Default: () |
subagents | list[SubAgent | CompiledSubAgent] | None | Default: None |
skills | list[str] | None | Default: None |
memory | list[str] | None | Default: None |
response_format | ResponseFormat | None | Default: None |
context_schema | type[Any] | None | Default: None |
checkpointer | Checkpointer | None | Default: None |
store | BaseStore | None | Default: None |
backend | BackendProtocol | BackendFactory | None | Default: None |
interrupt_on | dict[str, bool | InterruptOnConfig] | None | Default: None |
debug | bool | Default: False |
name | str | None | Default: None |
cache | BaseCache | None | Default: None |
Create a deep agent.
By default, this agent has access to the following tools:
write_todos: manage a todo listls, read_file, write_file, edit_file, glob, grep: file operationsexecute: run shell commandstask: call subagentsThe execute tool allows running shell commands if the backend implements SandboxBackendProtocol.
For non-sandbox backends, the execute tool will return an error message.
The tools the agent should have access to.
In addition to custom tools you provide, deep agents include built-in tools for planning, file management, and subagent spawning.
Custom system instructions to prepend before the base deep agent prompt.
If a string, it's concatenated with the base prompt.
Additional middleware to apply after the standard middleware stack
(TodoListMiddleware, FilesystemMiddleware, SubAgentMiddleware,
SummarizationMiddleware, AnthropicPromptCachingMiddleware,
PatchToolCallsMiddleware).
The subagents to use.
Each subagent should be a dict with the following keys:
namedescription (used by the main agent to decide whether to call the sub agent)prompt (used as the system prompt in the subagent)toolsmodel (either a LanguageModelLike instance or dict settings)middleware (list of AgentMiddleware)Optional list of skill source paths (e.g., ["/skills/user/", "/skills/project/"]).
Paths must be specified using POSIX conventions (forward slashes) and are relative
to the backend's root. When using StateBackend (default), provide skill files via
invoke(files={...}). With FilesystemBackend, skills are loaded from disk relative
to the backend's root_dir. Later sources override earlier ones for skills with the
same name (last one wins).
Optional list of memory file paths (AGENTS.md files) to load
(e.g., ["/memory/AGENTS.md"]).
Display names are automatically derived from paths.
Memory is loaded at agent startup and added into the system prompt.
A structured output response format to use for the agent.
The schema of the deep agent.
Optional Checkpointer for persisting agent state between runs.
Optional store for persistent storage (required if backend uses StoreBackend).
Optional backend for file storage and execution.
Pass either a Backend instance or a callable factory like lambda rt: StateBackend(rt).
For execution support, use a backend that implements SandboxBackendProtocol.
Mapping of tool names to interrupt configs.
Pass to pause agent execution at specified tool calls for human approval or modification.
Example: interrupt_on={"edit_file": True} pauses before every edit.
Whether to enable debug mode. Passed through to create_agent.
The name of the agent. Passed through to create_agent.
The cache to use for the agent. Passed through to create_agent.