
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 和 LangGraph 分别提供了构建智能体(Agent)的不同方法。在本文中,我们将介绍我们这些开源框架之间的主要区别,以及你应该在何时选择哪一个。
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.Deep Agents、LangChain 和 LangGraph 是我们开源智能体技术栈的三个层级,它们基于相同的理念:开发者应该能够掌控智能体的每一个部分,包括所选的模型、模型可见的上下文,以及运行智能体的工具框架(Harness)。
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.每一层都扮演着不同的角色,并提供不同程度的控制权。LangGraph 是智能体运行时(Runtime),LangChain 是智能体框架(Framework),而 Deep Agents 是智能体工具框架(Harness)。运行时提供最高的控制权和最低的抽象度;工具框架则相反。这三者完全可组合,因此你可以在不同层级间切换,而无需只选其一。
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:Deep Agents 是一个开箱即用的智能体工具框架:其核心任务是通过上下文工程(Context Engineering)在正确的时间为模型提供正确的上下文。Deep Agents 内置了大量相关最佳实践,包括:
- 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子智能体(Subagents):用于执行专业任务,而不会占用主上下文窗口
- Skills, so you can provide instructions and scripts that an agent can load on demand技能(Skills):让你能够提供智能体可按需加载的指令和脚本
- Memory, so the agent can learn and improve across runs记忆(Memory):让智能体能够在多次运行中学习并改进
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.它默认还附带了许多其他组件。这些都是我们团队不断审查和更新的、经过深思熟虑的上下文管理最佳实践。使用 Deep Agents 的好处之一在于,你可以信任我们一直在调研行业动态,并将最佳实践融入其中。
Getting started is simple with create_deep_agent:使用 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.LangChain 是智能体框架:即抽象和集成层。它附带了一个极其精简的智能体工具框架。与 Deep Agents 提供的上下文管理最佳实践不同,LangChain 的智能体抽象非常精简且不带偏见(un-opinionated)。
The core agent abstraction is pretty simple: an LLM, running in a loop, calling tools.核心智能体抽象非常简单:一个在循环中运行并调用工具的大语言模型(LLM)。
.png)
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.这个循环非常简单,但功能极其强大。不过,有时你可能需要修改该循环。通常这种修改是为了增加更具确定性的步骤——例如在上下文即将满时进行总结,或在最后运行验证器。LangChain 智能体最强大的地方之一在于我们允许你添加这些修改。LangChain 中间件提供了一组钩子(hooks),可以以多种方式修改此循环。

Fun fact: Deep Agents is actually just the core LangChain agent plus a bunch of middleware!趣事:Deep Agents 其实就是核心 LangChain 智能体加上一堆中间件!
You can use LangChain agents with the simple create_agent abstraction:你可以使用简单的 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 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 是智能体运行时:一个用于自定义智能体工作流的图(Graph)框架,由具有人机协作(human-in-the-loop)、容错性和每步可观测性的持久化引擎支持。将智能体视为图的好处之一是,你可以将更多的确定性编码其中,并更紧密地控制所发生的步骤。
LangGraph powers the agent abstractions (seen above, displayed as graphs) in both LangChain and Deep Agents.LangGraph 为 LangChain 和 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 开始。它是一个功能非常强大的智能体工具框架,包含了所有必备功能。当你需要建模复杂工作流或希望完全控制每一步时,再选择 LangChain 和 LangGraph。
Deep AgentsDeep 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.当你想要一个开箱即用的高性能智能体时,请选择 Deep Agents。这是大多数开发者应该开始的地方,只有在需要对工具框架本身进行更多控制时,才考虑下沉到更底层。
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.假设你正在构建一个 GTM(市场进入)智能体。它需要针对每位销售代表的记忆(如电子邮件风格偏好和关系理解)、用于处理重复性工作流(如 QBR 准备)的技能,以及用于跨通话记录、新闻和 CRM 历史记录对账户进行深入研究的子智能体。
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.这不仅仅是一个玩具示例:我们已经在 deepagents 上构建了自己的 GTM 智能体!它目前处理着繁重的流量,每周近 1 万次请求,拥有超过 150 名活跃用户。其中 26% 的流量由用户发起,其余 74% 由环境智能体任务驱动。我们使用 LangSmith 部署来运行它,这既支持突发流量,也支持计划/事件触发的环境任务。
LangChainLangChain
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.当你需要核心构建块和/或计划在上面组装自己的定制工具框架时,请选择 LangChain。LangChain 的集成和抽象在任何级别都很有用:在自定义图中、使用 create_agent 时,以及使用 create_deep_agent 时。当你想要精细控制每一步中哪些工具和上下文到达模型时(对延迟极其敏感的应用通常需要这样),它也是一个很好的选择。
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.假设你正在构建一个 RAG 文档问答机器人:给定一个问题,智能体会在你的向量数据库中搜索相关页面。智能体循环负责判断是否已获得满意的答案,并驱动机器人直到查询完成。这类智能体不需要通过子智能体进行委派,也不需要通过文件系统进行上下文管理。LangChain 的集成允许你将任何向量数据库作为工具插入,并选择你想要的任何模型,而 create_agent 则为你提供了将它们连接在一起的循环。
LangGraphLangGraph
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.当你的智能体不适合标准循环,或者你需要在同一个工作流中混合确定性步骤和智能体步骤时,请选择 LangGraph。
Say you're building a rental application processing pipeline. It has a few steps:假设你正在构建一个租房申请处理流水线。它有几个步骤:
- Extract income, credit, and rental history from each application从每份申请中提取收入、信用和租房历史
- Score it against the landlord's criteria根据房东的标准进行评分
- 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.只有第 1 步涉及大语言模型,其余都是固定代码。此工作流利用大语言模型从文档中提取信息,但它没有给模型任何可以采取行动的工具。这是一个相对确定的流水线。
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.已经在用 LangGraph 了?如果价值在于图的形状及其确定性步骤,请继续使用。如果你的 LangGraph 流程具有高度的智能体特性,那么迁移到 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.这三者都是可组合的:你可以将 create_agent 或 create_deep_agent 放入更大的 LangGraph 工作流中,或者将自定义的 LangGraph 工作流作为子智能体放入 create_agent 或 create_deep_agent 中。
No matter which package you build with, you can deploy with LangSmith deployments and observe with LangSmith observability.无论你使用哪个包进行构建,都可以使用 LangSmith 部署进行部署,并使用 LangSmith 可观测性进行监控。
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.更多的自主性赋予智能体更多的潜在价值,但代价是可靠性。对于敏感或预设的工作流,以及不需要智能化的重复性任务,确定性是更好的选择。智能体越动态,它就越能展现出能力和创造力。想要了解更多关于生产环境中这些权衡的示例,请收听我们的播客《Max Agency》,该播客探讨了团队如何设计、部署和迭代真实的智能体系统。
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.这三个层级处于该光谱的不同位置。LangGraph 提供最大的确定性:它允许你将领域知识直接编码到图的拓扑结构中,而不是将判断留给模型。LangChain 位于中间:核心智能体循环本质上是非确定性的,模型在每一步决定下一步发生什么。Deep Agents 提供最大的智能性:一个可以运行更长时间并大规模扩展的智能体循环,这得益于总结和子智能体等内置功能。

For deeper conversations with teams building the best agents, listen to our podcast, Max Agency.如需与构建顶级智能体的团队进行更深入的对话,请收听我们的播客《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.许多智能体运行在核心智能体循环上,但仍需要内置一些确定性步骤:审批步骤、合规性检查、不应留给模型判断的业务规则。中间件为 Deep Agents 和 LangChain 解决了这个问题,让你可以在核心循环周围注入这些步骤和人机协作时刻。
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.如果你需要比中间件通过这些内置钩子所能提供的更大的灵活性或控制力,LangGraph 就是那个让你构建完全自定义图的“逃生舱”,它将工作流的具体逻辑直接编码到其形状中,例如上述的“分发与综合”(fan-out-and-synthesize)示例。
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.LangChain 于 2022 年 10 月发布,作为运行大语言模型应用的最快方式。随着智能体变得越来越复杂,人们需要的控制力超出了链(chain)所能提供的范围,因此我们在 2024 年 1 月引入了 LangGraph:一个内置持久化执行、流式传输和人机协作作为一等公民的图驱动运行时。
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).随着模型能力的提升,核心智能体循环(即规划、调用工具并对结果做出反应的模型)变得足够强大,足以实现标准化。create_agent 成为了 LangChain 的最小化工具框架,我们将其构建在 LangGraph 之上,因为生产级智能体需要其原语(人机协作、可观测性、容错性等)。
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.然后在 2025 年 7 月,我们通过 Deep Agents 又向前迈进了一层,它建立在相同的核心循环之上,但默认捆绑了上述组件(上下文管理、子智能体等)。受 Claude Code 和 Manus 的启发,我们确信开发者希望为自己的用例构建同样强大的智能体,因此我们将 deepagents 构建为一个通用工具框架。
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.如果你正在构建或重构智能体,请从 Deep Agents 的 create_deep_agent 开始,这是我们所有内部智能体所使用的工具:包括 GTM、编码、文档编写等。
Pick up LangChain's create_agent instead when you want less built-in context management and more fine-grained control over your agent loop.当你需要较少的内置上下文管理,并希望对智能体循环进行更精细的控制时,请选择 LangChain 的 create_agent。
Reach for LangGraph when you need even more control or determinism in a custom workflow.当你需要在自定义工作流中获得更多控制力或确定性时,请选择 LangGraph。
Acknowledgements致谢
Thanks to Harrison Chase, Hunter Lovell, Morgan Curtis, and Sean Roche for their thoughtful reviews!感谢 Harrison Chase、Hunter Lovell、Morgan Curtis 和 Sean Roche 的深思熟虑的审阅!





