langgraphjs

Framework to build resilient language agents as graphs.

open-sourceagent-frameworks
2.7k
Stars
+75
Stars/month
10
Releases (6m)

Star Growth

+16 (0.6%)
2.7k2.7k2.8kMar 27Apr 1

Overview

LangGraph.js 是一个低级编排框架,专门用于构建可控且有弹性的语言智能体。它被 Replit、Uber、LinkedIn、GitLab 等知名公司采用,旨在解决复杂智能体任务的可靠性和可控性问题。与传统的线性智能体不同,LangGraph.js 将智能体行为建模为图结构,支持自定义架构、长期记忆和人机协作流程。该框架与 LangChain 生态系统深度集成,提供了组件化的构建块来简化 LLM 应用开发。LangGraph.js 的核心优势在于其图形化的控制流,允许开发者精确定义智能体的决策路径和状态转换,而不是依赖黑盒式的自主行为。框架提供了内置的持久化机制,确保长时间运行的工作流能够在部署、崩溃或中断后恢复执行。通过 create-agent-chat-app CLI 工具,开发者可以快速搭建全栈智能体应用,并从四种预构建的智能体模式(ReAct、Memory、Research、Retrieval)中选择合适的起点,支持 Next.js 和 Vite 等主流前端框架。

Deep Analysis

Key Differentiator

The JavaScript/TypeScript graph-based agent framework from LangChain with built-in persistence, streaming, and human-in-the-loop — vs simpler agent libs lacking state management and controllability

Capabilities

  • Stateful agent orchestration with graph-based workflows
  • Built-in persistence and long-term memory
  • Human-in-the-loop approval flows
  • First-class streaming (token-level and intermediate steps)
  • Pre-built ReAct agent template
  • Multi-agent system support with subgraphs
  • Full-stack quickstart CLI (create-agent-chat-app)

🔗 Integrations

LangChainLangSmithLangGraph PlatformAnthropicOpenAIAny LangChain-compatible LLM

Best For

  • Building complex, stateful JS/TS agents with controllable workflows
  • Production agents needing persistence, streaming, and human-in-the-loop
  • Teams already in the LangChain ecosystem

Not Ideal For

  • Simple one-shot LLM calls without state
  • Python-first teams (use langgraph Python instead)

Languages

TypeScriptJavaScript

Deployment

npm packageLangGraph Platform (cloud)Self-hosted Node.js

Pricing Detail

Free: Open source MIT, full framework free
Paid: LangGraph Platform for managed deployment (pricing varies)

Known Limitations

  • Steeper learning curve than simple agent frameworks
  • TypeScript/JavaScript only (Python version is separate repo)
  • LangGraph Platform deployment is paid
  • Tight coupling with LangChain ecosystem

Pros

  • + 提供可视化的图形控制流,让智能体行为更加透明和可调试,相比黑盒式的自主智能体更易于理解和维护
  • + 内置人机协作机制和长期记忆支持,适合处理需要人工介入或持续状态的复杂业务流程
  • + CLI 工具和预构建智能体模板显著降低了入门门槛,支持从概念验证到生产部署的快速迭代

Cons

  • - 作为低级框架需要更多的架构设计工作,学习曲线相对陡峭,不如高级抽象框架那样开箱即用
  • - 主要依赖 LangChain 生态系统,在非 LangChain 技术栈中的集成可能需要额外的适配工作

Use Cases

  • 构建需要人工审核和批准的自动化工作流,如内容审核、财务审批或合规检查流程
  • 开发具有长期记忆的客服或助理智能体,能够跨会话保持上下文和用户偏好
  • 创建复杂的数据处理管道,需要在多个 AI 模型和外部 API 之间协调执行任务

Getting Started

1. 安装核心依赖:npm install @langchain/langgraph @langchain/core 和 AI 提供商包(如 @langchain/anthropic); 2. 使用 CLI 创建项目:npx create-agent-chat-app@latest,选择智能体类型和前端框架; 3. 配置 AI 模型和工具,运行示例 ReAct 智能体开始构建自定义图形化智能体流程

Compare langgraphjs