Why LangChain Deep Agents Might Be the Agent Framework You Actually Need
Published: March 2026
Most AI agents built today are shallow. They loop through tool calls, respond to prompts, and handle single-turn tasks well enough. But ask them to plan a complex project over hours, manage their own context, or spawn specialised sub-agents for different parts of a task, and they fall apart.
That is the problem LangChain set out to solve with Deep Agents. And if you are building AI-powered products, consulting engagements, or internal automation for clients, this framework deserves your attention.
What Are Deep Agents?
Deep Agents is an open-source agent framework built by LangChain on top of LangGraph. It extracts the core architecture that makes tools like Claude Code, Manus, and OpenAI Deep Research so effective and makes it model-agnostic, customisable, and production-ready.
The name comes from the concept of "deep" agents versus "shallow" agents. A shallow agent calls tools in a loop. A deep agent plans over longer time horizons, manages its own context, delegates to sub-agents, and uses a filesystem as a shared workspace. The difference matters when your agent needs to do more than answer a single question.
The Four Pillars That Make Deep Agents Different
1. A Planning Tool (That Does Not Actually Do Anything)
One of the most fascinating design choices in Deep Agents is the write_todos planning tool. It is essentially a no-op. It does not execute anything. It just writes a todo list into the agent context.
But here is why that matters: it forces the agent to think about what it needs to do before doing it. This is context engineering, not function engineering. By making the agent articulate its plan before executing, it stays on track during long-running tasks. Claude Code uses the same pattern, and it is one of the reasons it handles complex multi-file codebases so well.
2. Sub-Agents for Isolated Context
Deep Agents can spawn sub-agents to handle individual tasks. Each sub-agent gets its own context window, its own conversation history, and its own set of instructions. The parent agent delegates, collects results, and synthesises.
This is critical for production use cases. If you are building an agent that researches a topic, writes content, and publishes it, you do not want all that context mixed together. Sub-agents keep things clean and focused.
3. Filesystem as Shared Workspace
The framework includes read_file, write_file, edit_file, ls, glob, and grep tools. But unlike a simple file reader, it treats the filesystem as a shared workspace. Sub-agents write their outputs to files, the parent agent reads them, and the virtual filesystem persists across the session.
This is the same pattern that makes Manus so effective at long-running tasks. When an agent can dump intermediate results to disk instead of holding everything in its context window, it can work on much more complex problems.
4. Auto Context Management
Long conversations accumulate context. Eventually, the context window fills up and the agent loses track of earlier instructions. Deep Agents handles this with automatic summarisation. When conversations get long, large outputs are saved to files and the agent gets a compressed summary instead of the raw history.
For any agent that runs for more than a few minutes, this is essential.
How Deep Agents Compare to Claude Code and Codex
LangChain provides a direct comparison with Anthropic Claude Agent SDK and OpenAI Codex SDK. The key differentiator is model flexibility.
Claude Code is tightly integrated with Anthropic models. Codex is tightly integrated with OpenAI models. Deep Agents works with any model that supports tool calling, including Anthropic, OpenAI, Google Gemini, Llama, Mistral, and hundreds more through LangChain model providers.
For a consultant or product builder, this matters a lot. If Anthropic changes pricing, if OpenAI releases a better model, or if a client has compliance requirements around data residency, you can swap the underlying model without rewriting your agent.
The Deep Agents CLI scored approximately 42.65% on Terminal Bench 2.0 using Claude Sonnet 4.5, which is on par with Claude Code at the same model tier. Performance is competitive even though the framework is model-agnostic.
Why This Matters for AI Consultancies
If you are delivering AI solutions to clients, you face a common problem: every client wants something slightly different. One needs a research agent. Another needs a code generation agent. A third needs an agent that processes documents and creates reports.
Building each one from scratch is expensive. Deep Agents gives you a working agent harness in three lines of code:
from deepagents import create_deep_agent
agent = create_deep_agent()
result = agent.invoke({"messages": [{"role": "user", "content": "Research this topic and write a summary"}]})
From there, you customise what you need. Add your own tools. Swap the model. Write a custom system prompt. Configure sub-agents for specific verticals. The heavy lifting of planning, context management, and delegation is already done.
Security: Trust the Tools, Not the Model
Deep Agents follows a "trust the LLM" philosophy. The agent can do anything its tools allow. You enforce boundaries at the tool level, not by expecting the model to self-police.
This means you can add human-in-the-loop approval for sensitive operations, sandbox individual tool executions, or restrict filesystem access. The security model is composable and per-tool.
For production deployments, this is the right approach. Prompt-based guardrails are fragile. Tool-level restrictions are deterministic.
Production Deployment
Deep Agents returns a compiled LangGraph graph. That means you get streaming, persistence, checkpointing, and the full LangGraph ecosystem out of the box. Deploy via LangSmith or self-host with the Agent Server.
It also supports MCP (Model Context Protocol) via langchain-mcp-adapters, so you can connect to any MCP-compatible tool server.
When Should You Use Deep Agents?
Use Deep Agents when your agent needs to:
- Plan over multiple steps before executing
- Run for longer than a few minutes without losing context
- Delegate to specialised sub-agents for different aspects of a task
- Use a filesystem for intermediate results and shared state
- Work with different models depending on the use case or client requirements
- Deploy to production with streaming, persistence, and observability
Use something simpler when your agent just needs to call a few tools and return a result. Not every agent needs to be deep.
Getting Started
pip install deepagents
Then create your agent, add your tools, customise the prompt, and deploy. The documentation at docs.langchain.com covers everything from basic setup to advanced patterns like custom sub-agents, remote sandboxes, and persistent memory.
For AI consultancies, product builders, and anyone shipping agents into production, Deep Agents is worth a serious look. It takes the hard-learned patterns from the best agents in the world and makes them accessible to everyone.
Frequently Asked Questions
What programming language is LangChain Deep Agents written in?
Deep Agents is available as both a Python SDK and a TypeScript SDK, with a full-featured CLI for terminal-based usage.
Is Deep Agents free to use?
Yes, Deep Agents is 100% open source under the MIT license. You can use it in commercial projects without restrictions.
Can Deep Agents work with local or open-source models?
Yes, Deep Agents is model-agnostic and works with any LLM that supports tool calling, including locally-hosted models like Llama, Mistral, and others through LangChain model providers.
How does Deep Agents handle long-running tasks?
Deep Agents uses automatic context summarisation, a virtual filesystem for intermediate storage, and sub-agent delegation to maintain performance and accuracy over long-running tasks.
What is the Terminal Bench score for Deep Agents?
The Deep Agents CLI scored approximately 42.65% on Terminal Bench 2.0 using Claude Sonnet 4.5, which is on par with Claude Code at the same model tier.



