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.
By default, deep agents use claude-sonnet-4-5-20250929. You can use any LangChain-compatible chat model.
from langchain.chat_models import init_chat_model
from deepagents import create_deep_agent
# Using the provider:model format
model = init_chat_model(model="openai:gpt-5")
agent = create_deep_agent(model=model)
# Or directly with a model instance
from langchain_anthropic import ChatAnthropic
model = ChatAnthropic(model="claude-sonnet-4-20250514")
agent = create_deep_agent(model=model)
Deep agents include a comprehensive built-in system prompt. Add use-case specific instructions to guide agent behavior.
from deepagents import create_deep_agent
research_instructions = """You are an expert researcher.
Your job is to conduct thorough research, and then write a polished report.
"""
agent = create_deep_agent(
system_prompt=research_instructions,
)
Configure which tools require human approval before execution.
Learn more: See Human-in-the-Loop for detailed patterns.
from langchain_core.tools import tool
from deepagents import create_deep_agent
@tool
def get_weather(city: str) -> str:
"""Get the weather in a city."""
return f"The weather in {city} is sunny."
agent = create_deep_agent(
model="anthropic:claude-sonnet-4-20250514",
tools=[get_weather],
interrupt_on={
"get_weather": {
"allowed_decisions": ["approve", "edit", "reject"]
},
}
)
Control how the agent stores files and manages state.
from deepagents import create_deep_agent
from deepagents.backends import StateBackend, StoreBackend, FilesystemBackend
# Default: StateBackend (in-memory, ephemeral)
agent = create_deep_agent()
# StoreBackend: Persistent storage
from langgraph.store.memory import InMemoryStore
agent = create_deep_agent(
backend=StoreBackend,
store=InMemoryStore(),
)
# FilesystemBackend: Real filesystem
agent = create_deep_agent(
backend=FilesystemBackend(root_dir="./agent-workspace"),
)