# LangGraph

**LangGraph** 是由 [LangChain](https://www.edgepedia.org/zh/langchain) 开发的开源、底层智能体编排框架，用于构建基于大语言模型（LLM）的有状态、多角色应用。它把智能体工作流表示为节点与边构成的图，且与大多数工作流引擎不同，它支持环——当 LLM 在循环中决定下一步做什么时，正需要这种环。它用 Python 和 [JavaScript](https://www.edgepedia.org/zh/javascript) 编写，可与 LangChain 生态互操作，并已在 LinkedIn、Uber、Klarna 和 Elastic 等公司的生产环境中使用。<sup>[1](https://www.langchain.com/blog/langgraph)</sup><sup> • </sup><sup>[2](https://www.langchain.com/blog/building-langgraph)</sup>

| 关键事实 | 详情 |
|---|---|
| 首次发布 | 2024 年 1 月 17 日宣布，作为构建在 LangChain 之上的模块，用于创建智能体运行时所需的有环图<sup>[1](https://www.langchain.com/blog/langgraph)</sup> |
| 稳定版 0.1 | LangGraph v0.1 与 LangGraph Cloud 于 2024 年 6 月 27 日发布<sup>[3](https://www.langchain.com/blog/langgraph-cloud)</sup> |
| 1.0 版本 | 2025 年 9 月 2 日发布 Alpha 版；稳定版计划于 2025 年 10 月下旬发布，与 v0.6.6 相比除弃用 `create_react_agent`（改用 `langchain.agents.create_agent`）外无破坏性变更<sup>[4](https://github.com/langchain-ai/langgraph/issues/6062)</sup> |
| 核心运行时特性 | 持久化执行、通过检查点器实现的短期记忆、通过存储实现的长期记忆、人在回路中断，以及中间步骤与 token 的流式输出<sup>[5](https://www.langchain.com/blog/langchain-langchain-1-0-alpha-releases)</sup><sup> • </sup><sup>[6](https://langchain-ai.github.io/langgraph/concepts/durable_execution/)</sup> |
| 许可证与平台 | MIT 许可证；Python 包要求 Python 3.10 或更高版本<sup>[7](https://github.com/langchain-ai/langgraph/blob/main/libs/langgraph/pyproject.toml)</sup> |
| 生产应用 | Klarna 的 AI 助手为 8500 万活跃用户处理客服支持，将解决时间缩短了 80%；LinkedIn 的 Hiring Assistant 与 Uber 的代码迁移智能体均构建于其上<sup>[8](https://www.langchain.com/built-with-langgraph)</sup><sup> • </sup><sup>[9](https://www.linkedin.com/blog/engineering/hiring/hiring-assistant-shaped-by-customers-powered-by-ai-innovation)</sup> |
| 支持政策 | LangGraph 1.0 是长期支持（LTS）版本，支持至 2.0；LangGraph 0.4 处于维护模式，安全补丁支持至 2026 年 12 月<sup>[10](https://github.com/langchain-ai/docs/blob/main/src/oss/release-policy.mdx)</sup> |

## 目的与动机

LangGraph 源于对最初 `langchain` 库的反馈。据 LangChain 首席执行官 Harrison Chase 所说，该库上手容易，但难以定制和扩展，因为其高层接口以牺牲能力换取了易用性。LangGraph 的开发始于 2023 年夏，于 2024 年初发布，围绕两大支柱：可控性——没有隐藏的提示词或隐藏的上下文工程；以及生产级运行时——融合流式输出、状态化、人在回路控制和持久化执行。<sup>[11](https://www.langchain.com/blog/three-years-langchain)</sup>

该框架的根本洞见在于：智能体的计算图是有环的。LangChain 表达式语言中的链与大多数数据编排框架一样，是有向无环图（DAG），但智能体应用需要循环：LLM 在循环中推理下一步做什么，并把结果送回循环。一个典型例子是检索增强生成：如果第一次检索返回的文档质量不佳，LLM 可以发出一个改进后的第二次查询，而不是直接失败。<sup>[1](https://www.langchain.com/blog/langgraph)</sup>

LangChain 团队也排除了已有的基础设施类别。[Apache Airflow](https://www.edgepedia.org/zh/apache-airflow) 等 DAG 框架无法处理有环图；而 Temporal 等持久化执行引擎设计于 LLM 智能体出现之前，缺乏流式输出，在步骤之间引入明显延迟，且性能会随步骤历史增长而下降。<sup>[2](https://www.langchain.com/blog/building-langgraph)</sup>

## 架构与运行时

LangGraph 的公开 API 刻意贴近编写普通代码的方式。开发者构建一个 `StateGraph`，添加节点（函数或智能体）与边，然后编译它；名为 PregelLoop 的运行时为每次调用规划计算图，并以内置的运行时特性执行它。团队声明的设计原则是：尽可能少地对 AI 的未来做假设，并让框架用起来像在写无框架的代码。<sup>[2](https://www.langchain.com/blog/building-langgraph)</sup>

**持久化与记忆。** 持久化层通过检查点器为智能体提供短期记忆，通过存储提供长期记忆，使应用能够在单次图运行之外保留信息。<sup>[6](https://langchain-ai.github.io/langgraph/concepts/durable_execution/)</sup> 长期记忆支持于 2024 年 10 月面向 Python 和 JavaScript 发布。<sup>[12](https://www.langchain.com/blog/launching-long-term-memory-support-in-langgraph)</sup>

**人在回路控制。** 当节点内部触发 `interrupt` 时，LangGraph 保存图状态并无限期等待，直到以输入恢复执行。这支持如下设计：智能体在执行任务前明确等待人工批准；人工编辑智能体提议的操作；开发者检查、重连、编辑并恢复执行——团队将这一特性称为“时间旅行”。<sup>[13](https://langchain-ai.github.io/langgraph/concepts/breakpoints/?h=break)</sup><sup> • </sup><sup>[3](https://www.langchain.com/blog/langgraph-cloud)</sup>

**流式输出。** LangGraph 原生支持中间步骤流式输出和逐 token 流式输出，旨在为长时间运行的智能体任务提供响应灵敏的体验。<sup>[3](https://www.langchain.com/blog/langgraph-cloud)</sup>

## 工具与部署

**LangGraph Studio** 于 2024 年 8 月 1 日以公开测试版发布，被 LangChain 描述为首个专为智能体开发设计的 IDE，提供智能体应用的可视化、交互与调试，包括断点、状态编辑和恢复。<sup>[14](https://www.langchain.com/blog/langgraph-studio-the-first-agent-ide)</sup><sup> • </sup><sup>[3](https://www.langchain.com/blog/langgraph-cloud)</sup>

**LangGraph Cloud** 于 2024 年 6 月随 v0.1 一同以测试版推出，为大规模部署智能体提供基础设施：横向扩展的任务队列、服务器，以及供并发用户使用的 Postgres 检查点器。它增加了双重输入（通过拒绝、排队、中断或回滚策略处理运行中线程上的新用户输入）、带轮询或 webhook 完成通知的异步后台任务，以及定时任务。截至 2025 年 10 月，该平台已更名为“LangSmith Deployment”。<sup>[3](https://www.langchain.com/blog/langgraph-cloud)</sup>

**预置库。** LangGraph 0.3 版本引入了 LangGraph Prebuilt——面向工具调用智能体的高层 API，同时还有面向监督者多智能体架构的 LangGraph Supervisor、面向群体架构的 LangGraph Swarm、用于长期记忆的 LangMem，以及用于结构化抽取的 Trustcall。<sup>[15](https://www.linkedin.com/posts/langchain_langgraph-03-release-prebuilt-agents-activity-7300933224686379009-l-Iv)</sup>

## 1.0 版本与发布政策

Python 和 JavaScript 版 `langgraph` 1.0 的 Alpha 版于 2025 年 9 月 2 日发布，稳定版计划于 2025 年 10 月下旬发布。与 v0.6.6 相比，1.0 版本除弃用 `create_react_agent`（移至 `langchain.agents` 并更名为 `create_agent`）外，未引入破坏性变更。<sup>[4](https://github.com/langchain-ai/langgraph/issues/6062)</sup><sup> • </sup><sup>[5](https://www.langchain.com/blog/langchain-langchain-1-0-alpha-releases)</sup>

根据发布政策，LangGraph 1.0 是 LTS 版本：活跃支持至 2.0 出现，此后至少再维护一年，次要升级不含破坏性变更。主要版本之间至少间隔 6 至 12 个月，次要版本每 1 至 2 个月发布一次，补丁版本按需发布，通常每周一次。LangGraph 0.4 获得安全补丁和关键缺陷修复直至 2026 年 12 月。<sup>[10](https://github.com/langchain-ai/docs/blob/main/src/oss/release-policy.mdx)</sup>

## 应用

LangChain 的案例研究列表记录了跨行业的生产使用：LinkedIn（代码生成、搜索与发现）、Uber（开发者生产力、代码生成）、Klarna（客户支持）、J.P. Morgan 与 [BlackRock](https://www.edgepedia.org/zh/blackrock)（金融服务副驾驶）、GitLab（Duo Workflow 中的代码生成）、Cisco（客户支持与 DevOps）、Vodafone、Rakuten 和 Replit 等。<sup>[16](https://github.com/langchain-ai/docs/blob/main/src/oss/langgraph/case-studies.mdx)</sup> Klarna 报告称，其由 LangGraph 驱动的 AI 助手为 8500 万活跃用户处理支持任务，客户问题的解决时间缩短了 80%。<sup>[8](https://www.langchain.com/built-with-langgraph)</sup> LinkedIn 的 Hiring Assistant 是一个计划—执行型招聘智能体，构建于 LangGraph 之上以实现多步骤编排。<sup>[9](https://www.linkedin.com/blog/engineering/hiring/hiring-assistant-shaped-by-customers-powered-by-ai-innovation)</sup> Elastic 使用 LangGraph 编排威胁检测场景中的智能体，并驱动其 ES|QL 查询生成工作流。<sup>[8](https://www.langchain.com/built-with-langgraph)</sup><sup> • </sup><sup>[17](https://www.elastic.co/blog/building-automatic-import-attack-discovery-langchain)</sup>

## 与其他框架的比较

LangGraph 常被拿来与 CrewAI 和 AutoGen 对比。一项 2026 年的系统性基准研究从六个维度评估后发现：LangGraph 在有状态流水线控制和故障韧性方面表现突出，CrewAI 在开发者工效学方面更优，AutoGen 在代码生成准确率上具竞争力。<sup>[18](https://jatir.org/article.php?paperid=140332)</sup> 一项使用 Open Agent Specification 的跨框架评估在 AutoGen、CrewAI、LangGraph 和 WayFlow 运行时上执行同一份智能体规范，报告 LangGraph 在某一 SimpleQA Verified 基准上得分为 75.5。<sup>[19](https://doi.org/10.1145/3786335.3813130)</sup> MASEval 项目以整个系统而非模型作为分析单元，发现对于智能体性能而言，框架选择与模型选择同样重要。<sup>[20](https://arxiv.org/abs/2603.08835)</sup> 实践者的评估指出了一个权衡：塔林理工大学的一篇论文评估了这三个框架，发现 LangGraph 的学习曲线在三者中最陡，尽管它提供了多种流式模式用于监控和调试。<sup>[21](https://digikogu.taltech.ee/en/Download/3d946d3c-767d-4fee-865c-0c8ba2ae3035)</sup>

## 安全

2026 年 3 月，Cyera 的安全研究人员披露了 LangChain 和 LangGraph 项目中的漏洞，这两个项目在 PyPI 上每周合计下载量超过 6000 万次。其中一个漏洞直接影响 LangGraph：CVE-2025-67644，这是 LangGraph SQLite 检查点实现中的一个高危（7.3/10）SQL 注入漏洞，可导致 SQL 查询操纵并访问对话历史。该漏洞已在 `langgraph-checkpoint-sqlite` 3.0.1 版本中修复。研究人员建议在将元数据过滤键传入检查点查询之前对其进行校验，并将 LLM 输出视为不可信输入。<sup>[22](https://www.techradar.com/pro/security/each-vulnerability-exposes-a-different-class-of-enterprise-data-langchain-framework-hit-by-several-worrying-security-issues-heres-what-we-know)</sup>

## References

1. [LangGraph, The LangChain Team, January 17, 2024](https://www.langchain.com/blog/langgraph)
2. [Building LangGraph: Designing an Agent Runtime from first principles, Nuno Campos, September 4, 2025](https://www.langchain.com/blog/building-langgraph)
3. [Announcing LangGraph v0.1 & LangGraph Cloud, June 27, 2024](https://www.langchain.com/blog/langgraph-cloud)
4. [LangGraph V1 Alpha, langchain-ai/langgraph issue #6062, September 2, 2025](https://github.com/langchain-ai/langgraph/issues/6062)
5. [LangChain & LangGraph 1.0 alpha releases, September 2, 2025](https://www.langchain.com/blog/langchain-langchain-1-0-alpha-releases)
6. [Persistence, LangGraph docs](https://langchain-ai.github.io/langgraph/concepts/durable_execution/)
7. [langgraph pyproject.toml, langchain-ai/langgraph](https://github.com/langchain-ai/langgraph/blob/main/libs/langgraph/pyproject.toml)
8. [Built with LangGraph, LangChain](https://www.langchain.com/built-with-langgraph)
9. [Hiring Assistant: shaped by customers, powered by AI innovation, LinkedIn Engineering](https://www.linkedin.com/blog/engineering/hiring/hiring-assistant-shaped-by-customers-powered-by-ai-innovation)
10. [Release policy, langchain-ai/docs](https://github.com/langchain-ai/docs/blob/main/src/oss/release-policy.mdx)
11. [Reflections on Three Years of Building LangChain, Harrison Chase](https://www.langchain.com/blog/three-years-langchain)
12. [Launching Long-Term Memory Support in LangGraph, October 8, 2024](https://www.langchain.com/blog/launching-long-term-memory-support-in-langgraph)
13. [Interrupts, LangGraph docs](https://langchain-ai.github.io/langgraph/concepts/breakpoints/?h=break)
14. [LangGraph Studio: The first agent IDE, August 1, 2024](https://www.langchain.com/blog/langgraph-studio-the-first-agent-ide)
15. [LangGraph v0.3: Prebuilt Agents, LangChain on LinkedIn](https://www.linkedin.com/posts/langchain_langgraph-03-release-prebuilt-agents-activity-7300933224686379009-l-Iv)
16. [LangGraph case studies, langchain-ai/docs](https://github.com/langchain-ai/docs/blob/main/src/oss/langgraph/case-studies.mdx)
17. [How we built Automatic Import, Attack Discovery, and Elastic AI Assistant using LangChain, Elastic](https://www.elastic.co/blog/building-automatic-import-attack-discovery-langchain)
18. [Benchmarking Multi-Agent Frameworks: LangGraph vs. CrewAI vs. AutoGen, JATIR 2(6), 2026](https://jatir.org/article.php?paperid=140332)
19. [Open Agent Specification: Enabling Cross-Framework Comparison of AI Agents, ACM Conference on AI and Agentic Systems](https://doi.org/10.1145/3786335.3813130)
20. [MASEval: Extending Multi-Agent Evaluation from Models to Systems, arXiv:2603.08835](https://arxiv.org/abs/2603.08835)
21. [Comparative analysis of LLM-based multi-agent frameworks, Tallinn University of Technology thesis](https://digikogu.taltech.ee/en/Download/3d946d3c-767d-4fee-865c-0c8ba2ae3035)
22. [LangChain framework hit by several worrying security issues, TechRadar, March 2026](https://www.techradar.com/pro/security/each-vulnerability-exposes-a-different-class-of-enterprise-data-langchain-framework-hit-by-several-worrying-security-issues-heres-what-we-know)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › AI companies, people, and products › AI products and assistants › AI agents and developer tools

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/langgraph

English original: https://www.edgepedia.org/langgraph
