开源项目 GitHub Topic rag 2026-07-30T12:10 正文 ok 470 words

📦 langchain-ai/langgraph:构建具备韧性的 Agent

英文标题:📦 langchain-ai/langgraph

LangGraph 是 LangChain Inc. 推出的低层编排框架,用于构建、管理和部署长时间运行、有状态的 Agent 与工作流,已获 Klarna、Replit、Elastic 等公司采用。其核心能力包括持久化执行、人工介入、短期与长期记忆、通过 LangSmith 进行调试,以及面向生产环境的部署。对于开发者而言,LangGraph 可独立使用,也可与 Deep Agents、LangChain 和 LangSmith 结合,覆盖 Agent 的构建、评估、可观测性与规模化部署流程。
打开原文相关 4.9 · 机会 5
media4.7 KB media4.7 KB media1.2 KB media1.3 KB media993 B media1.6 KB media131.8 KB

中文

用于构建有状态 Agent 的低层编排框架。

受到推动 Agent 未来发展的公司信赖——包括 Klarna、Replit、Elastic 等。LangGraph 是一个低层编排框架,用于构建、管理和部署长时间运行、有状态的 Agent。

提示

如果你希望快速构建 Agent,请了解 Deep Agents——这是一个构建在 LangGraph 之上的高层软件包,适用于能够规划、使用子 Agent 并利用文件系统完成复杂任务的 Agent。

如需功能等价的 JS/TS 库,请查看 LangGraph.js 及其 JS 文档。

LangGraph 为 任何 长时间运行、有状态的工作流或 Agent 提供低层支撑基础设施:

  • 持久化执行 —— 构建可在故障后保持运行并可持续执行较长时间的 Agent,能够自动从中断的位置精确恢复。
  • 人工介入 —— 通过在执行过程中的任意时刻检查和修改 Agent 状态,无缝纳入人工监督。
  • 全面记忆 —— 创建真正有状态的 Agent,同时具备用于持续推理的短期工作记忆,以及跨会话的长期持久记忆。
  • 使用 LangSmith 调试 —— 借助可视化工具深入了解复杂 Agent 行为;这些工具可追踪执行路径、捕获状态转换,并提供详细的运行时指标。
  • 面向生产环境的部署 —— 借助为应对有状态、长时间运行工作流独特挑战而设计的可扩展基础设施,放心部署复杂的 Agent 系统。

提示

如需开发、调试和部署 AI Agent 及 LLM 应用,请参阅 LangSmith。

LangGraph 可独立使用,也能与任何 LangChain 产品无缝集成,为开发者提供构建 Agent 的完整工具套件。

为提升你的 LLM 应用开发体验,可将 LangGraph 与以下产品结合使用:

  • Deep Agents – 构建能够规划、使用子 Agent 并利用文件系统完成复杂任务的 Agent。
  • LangChain – 提供集成能力和可组合组件,简化 LLM 应用开发。
  • LangSmith – 有助于 Agent 评估和可观测性。可调试表现不佳的 LLM 应用运行、评估 Agent 轨迹、获得生产环境可见性,并持续提升性能。
  • LangSmith Deployment – 借助专为长时间运行、有状态工作流打造的部署平台,轻松部署和扩展 Agent。可在团队间发现、复用、配置和共享 Agent,并通过 LangSmith Studio 中的可视化原型设计快速迭代。

讨论:访问 LangChain Forum,与社区交流并分享你的技术问题、想法和反馈。

  • 指南 – 提供关于流式传输、添加记忆与持久化、设计模式(如分支、子图等)主题的快速实用代码片段。
  • LangChain Academy – 通过我们的免费结构化课程学习 LangGraph 基础知识。
  • 案例研究 – 了解行业领导者如何利用 LangGraph 大规模交付 AI 应用。
  • 贡献指南 – 了解如何为 LangChain 项目贡献代码,并寻找适合入门的议题。
  • 行为准则 – 我们的社区参与指南与行为标准。

LangGraph 的灵感来自 Pregel 和 Apache Beam。其公共接口借鉴了 NetworkX。LangGraph 由 LangChain 的创建者 LangChain Inc. 构建,但无需使用 LangChain 也可运行。

English / 原文

Low-level orchestration framework for building stateful agents.

Trusted by companies shaping the future of agents – including Klarna, Replit, Elastic, and more – LangGraph is a low-level orchestration framework for building, managing, and deploying long-running, stateful agents.

Tip

If you're looking to quickly build agents, check out Deep Agents — a higher-level package built on LangGraph for agents that can plan, use subagents, and leverage file systems for complex tasks.

For an equivalent JS/TS library, check out LangGraph.js and the JS docs.

LangGraph provides low-level supporting infrastructure for any long-running, stateful workflow or agent:

  • Durable execution — Build agents that persist through failures and can run for extended periods, automatically resuming from exactly where they left off.
  • Human-in-the-loop — Seamlessly incorporate human oversight by inspecting and modifying agent state at any point during execution.
  • Comprehensive memory — Create truly stateful agents with both short-term working memory for ongoing reasoning and long-term persistent memory across sessions.
  • Debugging with LangSmith — Gain deep visibility into complex agent behavior with visualization tools that trace execution paths, capture state transitions, and provide detailed runtime metrics.
  • Production-ready deployment — Deploy sophisticated agent systems confidently with scalable infrastructure designed to handle the unique challenges of stateful, long-running workflows.

Tip

For developing, debugging, and deploying AI agents and LLM applications, see LangSmith.

While LangGraph can be used standalone, it also integrates seamlessly with any LangChain product, giving developers a full suite of tools for building agents.

To improve your LLM application development, pair LangGraph with:

  • Deep Agents – Build agents that can plan, use subagents, and leverage file systems for complex tasks.
  • LangChain – Provides integrations and composable components to streamline LLM application development.
  • LangSmith – Helpful for agent evals and observability. Debug poor-performing LLM app runs, evaluate agent trajectories, gain visibility in production, and improve performance over time.
  • LangSmith Deployment – Deploy and scale agents effortlessly with a purpose-built deployment platform for long-running, stateful workflows. Discover, reuse, configure, and share agents across teams – and iterate quickly with visual prototyping in LangSmith Studio.

Discussions : Visit the LangChain Forum to connect with the community and share all of your technical questions, ideas, and feedback.

  • Guides – Quick, actionable code snippets for topics such as streaming, adding memory & persistence, and design patterns (e.g. branching, subgraphs, etc.).
  • LangChain Academy – Learn the basics of LangGraph in our free, structured course.
  • Case studies – Hear how industry leaders use LangGraph to ship AI applications at scale.
  • Contributing Guide – Learn how to contribute to LangChain projects and find good first issues.
  • Code of Conduct – Our community guidelines and standards for participation.

LangGraph is inspired by Pregel and Apache Beam. The public interface draws inspiration from NetworkX. LangGraph is built by LangChain Inc, the creators of LangChain, but can be used without LangChain.