
Deepagents
- 21 installs
- 3 repo stars
- Updated July 2, 2026
- akillness/oh-my-gods
deepagents is a skill for building file-aware, tool-calling agents with the LangChain Deep Agents harness on top of LangGraph, using create_deep_agent().
About
This skill builds file-aware, tool-calling agents with LangChain Deep Agents, a batteries-included harness on top of LangGraph. It covers create_deep_agent(), subagent delegation, pluggable backends, skills, long-term memory, and human approval with interrupt_on. A Python developer uses it when they want a capable agent with planning, files, subagents, and memory rather than hand-authoring every graph edge.
- Build file-aware, tool-calling agents with LangChain Deep Agents and create_deep_agent()
- Pluggable backends: StateBackend, StoreBackend, FilesystemBackend, LocalShellBackend, CompositeBackend
- Subagent delegation, long-term memory, and human approval via interrupt_on
Deepagents by the numbers
- 21 all-time installs (skills.sh)
- Ranked #10,304 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 7, 2026 (Skillselion catalog sync)
deepagents capabilities & compatibility
Needs a tool-calling LLM provider (e.g. langchain-anthropic, langchain-openai); pip install deepagents
- Capabilities
- agent configuration · orchestration
- Works with
- github · anthropic · openai
- Use cases
- orchestration · memory
- Pricing
- Bring your own API key
What deepagents says it does
Build file-aware, tool-calling agents with LangChain Deep Agents.
Deep Agents is a batteries-included agent harness built on top of LangGraph.
npx skills add https://github.com/akillness/oh-my-gods --skill deepagentsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 21 |
|---|---|
| repo stars | ★ 3 |
| Last updated | July 2, 2026 |
| Repository | akillness/oh-my-gods ↗ |
What it does
Build a LangChain Deep Agents harness with backends, subagents, memory, and human-in-the-loop approval in Python.
Who is it for?
Building a tool-calling agent that needs file access, planning, subagents, and memory quickly
Skip if: Cases needing fully custom graph edges hand-authored in LangGraph without a harness
When should I use this skill?
You need create_deep_agent(), subagent delegation, pluggable backends, memory, or interrupt_on human approval
By the numbers
- 5 backend types
- 6-step build workflow
Files
deepagents
Deep Agents is a batteries-included agent harness built on top of LangGraph. Use it when the problem is "give me a capable agent with planning, files, subagents, and memory" rather than "let me hand-author every graph edge myself."
When to use this skill
- Building a tool-calling agent that needs file access and planning quickly
- Delegating bounded work to specialized subagents with context isolation
- Choosing between
StateBackend,FilesystemBackend,StoreBackend,CompositeBackend, orLocalShellBackend - Adding skills and long-term memory without bloating the core prompt
- Requiring human approval before sensitive tool calls with
interrupt_on - Using deepagents as a specialist inside a larger LangGraph supervisor
Installation
pip install -qU deepagentsInside an existing uv-managed project:
uv add deepagentsOptional provider and MCP packages:
pip install -qU langchain-anthropic langchain-openai langchain-google-genai
pip install -qU langchain-mcp-adaptersCore API
from deepagents import create_deep_agent
agent = create_deep_agent(
model="openai:gpt-5.4",
tools=[],
system_prompt="You are a careful engineering agent.",
middleware=[],
subagents=[],
skills=[],
memory=[],
response_format=None,
checkpointer=None,
backend=None,
interrupt_on=None,
debug=False,
name="deep-agent",
)Deep Agents work with LangChain chat models that support tool calling. The simplest selector is provider:model.
Instructions
Step 1: Start with the default harness
For many workflows, the zero-config harness is enough:
from deepagents import create_deep_agent
agent = create_deep_agent()
result = agent.invoke(
{"messages": [{"role": "user", "content": "List the Python files in this repo"}]}
)This gives you:
- planning via the built-in todo capability
- file tools such as
ls,read_file,write_file,edit_file,glob, andgrep - LangGraph runtime features such as streaming and resumability when a checkpointer is attached
Step 2: Pick the right backend
Match the backend to the trust boundary:
from deepagents.backends import CompositeBackend, FilesystemBackend, LocalShellBackend, StateBackend, StoreBackend
from langgraph.store.memory import InMemoryStore
agent = create_deep_agent(
backend=lambda rt: CompositeBackend(
default=StateBackend(rt),
routes={"/memories/": StoreBackend(rt)},
),
store=InMemoryStore(),
)Guidance:
StateBackend: default ephemeral workspace in LangGraph state, scoped to a threadStoreBackend: durable cross-thread memory and instructionsFilesystemBackend: real files under a root directory; prefervirtual_mode=TrueLocalShellBackend: host shell access, development-only, high riskCompositeBackend: mix scratch space and durable memory under different path prefixes
Step 3: Add subagents only for real context isolation
from deepagents import MemoryMiddleware, SubAgent, SubAgentMiddleware, create_deep_agent
researcher = SubAgent(
name="researcher",
description="Finds documentation and summarizes it",
system_prompt="Search broadly, return concise evidence.",
tools=[web_search_tool],
)
agent = create_deep_agent(
middleware=[
MemoryMiddleware(memory_files=["AGENTS.md"]),
SubAgentMiddleware(subagents=[researcher]),
]
)Use subagents when:
- the specialist needs a narrower tool set
- you want the supervisor context to stay clean
- a subtask can be delegated without the main agent rereading all prior context
Step 4: Add HITL for risky tools
Human approval requires both interrupt_on and a checkpointer:
from deepagents import create_deep_agent
from langgraph.checkpoint.memory import MemorySaver
agent = create_deep_agent(
checkpointer=MemorySaver(),
interrupt_on={
"write_file": {"allowed_decisions": ["approve", "reject"]},
"execute": {"allowed_decisions": ["approve", "edit", "reject"]},
},
)Resume on the same thread:
from langgraph.types import Command
config = {"configurable": {"thread_id": "job-7"}}
first = agent.invoke({"messages": [...]}, config=config, version="v2")
second = agent.invoke(Command(resume=[{"decision": "approve"}]), config=config, version="v2")Step 5: Use skills and memory for different jobs
agent = create_deep_agent(
skills=["./skills/langgraph-workflow"],
memory=["AGENTS.md", "TEAM_GUIDELINES.md"],
)Use:
skillsfor reusable workflows and domain-specific proceduresmemoryfor stable project knowledge, preferences, and house rules
Do not collapse both into a giant system prompt. Let the harness load them progressively.
Step 6: Use Deep Agents inside LangGraph when orchestration gets custom
If you need explicit retries, branching, or supervisor-owned state, use LangGraph outside and deepagents inside specialist nodes.
Examples
Example 1: Minimal file-aware agent
from deepagents import create_deep_agent
agent = create_deep_agent(model="openai:gpt-5.4")
result = agent.invoke(
{"messages": [{"role": "user", "content": "Summarize the README and note any missing setup steps"}]}
)Example 2: Composite backend with durable memory route
from deepagents import create_deep_agent
from deepagents.backends import CompositeBackend, StateBackend, StoreBackend
from langgraph.store.memory import InMemoryStore
agent = create_deep_agent(
backend=lambda rt: CompositeBackend(
default=StateBackend(rt),
routes={"/memories/": StoreBackend(rt)},
),
store=InMemoryStore(),
)Example 3: Research specialist subagent
from deepagents import SubAgent, SubAgentMiddleware, create_deep_agent
researcher = SubAgent(
name="researcher",
description="Searches docs and summarizes findings",
system_prompt="Return concise, source-backed notes.",
tools=[search_docs],
)
agent = create_deep_agent(
middleware=[SubAgentMiddleware(subagents=[researcher])]
)Example 4: HITL for shell execution
from deepagents import create_deep_agent
from langgraph.checkpoint.memory import MemorySaver
agent = create_deep_agent(
checkpointer=MemorySaver(),
interrupt_on={"execute": True},
)Best practices
1. Start with the default harness before customizing middleware. 2. Use StateBackend for scratch space and CompositeBackend when long-term memory is needed. 3. Treat LocalShellBackend as development-only and pair it with human approval. 4. Prefer FilesystemBackend(root_dir=..., virtual_mode=True) over unconstrained local file access. 5. Use skills for reusable capabilities and memory for persistent project context. 6. Add subagents for context isolation, not because multi-agent sounds impressive. 7. If routing becomes graph-shaped, move orchestration to LangGraph and keep deepagents as a specialist.
Framework selection guide
| Need | Recommendation |
|---|---|
| Fast path to a capable coding or ops agent | Deep Agents |
| Custom retry loops, branching, supervisor-owned state | LangGraph |
| Simple single-agent tool use | LangChain create_agent |
| Durable workflow plus specialist harness | LangGraph + Deep Agents hybrid |
References
- Deep Agents Overview
- Deep Agents Backends
- Deep Agents Human-in-the-loop
- Deep Agents Skills
- See
references/deepagents-api.mdfor backend, memory, and HITL notes
{
"skill_name": "deepagents",
"evals": [
{
"id": 1,
"prompt": "Build a Python agent with deepagents that can inspect a repo and suggest a plan.",
"expected_output": "Python code using create_deep_agent() and a note that the default harness already includes file-aware tools and planning support.",
"assertions": [
"Response includes create_deep_agent()",
"Response mentions built-in file tools",
"Response uses valid Python syntax"
]
},
{
"id": 2,
"prompt": "How do I add a research specialist subagent in deepagents?",
"expected_output": "Example using SubAgentMiddleware and a SubAgent definition with name, description, system_prompt, and tools.",
"assertions": [
"Response imports SubAgentMiddleware and SubAgent",
"SubAgent includes name, description, and system_prompt",
"Response explains that the main agent delegates to the specialist"
]
},
{
"id": 3,
"prompt": "Configure deepagents so shell commands require human approval before execution.",
"expected_output": "A create_deep_agent() example with interrupt_on plus a checkpointer and thread_id-based resume guidance.",
"assertions": [
"Response uses interrupt_on for execute",
"Response includes a checkpointer",
"Response mentions same thread_id for resume"
]
},
{
"id": 4,
"prompt": "I need scratch files during a run and durable memory across runs. Which deepagents backend should I use?",
"expected_output": "A CompositeBackend example that combines StateBackend for scratch space with StoreBackend for durable memory.",
"assertions": [
"Response mentions CompositeBackend",
"Response includes StateBackend and StoreBackend",
"Response explains why each route exists"
]
},
{
"id": 5,
"prompt": "Explain when to use skills versus memory in deepagents.",
"expected_output": "Clear differentiation: skills are reusable progressive-disclosure capabilities, memory is persistent project context.",
"assertions": [
"Response defines skills and memory separately",
"Response mentions progressive disclosure for skills",
"Response does not collapse both concepts into one"
]
},
{
"id": 6,
"prompt": "I already have a LangGraph supervisor. Should I still use deepagents?",
"expected_output": "Guidance that deepagents is a good specialist harness inside a larger LangGraph workflow when orchestration still belongs to the outer graph.",
"assertions": [
"Response explains hybrid usage",
"Response keeps LangGraph as the orchestrator",
"Response frames deepagents as a specialist harness"
]
}
]
}
Deep Agents Notes
What the harness gives you
Deep Agents is a LangGraph-backed harness for:
- planning and task decomposition
- file tools such as
ls,read_file,write_file,edit_file,glob, andgrep - subagent delegation through a built-in
taskcapability - persistence and HITL when compiled with a checkpointer
The harness is best used when you want a capable tool-using agent quickly. Use raw LangGraph when the workflow itself is the product.
Core entry point
from deepagents import create_deep_agent
agent = create_deep_agent(
model="openai:gpt-5.4",
tools=[],
middleware=[],
subagents=[],
skills=[],
memory=[],
response_format=None,
checkpointer=None,
backend=None,
interrupt_on=None,
debug=False,
name="deep-agent",
)Backend selection
StateBackend
- Default backend when you call
create_deep_agent()with no override - Ephemeral scratch filesystem stored in LangGraph state
- Persists within a thread when checkpoints are enabled
- Shared between supervisor and subagents
StoreBackend
- Durable storage backed by LangGraph store infrastructure
- Good for cross-thread memory or reusable instructions
- Often paired with
CompositeBackend
FilesystemBackend
- Real filesystem access under a configured root
- Prefer
virtual_mode=True - Keep secrets outside the allowed root
LocalShellBackend
- Real filesystem plus host shell execution
- High risk and development-only
- Pair with
interrupt_onapproval for any serious usage
CompositeBackend
Use when you want both scratch space and durable memory:
from deepagents.backends import CompositeBackend, StateBackend, StoreBackend
from langgraph.store.memory import InMemoryStore
agent = create_deep_agent(
backend=lambda rt: CompositeBackend(
default=StateBackend(rt),
routes={"/memories/": StoreBackend(rt)},
),
store=InMemoryStore(),
)HITL pattern
from deepagents import create_deep_agent
from langgraph.checkpoint.memory import MemorySaver
agent = create_deep_agent(
checkpointer=MemorySaver(),
interrupt_on={
"write_file": {"allowed_decisions": ["approve", "reject"]},
"execute": {"allowed_decisions": ["approve", "edit", "reject"]},
},
)Important points:
- HITL needs a checkpointer
- resume on the same
thread_id - use narrower
allowed_decisionsfor lower-risk tools if editing should not be allowed
Skills vs memory
Use skills= when you want progressive-disclosure capabilities that activate on matching user intent.
Use memory= when you want always-available project knowledge, norms, or instructions.
They solve different problems and should not be collapsed into one monolithic prompt.
Hybrid architecture
Use raw LangGraph to own:
- workflow state
- retry loops
- branching and approval routing
- checkpoint lifecycle
Use Deep Agents to own:
- tool-heavy specialist execution
- file-aware research or coding subtasks
- narrowly scoped delegated work
Links
- https://docs.langchain.com/oss/python/deepagents/overview
- https://docs.langchain.com/oss/python/deepagents/backends
- https://docs.langchain.com/oss/python/deepagents/human-in-the-loop
- https://docs.langchain.com/oss/python/deepagents/skills
#!/usr/bin/env bash
# deepagents setup script
# Validates environment and installs the deepagents SDK
set -euo pipefail
echo "=== deepagents Setup ==="
echo ""
# --- Python version check ---
if ! command -v python3 &>/dev/null; then
echo "ERROR: python3 not found. Install Python 3.11+ first."
exit 1
fi
python_version=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
major=$(echo "$python_version" | cut -d. -f1)
minor=$(echo "$python_version" | cut -d. -f2)
if [ "$major" -lt 3 ] || ([ "$major" -eq 3 ] && [ "$minor" -lt 11 ]); then
echo "ERROR: deepagents requires Python >= 3.11 (found $python_version)"
echo "Upgrade Python: https://python.org/downloads"
exit 1
fi
echo "✅ Python $python_version — OK"
# --- Install deepagents ---
install_python="${PYTHON_BIN:-python3}"
if ! "$install_python" -m pip --version &>/dev/null; then
echo "ERROR: python3 -m pip is not available."
exit 1
fi
if command -v uv &>/dev/null && [[ -f "pyproject.toml" ]]; then
echo "Installing deepagents into the current uv project..."
uv add deepagents
else
if [[ -n "${VIRTUAL_ENV:-}" ]]; then
echo "Installing deepagents into the active virtual environment..."
"$install_python" -m pip install -U deepagents
else
echo "No active virtualenv or pyproject.toml detected."
echo "Installing deepagents into the current user site-packages..."
"$install_python" -m pip install --user -U deepagents
fi
fi
echo "✅ deepagents installed"
# --- Optional: MCP adapters ---
if [ "${INSTALL_MCP:-0}" = "1" ]; then
echo "Installing MCP adapters..."
if command -v uv &>/dev/null && [[ -f "pyproject.toml" ]]; then
uv add langchain-mcp-adapters
else
"$install_python" -m pip install -U langchain-mcp-adapters
fi
echo "✅ langchain-mcp-adapters installed"
fi
# --- Optional: provider packages ---
if [ "${INSTALL_ANTHROPIC:-0}" = "1" ]; then
"$install_python" -m pip install -U langchain-anthropic && echo "✅ langchain-anthropic installed"
fi
if [ "${INSTALL_OPENAI:-0}" = "1" ]; then
"$install_python" -m pip install -U langchain-openai && echo "✅ langchain-openai installed"
fi
if [ "${INSTALL_GOOGLE:-0}" = "1" ]; then
"$install_python" -m pip install -U langchain-google-genai && echo "✅ langchain-google-genai installed"
fi
# --- Verify import ---
echo ""
echo "Verifying installation..."
"$install_python" -c "from deepagents import create_deep_agent, __version__; print(f'deepagents {__version__} — import OK')"
echo ""
echo "=== Setup complete ==="
echo ""
echo "Quick start:"
echo " from deepagents import create_deep_agent"
echo " agent = create_deep_agent()"
echo " result = agent.invoke({'messages': [{'role': 'user', 'content': 'Hello'}]})"
echo " print(result['messages'][-1].content)"
echo ""
echo "Docs: https://docs.langchain.com/oss/python/deepagents/overview"
Related skills
FAQ
What backends does deepagents offer?
StateBackend (ephemeral thread-scoped), StoreBackend (durable cross-thread memory), FilesystemBackend (real files under a root), LocalShellBackend (host shell, dev-only, high risk), and CompositeBackend (mix under path prefixes).
What is required for human-in-the-loop approval?
Human approval requires both interrupt_on and a checkpointer, and you resume on the same thread with a Command(resume=[...]).