# Deep Agents vs LangChain vs LangGraph
**作者**: Sydney Runkle
**日期**: 2026-08-06T17:57:54.000Z
**来源**: [https://x.com/sydneyrunkle/status/2085425145209143338](https://x.com/sydneyrunkle/status/2085425145209143338)
---

Deep Agents, LangChain, and LangGraph each offer distinct approaches to building agents. In this post, we cover the key distinctions between our open source frameworks and when you should reach for each one.
Deep Agents, LangChain, and LangGraph are the three layers of our open source agent stack, built on the same philosophy: builders should be able to own every part of their agent: the model they choose, the context it sees, and the harness that runs it.
Each layer plays a different role and offers a different amount of control. LangGraph is an agent runtime, LangChain is an agent framework, and Deep Agents is an agent harness. The runtime offers the most control and the least abstraction; the harness offers the inverse. All three are fully composable, so you can move between layers instead of picking one.
# What each layer offers
Deep Agents is an off-the-shelf agent harness: The job of an agent harness is to get the right context to the model at the right time via context engineering. Deep Agents comes with a bunch of best practices for this out of the box. These include:
- A filesystem, used to read and write context from (when you don’t want it directly in the context window of an LLM)
- Subagents, useful for doing specialized work without bloating the main context window
- Skills, so you can provide instructions and scripts that an agent can load on demand
- Memory, so the agent can learn and improve across runs
There are many other pieces it ships with by default. These are opinionated context management best practices that our team constantly reviews and updates. One of the benefits of using Deep Agents is that you can trust us to constantly be surveying the landscape and bringing best practices here.
Getting started is simple with create_deep_agent:
```
from deepagents import create_deep_agent
agent = create_deep_agent(
model="anthropic:claude-sonnet-5",
tools=[web_search],
system_prompt="you are a research agent...",
# skills path with citation-format, source-eval
skills=["./skills/"],
)
```
LangChain is the agent framework: the abstraction and integrations layer. It ships with a super minimal agent harness. Whereas Deep Agents ships with best practices around context management, the LangChain agent abstraction is incredibly minimal and un-opinionated.
The core agent abstraction is pretty simple: an LLM, running in a loop, calling tools.

This loop is incredibly simple, yet super powerful. There may, however, be times where you want to modify that loop. Usually this modifications are done to add more deterministic steps - like summarizing when context is close to full, or running a verifier at the end. One of the most powerful parts of LangChain’s agents is how we let you add these modifications. LangChain middleware provides a set of hooks that can modify this loop in variety of ways.

> 🧠 Fun Fact!
> Deep Agents is actually just the core LangChain agent plus a bunch of middleware!
You can use LangChain agents with the simple create_agent abstraction:
```
from langchain.agents import create_agent
agent = create_agent(
model="anthropic:claude-sonnet-5",
tools=[send_email],
prompt="you are my email assistant...",
middleware=[...]
)
```
LangGraph is the agent runtime: a graph-based framework for custom agent workflows, backed by a durable engine with human-in-the-loop, fault tolerance, and observability at every step. One of the benefits of thinking of agents as graphs is that you can encode more determinism into them, and more closely control the steps that occur.
LangGraph powers the agent abstractions (seen above, displayed as graphs) in both LangChain and Deep Agents.
# When to reach for each
> 🔊 Rule of thumb
> Start with Deep Agents. It’s a very powerful agent harness with all of the bells and whistles included. When you need to model a complex workflow or want complete control of every step, reach for LangChain and LangGraph.
## Deep Agents
Reach for Deep Agents when you want a capable agent out of the box. This is where most builders should start, dropping down only if you need more control over the harness itself.
Say you're building a GTM agent. It needs memory per rep (with things like email style preferences and relationship understanding), skills for recurring workflows like QBR prep, and subagents to do deep research an account across call transcripts, news, and CRM history.
This isn’t just a toy example: we built our GTM agent on deepagents! It currently sees heavy traffic, almost 10k requests per week, and over 150 active users. 26% of the traffic is user initiated, and the remaining 74% is driven by ambient agent work. We deploy it with LangSmith deployments, which supports both the bursty traffic and the scheduled/event-triggered ambient runs.
## LangChain
Reach for LangChain when you want the core building blocks and/or plan to assemble your own bespoke harness on top. LangChain's integrations and abstractions can be useful at any level: in custom graphs, with create_agent, and with create_deep_agent. It's a good fit too when you want fine-grained control over which tools and context reach the model at each step, ultra latency-sensitive apps often want this.
Say you're building a RAG docs Q&A bot: given a question, the agent searches your vector store for relevant pages. The agent loop governs whether or not a satisfactory answer has been reached, and drives the bot until the query is complete. This type of agent doesn’t need delegation via subagents or context management via a filesystem. LangChain's integrations let you plug in any vector store as a tool and pick whichever model you want, and create_agent gives you the loop that ties them together.
## LangGraph
Reach for LangGraph when your agent doesn't fit a standard loop, or you need to mix deterministic and agentic steps in the same workflow.
Say you're building a rental application processing pipeline. It has a few steps:
1. Extract income, credit, and rental history from each application
2. Score it against the landlord's criteria
3. Auto-approve clear qualifiers, reject clear non-qualifiers, or escalate borderline cases to a human.

Only step 1 touches an LLM, the rest is fixed code. This workflow uses the power of LLMs to extract information from documents, but it doesn't give the model any tools with which it can take action. It's a relatively deterministic pipeline.
Already on LangGraph? Stay if the value is in the graph's shape and its deterministic steps. If your LangGraph flow is highly agentic, you could benefit from a migration to Deep Agents.
## All Three
All three are composable: drop create_agent or create_deep_agent into a larger LangGraph workflow, or drop a custom LangGraph workflow in as a subagent inside create_agent or create_deep_agent.
No matter which package you build with, you can deploy with LangSmith deployments and observe with LangSmith observability.
# Balancing determinism and agency
More autonomy gives an agent more potential value, at the cost of reliability. Determinism is the better call for sensitive or preset workflows, and for repeatable tasks that don't need to be agentic at all. The more dynamic an agent is, the more capable and creative it can be. For more examples of these tradeoffs in production, listen to Max Agency, our podcast on how teams design, deploy, and iterate on real agent systems.
The three layers sit at different points on that spectrum. LangGraph offers maximal determinism: it lets you encode domain knowledge directly into the graph's topology instead of leaving that judgment to a model. LangChain sits in the middle: the core agent loop is inherently non-deterministic, the model decides what happens next at every step. Deep Agents offers maximal agency: an agent loop that can run for longer and fan out at scale because of builtin features like summarization and subagents.

> 🎧 For deeper conversations with teams building the best agents, listen to our podcast, Max Agency.
Many agents run on the core agent loop but still need a few deterministic steps built in: an approval step, a compliance check, a business rule that shouldn't be left to the model. Middleware solves this for Deep Agents and LangChain, letting you inject these steps and human-in-the-loop moments around the core loop.
If you need more flexibility or control than middleware offers through these builtin hooks, LangGraph is the escape hatch that lets you build a completely custom graph, encoding your workflow's specific logic directly into its shape, like the fan-out-and-synthesize example above.
## Why three layers
LangChain launched in October 2022 as the fastest way to get an LLM app running. As agents got more complex, people needed more control than a chain could give them, so we introduced LangGraph in January 2024: a graph-based runtime with durable execution, streaming, and human-in-the-loop built in as first class primitives.
As models got better, the core agent loop, a model that plans, calls tools, and reacts to results, became powerful enough to standardize. create_agent became LangChain's minimal harness, which we built on top of LangGraph because production agents need its primitives (human-in-the-loop, observability, fault tolerance, etc).
Then in July 2025 we went a layer further with Deep Agents, built on the same core loop, but with the aforementioned components (context management, subagents, etc.) bundled by default. Inspired by Claude Code and Manus, we bet builders wanted equally powerful agents for their own use cases, so we built deepagents as a general-purpose harness.
# TL;DR
Start with Deep Agents' create_deep_agent if you're building or reworking an agent, it's what we use for all of our internal agents: GTM, coding, docs writing, and more.
Pick up LangChain's create_agent instead when you want less built-in context management and more fine-grained control over your agent loop.
Reach for LangGraph when you need even more control or determinism in a custom workflow.
## Acknowledgements
Thanks to Harrison Chase, Hunter Lovell, Morgan Curtis, and Sean Roche for their thoughtful reviews!
## 相关链接
- [Sydney Runkle](https://x.com/sydneyrunkle)
- [@sydneyrunkle](https://x.com/sydneyrunkle)
- [55K](https://x.com/sydneyrunkle/status/2085425145209143338/analytics)
- [Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview)
- [LangChain](https://docs.langchain.com/oss/python/langchain/overview)
- [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview)
- [filesystem](https://docs.langchain.com/oss/python/deepagents/backends)
- [Subagents](https://docs.langchain.com/oss/python/deepagents/subagents)
- [Skills](https://docs.langchain.com/oss/python/deepagents/skills)
- [Memory](https://docs.langchain.com/oss/python/deepagents/memory)
- [create_deep_agent](https://docs.langchain.com/oss/python/deepagents/quickstart)
- [middleware](https://www.langchain.com/blog/how-middleware-lets-you-customize-your-agent-harness)
- [bunch of middleware](https://docs.langchain.com/oss/python/deepagents/overview#core-capabilities)
- [create_agent](https://docs.langchain.com/oss/python/langchain/quickstart)
- [human-in-the-loop](https://docs.langchain.com/oss/python/langgraph/interrupts)
- [fault tolerance](https://docs.langchain.com/oss/python/langgraph/fault-tolerance)
- [built our GTM agent](https://www.langchain.com/blog/how-we-built-langchains-gtm-agent)
- [LangSmith deployments](https://docs.langchain.com/langsmith/deployment)
- [LangSmith deployments](https://docs.langchain.com/langsmith/deployment)
- [LangSmith observability](https://docs.langchain.com/langsmith/observability)
- [Max Agency](https://www.youtube.com/playlist?list=PLfaIDFEXuae3UwB1QGEjsRAr8BzCQss7s)
- [Max Agency](https://podcasts.apple.com/us/podcast/max-agency/id1891551672)
- [encoding your workflow's specific logic directly into its shape](https://www.langchain.com/blog/3-years-of-graph-engineering-with-langgraph)
- [create_deep_agent](https://docs.langchain.com/oss/python/deepagents/quickstart)
- [create_agent](https://docs.langchain.com/oss/python/langchain/quickstart)
- [Harrison Chase](https://x.com/hwchase17)
- [Hunter Lovell](https://x.com/huntlovell)
- [Morgan Curtis](https://www.linkedin.com/in/morganc41/)
- [Sean Roche](https://linkedin.com/in/sean-roche01)
- [Upgrade to Premium](https://x.com/i/premium_sign_up)
- [1:57 AM · Aug 7, 2026](https://x.com/sydneyrunkle/status/2085425145209143338)
- [55.3K Views](https://x.com/sydneyrunkle/status/2085425145209143338/analytics)
- [View quotes](https://x.com/sydneyrunkle/status/2085425145209143338/quotes)
---
*导出时间: 2026/8/7 20:48:06*
---
## 中文翻译
# Deep Agents vs LangChain vs LangGraph
**作者**: Sydney Runkle
**日期**: 2026-08-06T17:57:54.000Z
**来源**: [https://x.com/sydneyrunkle/status/2085425145209143338](https://x.com/sydneyrunkle/status/2085425145209143338)
---

Deep Agents、LangChain 和 LangGraph 各自提供了构建智能体的不同方法。在这篇文章中,我们将介绍我们的开源框架之间的关键区别,以及你应该在什么情况下选择使用哪一个。
Deep Agents、LangChain 和 LangGraph 是我们开源智能体技术栈的三个层级,它们都建立在相同的理念之上:构建者应该能够完全掌控其智能体的每一个部分——他们选择的模型、模型所看到的上下文,以及运行智能体的框架。
每个层级扮演着不同的角色,并提供不同程度的控制权。LangGraph 是一个智能体运行时,LangChain 是一个智能体框架,而 Deep Agents 是一个智能体框架套件。运行时提供的控制权最大,抽象程度最低;而套件则恰恰相反。这三个层级都是完全可组合的,因此你可以在各层之间灵活切换,而不必只选择其中一个。
# 各个层级提供什么
Deep Agents 是一个开箱即用的智能体套件:智能体套件的任务是通过上下文工程,在正确的时机将正确的上下文传递给模型。Deep Agents 内置了一系列关于这方面的最佳实践,包括:
- 文件系统:用于读取和写入上下文(当你不想将其直接放在大语言模型的上下文窗口中时)
- 子智能体:用于执行专门的工作,而不会使主上下文窗口变得臃肿
- 技能:你可以提供指令和脚本,供智能体按需加载
- 记忆:让智能体能够在多次运行中进行学习和改进
它默认还附带了其他许多组件。这些都是我们团队不断审查和更新的、具有明确倾向性的上下文管理最佳实践。使用 Deep Agents 的好处之一是,你可以信任我们会不断关注行业动态,并为你带来最新的最佳实践。
使用 `create_deep_agent` 入门非常简单:
```
from deepagents import create_deep_agent
agent = create_deep_agent(
model="anthropic:claude-sonnet-5",
tools=[web_search],
system_prompt="you are a research agent...",
# skills path with citation-format, source-eval
skills=["./skills/"],
)
```
LangChain 是智能体框架:即抽象和集成层。它附带了一个极其精简的智能体套件。如果说 Deep Agents 内置了关于上下文管理的最佳实践,那么 LangChain 的智能体抽象则是极其精简且没有任何预设偏见的。
核心的智能体抽象非常简单:一个大语言模型在一个循环中运行,并调用工具。

这个循环极其简单,却又异常强大。然而,有时你可能想要修改这个循环。通常,进行这些修改是为了添加更多确定性的步骤——比如在上下文接近满时进行总结,或者在最后运行一个验证器。LangChain 智能体最强大的部分之一,就是我们如何让你添加这些修改。LangChain 中间件提供了一系列钩子,可以通过多种方式修改这个循环。

> 🧠 有趣的事实!
> Deep Agents 实际上就是核心的 LangChain 智能体加上一堆中间件!
你可以使用简单的 `create_agent` 抽象来使用 LangChain 智能体:
```
from langchain.agents import create_agent
agent = create_agent(
model="anthropic:claude-sonnet-5",
tools=[send_email],
prompt="you are my email assistant...",
middleware=[...]
)
```
LangGraph 是智能体运行时:一个用于自定义智能体工作流的图框架,由一个持久化引擎提供支持,在每一个步骤都具备人机交互、容错能力和可观测性。将智能体视为图的一个好处是,你可以将更多的确定性编码到其中,并更严密地控制发生的步骤。
LangGraph 为 LangChain 和 Deep Agents 中的智能体抽象(如上所示,均显示为图)提供了底层支持。
# 什么时候选择哪一个
> 🔊 经验法则
> 从 Deep Agents 开始。它是一个非常强大的智能体套件,包含了所有花哨的功能。当你需要对复杂工作流进行建模,或者想要完全控制每一个步骤时,请选择 LangChain 和 LangGraph。
## Deep Agents
当你想要一个开箱即用、功能强大的智能体时,请选择 Deep Agents。这是大多数构建者应该入手的地方,只有当你需要对套件本身进行更多控制时,才需要向下深入底层。
假设你正在构建一个 GTM(走向市场)智能体。它需要针对每位业务代表配备记忆(包含电子邮件风格偏好和关系理解等)、用于 QBR(季度业务回顾)准备等周期性工作流的技能,以及进行深入调研的子智能体(跨越通话记录、新闻和 CRM 历史记录来分析某个账户)。
这可不是一个玩具般的示例:我们自己的 GTM 智能体就是基于 deepagents 构建的!它目前承载着庞大的流量,每周近 1 万次请求,拥有超过 150 名活跃用户。其中 26% 的流量由用户主动发起,其余 74% 由环境智能体任务驱动。我们使用 LangSmith 部署来发布它,这既支持突发流量,也支持计划或事件触发的环境运行。
## LangChain
当你想要核心构建块和/或计划组装你自己的定制套件时,请选择 LangChain。LangChain 的集成和抽象在任何层级都非常有用:在自定义图中,在 `create_agent` 中,以及在 `create_deep_agent` 中。当你想要对每一步中哪些工具和上下文到达模型进行细粒度控制时,它也非常合适——对超低延迟敏感的应用通常需要这种控制。
假设你正在构建一个 RAG 文档问答机器人:给定一个问题,智能体会在你的向量存储库中搜索相关页面。智能体循环控制是否得出了令人满意的答案,并驱动机器人直到查询完成。这类智能体不需要通过子智能体进行委托,也不需要通过文件系统进行上下文管理。LangChain 的集成允许你将任何向量数据库作为工具插入,并选择你想要的任何模型,而 `create_agent` 为你提供了将它们联系在一起的循环。
## LangGraph
当你的智能体不符合标准循环,或者你需要在同一工作流中混合确定性和智能体步骤时,请选择 LangGraph。
假设你正在构建一个租赁申请处理流水线。它包含以下几个步骤:
1. 从每份申请中提取收入、信用和租赁历史记录
2. 根据房东的标准进行评分
3. 自动批准明确的合格者,拒绝明确的不合格者,或者将处于边缘的案例交由人工处理。

只有第 1 步涉及大语言模型,其余的都是固定代码。这个工作流利用了 LLM 从文档中提取信息的能力,但它没有给模型提供任何可以采取行动的工具。这是一个相对确定性的流水线。
已经在使用 LangGraph 了?如果价值存在于图的形状及其确定性步骤中,那就请继续使用。如果你的 LangGraph 流程高度依赖智能体,那么迁移到 Deep Agents 可能会让你受益。
## 三者结合使用
这三者都是可组合的:你可以将 `create_agent` 或 `create_deep_agent` 放入一个更大的 LangGraph 工作流中,或者将自定义的 LangGraph 工作流作为子智能体放入 `create_agent` 或 `create_deep_agent` 中。
无论你使用哪个包进行构建,都可以使用 LangSmith 部署进行部署,并使用 LangSmith 的可观测性进行监控。
# 平衡确定性与自主性
自主性越高,智能体潜在的价值就越大,但代价是牺牲可靠性。对于敏感或预设的工作流,以及完全不需要智能体参与的重复性任务来说,确定性是更好的选择。智能体越动态,它的能力就越强,也越有创造力。想要了解更多关于生产环境中这些权衡的例子,请收听 Max Agency,这是我们关于团队如何设计、部署和迭代真实智能体系统的播客。
这三个层级在这个区间中处于不同的位置。LangGraph 提供最大的确定性:它允许你将领域知识直接编码到图的拓扑结构中,而不是将这种判断留给模型。LangChain 处于中间位置:核心的智能体循环本质上是不确定的,由模型决定每一步接下来会发生什么。Deep Agents 提供最大的自主性:由于内置了总结和子智能体等功能,智能体循环可以运行更长时间,并实现大规模的扇出(任务分发)。

> 🎧 想要与构建顶级智能体的团队进行更深入的对话,请收听我们的播客 Max Agency。
许多智能体运行在核心智能体循环上,但仍然需要内置一些确定性步骤:一个批准步骤、一个合规性检查,或者一条不应该留给模型的业务规则。中间件为 Deep Agents 和 LangChain 解决了这个问题,让你能够在核心循环周围注入这些步骤和人机交互的时刻。
如果你需要比中间件通过这些内置钩子提供的更高的灵活性或控制权,LangGraph 就是你的“逃生通道”,它让你能够构建完全自定义的图,将工作流的特定逻辑直接编码到它的形状中,就像上面提到的扇出并综合的例子一样。
## 为什么要分为三个层级
LangChain 于 2022 年 10 月推出,是让 LLM 应用程序运行起来的最快方式。随着智能体变得越来越复杂,人们需要比链条所能提供的更多的控制权,因此我们在 2024 年 1 月推出了 LangGraph:一个基于图的运行时,将持久化执行、流处理和人机交互作为一等公民原语内置其中。
随着模型能力的提升,核心的智能体循环——即一个模型进行规划、调用工具并对结果做出反应——已经变得足够强大,可以进行标准化。`create_agent` 成为了 LangChain 的精简套件,我们将其建立在 LangGraph 之上,因为生产级智能体需要它的原语(人机交互、可观测性、容错能力等)。
然后在 2025 年 7 月,我们通过 Deep Agents 更进了一步,它建立在相同的核心循环之上,但默认捆绑了上述组件(上下文管理、子智能体等)。受到 Claude Code 和 Manus 的启发,我们断定构建者希望为他们的应用场景配备同样强大的智能体,因此我们将 deepagents 作为一个通用套件来构建。
# 总结 (TL;DR)
如果你正在构建或重构一个智能体,请从 Deep Agents 的 `create_deep_agent` 开始,这就是我们用于所有内部智能体(GTM、编程、文档编写等)的工具。
当你想要较少的内置上下文管理,并对智能体循环进行更细粒度的控制时,请选择 LangChain 的 `create_agent`。
当你在自定义工作流中需要更多的控制权或确定性时,请使用 LangGraph。
## 致谢
感谢 Harrison Chase、Hunter Lovell、Morgan Curtis 和 Sean Roche 的用心审阅!
## 相关链接
- [Sydney Runkle](https://x.com/sydneyrunkle)
- [@sydneyrunkle](https://x.com/sydneyrunkle)
- [55K](https://x.com/sydneyrunkle/status/2085425145209143338/analytics)
- [Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview)
- [LangChain](https://docs.langchain.com/oss/python/langchain/overview)
- [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview)
- [filesystem](https://docs.langchain.com/oss/python/deepagents/backends)
- [Subagents](https://docs.langchain.com/oss/python/deepagents/subagents)
- [Skills](https://docs.langchain.com/oss/python/deepagents/skills)
- [Memory](https://docs.langchain.com/oss/python/deepagents/memory)
- [create_deep_agent](https://docs.langchain.com/oss/python/deepagents/quickstart)
- [middleware](https://www.langchain.com/blog/how-middleware-lets-you-customize-your-agent-harness)
- [bunch of middleware](https://docs.langchain.com/oss/python/deepagents/overview#core-capabilities)
- [create_agent](https://docs.langchain.com/oss/python/langchain/quickstart)
- [human-in-the-loop](https://docs.langchain.com/oss/python/langgraph/interrupts)
- [fault tolerance](https://docs.langchain.com/oss/python/langgraph/fault-tolerance)
- [built our GTM agent](https://www.langchain.com/blog/how-we-built-langchains-gtm-agent)
- [LangSmith deployments](https://docs.langchain.com/langsmith/deployment)
- [LangSmith deployments](https://docs.langchain.com/langsmith/deployment)
- [LangSmith observability](https://docs.langchain.com/langsmith/observability)
- [Max Agency](https://www.youtube.com/playlist?list=PLfaIDFEXuae3UwB1QGEjsRAr8BzCQss7s)
- [Max Agency](https://podcasts.apple.com/us/podcast/max-agency/id1891551672)
- [encoding your workflow's specific logic directly into its shape](https://www.langchain.com/blog/3-years-of-graph-engineering-with-langgraph)
- [create_deep_agent](https://docs.langchain.com/oss/python/deepagents/quickstart)
- [create_agent](https://docs.langchain.com/oss/python/langchain/quickstart)
- [Harrison Chase](https://x.com/hwchase17)
- [Hunter Lovell](https://x.com/huntlovell)
- [Morgan Curtis](https://www.linkedin.com/in/morganc41/)
- [Sean Roche](https://linkedin.com/in/sean-roche01)
- [Upgrade to Premium](https://x.com/i/premium_sign_up)
- [1:57 AM · Aug 7, 2026](https://x.com/sydneyrunkle/status/2085425145209143338)
- [55.3K Views](https://x.com/sydneyrunkle/status/2085425145209143338/analytics)
- [View quotes](https://x.com/sydneyrunkle/status/2085425145209143338/quotes)
---
*导出时间: 2026/8/7 20:48:06*