🧠 Deep Agents
Build agents for long, multi-step tasks — planning, subagents, a virtual filesystem and tools — with LangChain deepagents, step by step with code.
Start learning →- 1What Is a Deep Agent?What a deep agent is: an agent for long, multi-step tasks built on four pillars — planning, a virtual filesystem, subagents and a detailed system prompt.5 min read
- 2Planning: the write_todos PatternHow a deep agent stays on track: the write_todos planning pattern keeps a todo list in the model's attention across long tasks — explained with code.4 min read
- 3The Virtual FilesystemHow a deep agent offloads big results and notes to a virtual filesystem so long tasks don't overflow the prompt — and cost less. Explained with examples.4 min read
- 4Subagents & Context IsolationA deep agent delegates focused subtasks to specialist subagents, each with its own isolated context. Learn why that improves reliability — with the exact code.5 min read
- 5Writing the System PromptWhat to put in a deep agent's system prompt — role, workflow, tool use, delegation and guardrails — the part that makes it reliable on hard tasks.5 min read
- 6Giving Your Agent ToolsHow to give a deep agent tools: in deepagents a tool is a plain function whose docstring is its schema — plus how to plug in MCP servers. With code.5 min read
- 7Build Your First Deep AgentPut the four pillars together into a working LangChain deepagents agent — model, tools, a subagent and planning — with a complete, runnable code example.6 min read
- 8Testing & Debugging Deep AgentsHow to verify a deep agent's planning, filesystem and memory actually work — inspect the state, stream the run, trace with LangSmith and unit-test tools.5 min read
- 9Securing Deep AgentsA deep agent reads untrusted content, holds secrets and runs many steps — so it needs guardrails. Learn the real risks and how to defend against each.5 min read
Browse more tutorials & guides or explore all tools.