create_deep_agent has the following core configuration options:
- Model
- Tools
- System Prompt
- Middleware
- Subagents
- Backends (virtual filesystems)
- Human-in-the-loop
- Skills
- Memory
create_deep_agent.
Model
By default,deepagents uses claude-sonnet-4-5-20250929. You can customize the model by passing any supported or LangChain model object.
- OpenAI
- Anthropic
- Azure
- Google Gemini
- AWS Bedrock
- HuggingFace
Tools
In addition to built-in tools for planning, file management, and subagent spawning, you can provide custom tools:System prompt
Deep agents come with a built-in system prompt. The default system prompt contains detailed instructions for using the built-in planning tool, file system tools, and subagents. When middleware add special tools, like the filesystem tools, it appends them to the system prompt. Each deep agent should also include a custom system prompt specific to its specific use case:- Custom system_prompt (if provided)
- Base agent prompt
- To-do list prompt: instructions for how to plan with to do lists
- Memory prompt: AGENTS.md + memory usage guidelines (only when
memoryprovided) - Skills prompt: skills locations + list of skills with frontmatter information + usage (only when skills provided)
- Virtual filesystem prompt (filesystem + execute tool docs if applicable)
- Subagent prompt: task tool usage
- User-provided middleware prompts (if custom middleware is provided)
- Human-in-the-loop prompt (when
interrupt_onis set) - Local context prompt: current directory, project info,… (when using CLI locally)
Middleware
By default, deep agents have access to the following middleware:TodoListMiddleware: manages todo listsFilesystemMiddleware: file operationsSubAgentMiddleware: subagent spawningSummarizationMiddleware: message history summarizationAnthropicPromptCachingMiddleware: prompt cachingPatchToolCallsMiddleware: patches tool calls
MemoryMiddleware: if thememoryargument is providedSkillsMiddleware: if theskillsargument is providedHumanInTheLoopMiddleware: if theinterrupt_onargument is provided
Subagents
To isolate detailed work and avoid context bloat, use subagents:Backends
Deep agent tools can make use of virtual file systems to store, access, and edit files. By default, deep agents use aStateBackend.
If you are using skills or memory, you must add the expected skill or memory files to the backend before creating the agent.
- StateBackend
- FilesystemBackend
- StoreBackend
- CompositeBackend
An ephemeral filesystem backend stored in
langgraph state.This filesystem only persists for a single thread.Sandboxes
Sandboxes are specialized backends that run agent code in an isolated environment with their own filesystem and anexecute tool for shell commands.
Use a sandbox backend when you want your deep agent to write files, install dependencies, and run commands without changing anything on your local machine.
You configure sandboxes by passing a sandbox backend to backend when creating your deep agent:
- Modal
- Runloop
- Daytona
Human-in-the-loop
Some tool operations may be sensitive and require human approval before execution. You can configure the approval for each tool:Skills
You can use skills to provide your deep agent with new capabilities and expertise. While tools tend to cover lower level functionality like native file system actions or planning, skills can contain detailed instructions on how to complete tasks, reference info, and other assets, such as templates. These files are only loaded by the agent when the agent has determined that the skill is useful for the current prompt. This progressive disclosure reduces the amount of tokens and context the agent has to consider upon startup. For example skills, see Deep Agent example skills. To add skills to your deep agent, pass them as an argument tocreate_deep_agent:
- StateBackend
- StoreBackend
- FilesystemBackend
Memory
UseAGENTS.md files to provide extra context to your deep agent.
You can pass one or more file paths to the memory parameter when creating your deep agent:
- StateBackend
- StoreBackend
- FilesystemBackend
Structured ouput
Deep agents support structured ouput. You can set a desired structured output schema by passing it as theresponse_format argument to the call to create_deep_agent().
When the model generates the structured data, it’s captured, validated, and returned in the ‘structured_response’ key of the deep agent’s state.