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 skills add https://github.com/langchain-ai/skills-benchmarks --skill deep-agents-core
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.

Use Deep Agents WhenUse LangChain's create_agent When
Multi-step tasks requiring planningSimple, single-purpose tasks
Large context requiring file managementContext fits in a single prompt
Need for specialized subagentsSingle agent is sufficient
Persistent memory across sessionsEphemeral, single-session work
If you need to...MiddlewareNotes
Track complex tasksTodoListMiddlewareDefault enabled
Manage file contextFilesystemMiddlewareConfigure backend
Delegate workSubAgentMiddlewareAdd custom subagents
Add human approvalHumanInTheLoopMiddlewareRequires checkpointer
Load skillsSkillsMiddlewareProvide skill directories
Access memoryMemoryMiddlewareRequires Store instance
Create a basic deep agent with a custom tool and invoke it with a user message. ```python 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.
```typescript
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);
Configure a deep agent with all available options including subagents, skills, and persistence. ```python 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.
```typescript
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()
});
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

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: templates

SKILL.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.
SkillsMemory (AGENTS.md)
On-demand loadingAlways loaded at startup
Task-specific instructionsGeneral preferences
Large documentationCompact context
SKILL.md in directoriesSingle AGENTS.md file
Set up an agent with skills directory and filesystem backend for on-demand skill loading. ```python from deepagents import create_deep_agent from deepagents.backends import FilesystemBackend from langgraph.checkpoint.memory import MemorySaver

agent = create_deep_agent( backend=FilesystemBackend(root_dir=".", virtual_mode=True), skills=["./skills/"], checkpointer=MemorySaver() )

result = agent.invoke({ "messages": [{"role": "user", "content": "Use the python-testing skill"}] }, config={"configurable": {"thread_id": "session-1"}})

</python>
<typescript>
Set up an agent with skills directory and filesystem backend for on-demand skill loading.
```typescript
import { createDeepAgent, FilesystemBackend } from "deepagents";
import { MemorySaver } from "@langchain/langgraph";

const agent = await createDeepAgent({
  backend: new FilesystemBackend({ rootDir: ".", virtualMode: true }),
  skills: ["./skills/"],
  checkpointer: new MemorySaver()
});

const result = await agent.invoke({
  messages: [{ role: "user", content: "Use the python-testing skill" }]
}, { configurable: { thread_id: "session-1" } });
Load skill content into a Store backend for environments without filesystem access. ```python from deepagents import create_deep_agent from deepagents.backends import StoreBackend from deepagents.backends.utils import create_file_data from langgraph.store.memory import InMemoryStore

store = InMemoryStore()

Load skill content into store

skill_content = """--- name: python-testing description: Best practices for Python testing with pytest

Python Testing Skill

..."""

store.put( namespace=("filesystem",), key="/skills/python-testing/SKILL.md", value=create_file_data(skill_content) )

agent = create_deep_agent( backend=lambda rt: StoreBackend(rt), store=store, skills=["/skills/"] )

</python>
</ex-skills-with-store-backend>

<boundaries>
### What Agents CAN Configure

- Model selection and parameters
- Additional custom tools
- System prompt customization
- Backend storage strategy
- Which tools require approval
- Custom subagents with specialized tools

### What Agents CANNOT Configure

- Core middleware removal (TodoList, Filesystem, SubAgent always present)
- The write_todos, task, or filesystem tool names
- The SKILL.md frontmatter format
</boundaries>

<fix-checkpointer-for-interrupts>
<python>
Interrupts require a checkpointer.
```python
# WRONG
agent = create_deep_agent(interrupt_on={"write_file": True})

# CORRECT
agent = create_deep_agent(interrupt_on={"write_file": True}, checkpointer=MemorySaver())
Interrupts require a checkpointer. ```typescript // WRONG const agent = await createDeepAgent({ interruptOn: { write_file: true } });

// CORRECT const agent = await createDeepAgent({ interruptOn: { write_file: true }, checkpointer: new MemorySaver() });

</typescript>
</fix-checkpointer-for-interrupts>

<fix-store-for-memory>
<python>
StoreBackend requires a Store instance for persistent memory across threads.
```python
# WRONG
agent = create_deep_agent(backend=lambda rt: StoreBackend(rt))

# CORRECT
agent = create_deep_agent(backend=lambda rt: StoreBackend(rt), store=InMemoryStore())
StoreBackend requires a Store instance for persistent memory across threads. ```typescript // WRONG const agent = await createDeepAgent({ backend: (config) => new StoreBackend(config) });

// CORRECT const agent = await createDeepAgent({ backend: (config) => new StoreBackend(config), store: new InMemoryStore() });

</typescript>
</fix-store-for-memory>

<fix-thread-id-for-conversations>
<python>
Use consistent thread_id to maintain conversation context across invocations.
```python
# WRONG: Each invocation is isolated
agent.invoke({"messages": [{"role": "user", "content": "Hi"}]})
agent.invoke({"messages": [{"role": "user", "content": "What did I say?"}]})

# CORRECT
config = {"configurable": {"thread_id": "user-123"}}
agent.invoke({"messages": [...]}, config=config)
agent.invoke({"messages": [...]}, config=config)
Use consistent thread_id to maintain conversation context across invocations. ```typescript // WRONG: Each invocation is isolated await agent.invoke({ messages: [{ role: "user", content: "Hi" }] }); await agent.invoke({ messages: [{ role: "user", content: "What did I say?" }] });

// CORRECT const config = { configurable: { thread_id: "user-123" } }; await agent.invoke({ messages: [...] }, config); await agent.invoke({ messages: [...] }, config);

</typescript>
</fix-thread-id-for-conversations>

<fix-frontmatter-required>
```markdown
# WRONG: Missing frontmatter in SKILL.md
# My Skill
This is my skill...

# CORRECT: Include YAML frontmatter
---
name: my-skill
description: Python testing best practices with pytest fixtures and mocking
---
# My Skill
This is my skill...
Skills require a proper backend to load from the filesystem. ```python # WRONG: Skills won't load without proper backend agent = create_deep_agent(skills=["./skills/"])

CORRECT: Use FilesystemBackend for local skills

agent = create_deep_agent( backend=FilesystemBackend(root_dir=".", virtual_mode=True), skills=["./skills/"] )

</python>
</fix-backend-for-skills>

<fix-specific-skill-descriptions>
Use specific descriptions to help agents decide when to use a skill.
```markdown
# WRONG: Vague description
---
name: helper
description: Helpful skill
---

# CORRECT: Specific description
---
name: python-testing
description: Python testing best practices with pytest fixtures, mocking, and async patterns
---
Skills are not inherited by subagents - provide them explicitly. ```python # WRONG: Custom subagents don't inherit skills agent = create_deep_agent( skills=["/main-skills/"], subagents=[{"name": "helper", ...}] # No skills )

CORRECT: Provide skills explicitly

agent = create_deep_agent( skills=["/main-skills/"], subagents=[{"name": "helper", "skills": ["/helper-skills/"], ...}] )

</python>
</fix-subagent-skills>

Plus de skills de langchain-ai

langgraph-docs
langchain-ai
We need to translate the given text from English to French. The text describes an agent skill for accessing LangGraph documentation. We must preserve the name "langgraph-docs" but it's not in the text, so we don't include it. We translate the text inside <text>. No extra labels, no markdown, just the translation. The text: "Access LangGraph documentation to build stateful agents and multi-agent workflows. Fetches official LangGraph Python docs covering state machines, graph-based agent design, and human-in-the-loop patterns Prioritizes relevant documentation by query type: implementation guides for how-to questions, concept pages for theory, tutorials for end-to-end examples, and API references for technical details Automatically selects 2–4 most relevant documentation URLs and retrieves their content to answer..." We need to translate accurately, preserving technical terms like "LangGraph", "state machines", "graph-based agent design", "human-in-the-loop", "API references", etc. Also preserve numbers like "2–4". The ellipsis at the end should be kept. Let
official
langgraph-human-in-the-loop
langchain-ai
Mettre en pause l'exécution du graphe pour un examen, une approbation ou une validation humaine, puis reprendre avec leur saisie. Nécessite trois composants : un checkpoint (InMemorySaver ou PostgresSaver), un ID de thread dans la configuration, et des charges utiles d'interruption sérialisables en JSON. interrupt(value) met en pause et affiche les données ; Command(resume=value) reprend et renvoie cette valeur au nœud mis en pause. Tout le code avant interrupt() se réexécute lors de la reprise, donc les effets secondaires doivent être idempotents (utiliser upsert, pas insert). Prend en charge les workflows d'approbation,...
official
web-research
langchain-ai
Utilisez cette compétence pour les demandes liées à la recherche web ; elle fournit une approche structurée pour mener une recherche web
official
langchain-oss-primer
langchain-ai
Commencez TOUJOURS ICI pour tout projet de construction d’agent LangChain, Deep Agents ou LangGraph. Point de départ obligatoire avant de choisir d’autres compétences ou d’écrire quoi que ce soit…
official
skill-creator
langchain-ai
Guide pour créer des compétences efficaces qui étendent les capacités de l'agent avec des connaissances spécialisées, des flux de travail ou des intégrations d'outils. Utilisez cette compétence lorsque l'utilisateur…
official
social-media
langchain-ai
Rédige des publications pour les réseaux sociaux adaptées à chaque plateforme, avec un contenu basé sur des recherches et des images d’accompagnement générées. Prend en charge les posts LinkedIn (1 300 caractères, ton professionnel) et les fils Twitter/X (280 caractères par tweet, format 1/🧵). Nécessite de déléguer la recherche à un sous-agent avant la rédaction, puis de lire les résultats pour garantir l’exactitude et la pertinence. Génère automatiquement des images sociales accrocheuses via l’outil generate_social_image, avec des compositions audacieuses et à fort contraste optimisées pour les petits...
official
deep-agents-memory
langchain-ai
Backends mémoire et fichiers enfichables pour Deep Agents avec options de routage éphémère, persistante et hybride. Quatre types de backends : StateBackend (éphémère, limité à un thread), StoreBackend (persistant entre sessions), FilesystemBackend (accès disque réel pour développement local) et CompositeBackend (routage de différents chemins vers différents backends). FilesystemMiddleware fournit six outils d'opérations sur fichiers : ls, read_file, write_file, edit_file, glob, grep. CompositeBackend utilise la correspondance par préfixe le plus long pour router...
official
deep-agents-orchestration
langchain-ai
Orchestrer des sous-agents, planifier des tâches en plusieurs étapes et exiger l'approbation humaine pour les opérations sensibles. Déléguer le travail à des sous-agents spécialisés via l'outil de tâche ; les sous-agents personnalisés prennent en charge des ensembles d'outils et des invites système isolés, tandis que le sous-agent "généraliste" par défaut hérite de la configuration de l'agent principal. Planifier et suivre des workflows complexes avec write_todos, en organisant les tâches dans les états en attente, en cours et terminés ; nécessite un thread_id pour la persistance entre les invocations. Mettre en œuvre...
official