/deep-agents-core
INVOKE THIS SKILL when building ANY Deep Agents application. Covers create_deep_agent(), harness architecture, SKILL.md format, and configuration options.
$ npx -y skills add langchain-ai/langchain-skills --skill deep-agents-core --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/deep-agents-core
Context preview
The summary Claude sees to decide when to auto-load this skill.
INVOKE THIS SKILL when building ANY Deep Agents application. Covers create_deep_agent(), harness architecture, SKILL.md format, and configuration options.
SKILL.md
deep-agents-core.SKILL.mdname: deep-agents-core
description: "INVOKE THIS SKILL when building ANY Deep Agents application. Covers create_deep_agent(), harness architecture, SKILL.md format, and configuration options."
<overview> Deep Agents are an opinionated agent framework built on LangChain/LangGraph with built-in middleware:
- **Task Planning**: TodoListMiddleware for breaking down complex tasks
- **Context Management**: Filesystem tools with pluggable backends
- **Task Delegation**: SubAgent middleware for spawning specialized agents
- **Long-term Memory**: Persistent storage across threads via Store
- **Human-in-the-loop**: Approval workflows for sensitive operations
- **Skills**: On-demand loading of specialized capabilities
The agent harness provides these capabilities automatically - you configure, not implement. </overview>
<when-to-use>
| Use Deep Agents When | Use LangChain's create_agent When | |---------------------|-----------------------------------| | Multi-step tasks requiring planning | Simple, single-purpose tasks | | Large context requiring file management | Context fits in a single prompt | | Need for specialized subagents | Single agent is sufficient | | Persistent memory across sessions | Ephemeral, single-session work |
</when-to-use>
<middleware-selection>
| If you need to... | Middleware | Notes | |------------------|------------|-------| | Track complex tasks | TodoListMiddleware | Default enabled | | Manage file context | FilesystemMiddleware | Configure backend | | Delegate work | SubAgentMiddleware | Add custom subagents | | Add human approval | HumanInTheLoopMiddleware | Requires checkpointer | | Load skills | SkillsMiddleware | Provide skill directories | | Access memory | MemoryMiddleware | Requires Store instance |
</middleware-selection>
<ex-basic-agent> <python> Create a basic deep agent with a custom tool and invoke it with a user message.
from deepagents import create_deep_agent
from langchain.tools import tool
@tool
def get_weather(city: str) -> str:
"""Get the weather for a given city."""
return f"It is always sunny in {city}"
agent = create_deep_agent(
model="claude-sonnet-4-5-20250929",
tools=[get_weather],
system_prompt="You are a helpful assistant"
)
config = {"configurable": {"thread_id": "user-123"}}
result = agent.invoke({
"messages": [{"role": "user", "content": "What's the weather in Tokyo?"}]
}, config=config)</python> <typescript> Create a basic deep agent with a custom tool and invoke it with a user message.
import { createDeepAgent } from "deepagents";
import { tool } from "@langchain/core/tools";
import { z } from "zod";
const getWeather = tool(
async ({ city }) => `It is always sunny in ${city}`,
{ name: "get_weather", description: "Get weather for a city", schema: z.object({ city: z.string() }) }
);
const agent = await createDeepAgent({
model: "claude-sonnet-4-5-20250929",
tools: [getWeather],
systemPrompt: "You are a helpful assistant"
});
const config = { configurable: { thread_id: "user-123" } };
const result = await agent.invoke({
messages: [{ role: "user", content: "What's the weather in Tokyo?" }]
}, config);</typescript> </ex-basic-agent>
<ex-full-configuration> <python> Configure a deep agent with all available options including subagents, skills, and persistence.
from deepagents import create_deep_agent
from deepagents.backends import FilesystemBackend
from langgraph.checkpoint.memory import MemorySaver
from langgraph.store.memory import InMemoryStore
agent = create_deep_agent(
name="my-assistant",
model="claude-sonnet-4-5-20250929",
tools=[custom_tool1, custom_tool2],
system_prompt="Custom instructions",
subagents=[research_agent, code_agent],
backend=FilesystemBackend(root_dir=".", virtual_mode=True),
interrupt_on={"write_file": True},
skills=["./skills/"],
checkpointer=MemorySaver(),
store=InMemoryStore()
)</python> <typescript> Configure a deep agent with all available options including subagents, skills, and persistence.
import { createDeepAgent, FilesystemBackend } from "deepagents";
import { MemorySaver, InMemoryStore } from "@langchain/langgraph";
const agent = await createDeepAgent({
name: "my-assistant",
model: "claude-sonnet-4-5-20250929",
tools: [customTool1, customTool2],
systemPrompt: "Custom instructions",
subagents: [researchAgent, codeAgent],
backend: new FilesystemBackend({ rootDir: ".", virtualMode: true }),
interruptOn: { write_file: true },
skills: ["./skills/"],
checkpointer: new MemorySaver(),
store: new InMemoryStore()
});</typescript> </ex-full-configuration>
<built-in-tools> Every deep agent has access to:
1. **Planning**: `write_todos` - Track multi-step tasks 2. **Filesystem**: `ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep` 3. **Delegation**: `task` - Spawn specialized subagents </built-in-tools>
---
SKILL.md Format
<skill-md-format> Skills use **progressive disclosure** - agents only load content when relevant.
Directory Structure
skills/
└── my-skill/
├── SKILL.md # Required: main skill file
├── examples.py # Optional: supporting files
└── templates/ # Optional: templatesSKILL.md Format
---
name: my-skill
description: Clear, specific description of what this skill does
---
# Skill Name
## Overview
Brief explanation of the skill's purpose.
## When to Use
Conditions when this skill applies.
## Instructions
Step-by-step guidance for the agent.
</skill-md-format>
<skills-vs-memory>
| Skills | Memory (AGENTS.md) | |--------|-------------------| | On-demand loading | Always loaded at startup | | Task-specific instructions | General preferences | | Large documentation | Compact context | | SKILL.md in directories | Single AGENTS.md file |
</skills-vs-memory>
<ex-skills-with-filesystem-backend> <python> Set up an agent with skills directory
Read more
name: deep-agents-core description: "INVOKE THIS SKILL when building ANY Deep Agents application. Covers create_deep_agent(), harness architecture, SKILL.md format, and configuration options."
<overview> Deep Agents are an opinionated agent framework built on LangChain/LangGraph with built-in middleware:
- **Task Planning**: TodoListMiddleware for breaking down complex tasks
- **Context Management**: Filesystem tools with pluggable backends
- **Task Delegation**: SubAgent middleware for spawning specialized agents
- **Long-term Memory**: Persistent storage across threads via Store
- **Human-in-the-loop**: Approval workflows for sensitive operations
- **Skills**: On-demand loading of specialized capabilities
The agent harness provides these capabilities automatically - you configure, not implement. </overview>
<when-to-use>
| Use Deep Agents When | Use LangChain's create_agent When | |---------------------|-----------------------------------| | Multi-step tasks requiring planning | Simple, single-purpose tasks | | Large context requiring file management | Context fits in a single prompt | | Need for specialized subagents | Single agent is sufficient | | Persistent memory across sessions | Ephemeral, single-session work |
</when-to-use>
<middleware-selection>
| If you need to... | Middleware | Notes | |------------------|------------|-------| | Track complex tasks | TodoListMiddleware | Default enabled | | Manage file context | FilesystemMiddleware | Configure backend | | Delegate work | SubAgentMiddleware | Add custom subagents | | Add human approval | HumanInTheLoopMiddleware | Requires checkpointer | | Load skills | SkillsMiddleware | Provide skill directories | | Access memory | MemoryMiddleware | Requires Store instance |
</middleware-selection>
<ex-basic-agent> <python> Create a basic deep agent with a custom tool and invoke it with a user message.
from deepagents import create_deep_agent
from langchain.tools import tool
@tool
def get_weather(city: str) -> str:
"""Get the weather for a given city."""
return f"It is always sunny in {city}"
agent = create_deep_agent(
model="claude-sonnet-4-5-20250929",
tools=[get_weather],
system_prompt="You are a helpful assistant"
)
config = {"configurable": {"thread_id": "user-123"}}
result = agent.invoke({
"messages": [{"role": "user", "content": "What's the weather in Tokyo?"}]
}, config=config)</python> <typescript> Create a basic deep agent with a custom tool and invoke it with a user message.
import { createDeepAgent } from "deepagents";
import { tool } from "@langchain/core/tools";
import { z } from "zod";
const getWeather = tool(
async ({ city }) => `It is always sunny in ${city}`,
{ name: "get_weather", description: "Get weather for a city", schema: z.object({ city: z.string() }) }
);
const agent = await createDeepAgent({
model: "claude-sonnet-4-5-20250929",
tools: [getWeather],
systemPrompt: "You are a helpful assistant"
});
const config = { configurable: { thread_id: "user-123" } };
const result = await agent.invoke({
messages: [{ role: "user", content: "What's the weather in Tokyo?" }]
}, config);</typescript> </ex-basic-agent>
<ex-full-configuration> <python> Configure a deep agent with all available options including subagents, skills, and persistence.
from deepagents import create_deep_agent
from deepagents.backends import FilesystemBackend
from langgraph.checkpoint.memory import MemorySaver
from langgraph.store.memory import InMemoryStore
agent = create_deep_agent(
name="my-assistant",
model="claude-sonnet-4-5-20250929",
tools=[custom_tool1, custom_tool2],
system_prompt="Custom instructions",
subagents=[research_agent, code_agent],
backend=FilesystemBackend(root_dir=".", virtual_mode=True),
interrupt_on={"write_file": True},
skills=["./skills/"],
checkpointer=MemorySaver(),
store=InMemoryStore()
)</python> <typescript> Configure a deep agent with all available options including subagents, skills, and persistence.
import { createDeepAgent, FilesystemBackend } from "deepagents";
import { MemorySaver, InMemoryStore } from "@langchain/langgraph";
const agent = await createDeepAgent({
name: "my-assistant",
model: "claude-sonnet-4-5-20250929",
tools: [customTool1, customTool2],
systemPrompt: "Custom instructions",
subagents: [researchAgent, codeAgent],
backend: new FilesystemBackend({ rootDir: ".", virtualMode: true }),
interruptOn: { write_file: true },
skills: ["./skills/"],
checkpointer: new MemorySaver(),
store: new InMemoryStore()
});</typescript> </ex-full-configuration>
<built-in-tools> Every deep agent has access to:
1. **Planning**: `write_todos` - Track multi-step tasks 2. **Filesystem**: `ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep` 3. **Delegation**: `task` - Spawn specialized subagents </built-in-tools>
---
SKILL.md Format
<skill-md-format> Skills use **progressive disclosure** - agents only load content when relevant.
Directory Structure
skills/
└── my-skill/
├── SKILL.md # Required: main skill file
├── examples.py # Optional: supporting files
└── templates/ # Optional: templatesSKILL.md Format
--- name: my-skill description: Clear, specific description of what this skill does --- # Skill Name ## Overview Brief explanation of the skill's purpose. ## When to Use Conditions when this skill applies. ## Instructions Step-by-step guidance for the agent.
</skill-md-format>
<skills-vs-memory>
| Skills | Memory (AGENTS.md) | |--------|-------------------| | On-demand loading | Always loaded at startup | | Task-specific instructions | General preferences | | Large documentation | Compact context | | SKILL.md in directories | Single AGENTS.md file |
</skills-vs-memory>
<ex-skills-with-filesystem-backend> <python> Set up an agent with skills directory
⚠️ — This project is in early development. APIs and skill content may change. Agent skills for building agents with LangChain, LangGraph, and Deep Agents. For LangSmith-specific trace and dataset workflows, use langsmith-skills.
Repo: langchain-ai/langchain-skills
Other skills on langchain-skills.
- /deep-agents-memory
INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent), FilesystemMiddleware, and CompositeBackend for routing.
Open skill - /deep-agents-orchestration
INVOKE THIS SKILL when using subagents, task planning, or human approval in Deep Agents. Covers SubAgentMiddleware, TodoList for planning, and HITL interrupts.
Open skill - /deepagents-python-quickstart
Scaffold a minimal local Deep Agent in Python by following the official quickstart, using provider-native web search instead of Tavily. Use when the user wants to quickly build or try a Deep Agent locally.
Open skill - /deepagents-typescript-quickstart
Scaffold a minimal local Deep Agent in TypeScript by following the official quickstart, using provider-native web search instead of Tavily. Use when the user wants to quickly build or try a Deep Agent locally.
Open skill - /ecosystem-primer
INVOKE FIRST for any LangChain / LangGraph / Deep Agents agent building project before consulting other skills or writing any agent code. Required starting point for up to date info on framework selection (LangChain vs LangGraph vs Deep Agents vs hybrid composition), agent
Open skill - /eval-engineering
Iteratively inspect an agent repository and optional user-provided traces, interview the user, and create, run, and audit Harbor evals one at a time. Use for agent evals, Harbor tasks, benchmark cases, verifier design, or controlled agent environments.
Open skill

