LangGraph

A low-level JavaScript/TypeScript framework for building stateful, controllable LLM agents as graphs, with durable execution and human-in-the-loop.

Framework
npm
v1.4.14
3,252stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
90/100Excellent
Development Activity100
Maintenance100
Community72
Maturity48
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture90
Code Quality92
Innovation85
Learning Curve55

LangGraph is the JavaScript/TypeScript counterpart to LangChain’s Python LangGraph library — a low-level orchestration framework for building controllable, stateful agents. Rather than hiding control flow behind a fixed agent loop, LangGraph models an application as a graph of nodes and edges built on a Pregel-style bulk-synchronous-parallel execution engine, giving developers explicit control over branching, retries, cycles, and state propagation between steps.

The library is used in production by teams at Replit, Uber, LinkedIn, and GitLab for workflows that need to survive failures, pause for human review, and resume exactly where they left off. Its StateGraph API defines shared state as a set of channels (reducers that describe how each key merges new writes), while a separate functional API (entrypoint/task) offers a code-first alternative for teams that prefer writing plain async functions over declaring graphs explicitly.

LangGraph ships first-class support for durable execution via pluggable checkpointers (in-memory, Postgres, MongoDB, SQLite, Redis — each a separate package in the same monorepo), interrupt/resume primitives for human-in-the-loop review, and prebuilt agent constructors (createReactAgent, ToolNode) for teams that want a ready-made ReAct-style loop without hand-rolling the graph. It integrates with LangSmith for tracing and with LangGraph Platform for deployment, but works standalone without either.

The monorepo also contains framework-specific SDKs (React, Vue, Svelte, Angular) for building chat UIs backed by a LangGraph deployment, a CLI/dev-server package, and a higher-level langgraph-supervisor/langgraph-swarm set of multi-agent patterns — but the core @langchain/langgraph package covers the graph execution engine itself.

What You Get

  • A StateGraph builder API where shared state is defined as typed channels with explicit reducer semantics for how concurrent writes merge
  • A functional API (entrypoint, task) for defining durable, resumable workflows as plain async functions instead of explicit graphs
  • Pluggable checkpointer packages (memory, Postgres, MongoDB, SQLite, Redis) for durable execution that can pause and resume across process restarts
  • Interrupt/resume primitives (interrupt(), Command) for human-in-the-loop review of agent state mid-execution
  • Prebuilt agent constructors — createReactAgent and ToolNode — for a ready-made tool-calling agent loop without hand-building the graph
  • Streaming support for tokens, intermediate steps, and custom events via the stream/streamEvents APIs
  • A remote-graph client for invoking graphs hosted on a LangGraph Platform deployment from the same programming model used locally

Common Use Cases

  • Building multi-step LLM agents that need explicit branching, cycles, and retry logic rather than an opaque agent loop
  • Long-running or asynchronous agent workflows that must durably persist state and resume after a crash or restart
  • Human-in-the-loop review flows where an agent pauses for approval or edits before continuing (e.g. before executing a tool call)
  • Multi-agent systems where a supervisor or swarm pattern routes work between specialized sub-agents
  • Chat applications backed by a LangGraph deployment, using the companion React/Vue/Svelte/Angular SDKs for streaming UI updates

Under The Hood

Architecture LangGraph’s execution model is a Pregel-style bulk-synchronous-parallel (BSP) engine: a PregelLoop (src/pregel/loop.ts) advances the graph in discrete “super-steps,” each of which runs all currently-triggered node tasks (computed in src/pregel/algo.ts, which resolves the next set of runnable tasks from channel versions and trigger conditions) via a PregelRunner (src/pregel/runner.ts) that manages retries, timeouts, and abort signals, then commits writes to channels (src/channels/*, e.g. LastValue, BinaryOperatorAggregate, Topic) before the next step begins. State itself is modeled as a set of named channels with explicit reduction semantics rather than a single mutable object, which is what lets concurrent branches merge deterministically. The StateGraph builder (src/graph/state.ts, ~2,200 lines) and the functional entrypoint/task API (src/func/) are two front-ends over the same underlying Pregel runtime, and prebuilt/react_agent_executor.ts composes them into a ready-made tool-calling agent. Interrupts are implemented as a control-flow exception (GraphInterrupt in src/errors.ts) that unwinds a super-step and is resumable via checkpoint replay, which is what backs the human-in-the-loop primitives.

Tech Stack Written entirely in TypeScript (98% of the repo by bytes) as a pnpm/Turborepo monorepo with per-package builds compiled via an internal @langchain/build tool to dual ESM/CJS output with generated .d.ts/.d.cts types. The core @langchain/langgraph package depends on sibling workspace packages @langchain/langgraph-checkpoint (checkpointer interface) and @langchain/langgraph-sdk, plus @langchain/protocol and @standard-schema/spec, with @langchain/core and zod as peer dependencies. Separate checkpointer packages (-postgres, -mongodb, -sqlite, -redis) implement the same interface against each backing store, and separate SDK packages wrap the React/Vue/Svelte/Angular ecosystems for streaming chat UIs. The repo uses oxlint/oxfmt for linting and formatting and Vitest for testing.

Code Quality The core package alone has 72 test files under src/, split by Vitest project into unit, browser (via Playwright, excluding node-only suites like tracing and cancellation), integration (*.int.test.ts, gated behind a Docker Compose file for external service dependencies), and benchmark (*.bench.test.ts) modes, plus TypeScript-level type tests (*.test-d.ts) run through Vitest’s typecheck integration. CI (.github/workflows/ci.yml) runs lint, format, build, and test as separate parallel jobs on every push/PR, with a dedicated workflow for verifying package exports and a browser-test workflow. Errors use a typed hierarchy (GraphInterrupt, GraphBubbleUp, GraphDrained in src/errors.ts) rather than bare exceptions, and public APIs are fully typed with exported .d.tss per entry point (main, /web, /channels, /pregel, /prebuilt, /remote, /stream, /zod).

What Makes It Unique While most JS agent libraries wrap a single request/response loop around an LLM, LangGraph exposes the underlying execution model — a Pregel/BSP-style stepped graph with explicit channel-based state merging — as the primary abstraction, which is what enables its durable-execution and human-in-the-loop guarantees: any node can be paused and the entire computation resumed from a checkpoint, because state transitions are explicit and versioned rather than implicit function-call state. The dual API surface (declarative StateGraph vs. code-first entrypoint/task functional API) over one shared runtime is also a distinguishing design choice, letting teams pick the authoring style without giving up checkpointing or interrupts.

Used by 12 apps in this directory

TypeScript
53%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,252

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
68
Dependency
Built with
TypeScript53%
Rust35%
Updated today
JavaScript
100%
Other

Automatisch

Automation · No Code Platforms

13,964

Self-hosted, no-code workflow automation that keeps your data on your own servers—a privacy-first alternative to Zapier with 90+ integrations.

View details
49
Repo Health
78
Technical
63
Dependency
Built with
JavaScript100%
Updated 6 months ago
TypeScript
99%
Apache 2.0

Bubble Lab

Automation · AI Development

1,094

Open-core workflow engine for building AI-powered automations in TypeScript that run natively inside Slack — no context switching required.

View details
36
Repo Health
78
Technical
71
Dependency
Built with
TypeScript99%
Updated 4 months ago
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,427

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
86
Repo Health
77
Technical
63
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 3 weeks ago
TypeScript
92%
Other

GitNexus

Developer Tools · AI Code Assistants

47,086

Index any codebase into an interactive knowledge graph and give your AI agents deep architectural context via MCP — with zero servers required.

View details
88
Repo Health
86
Technical
73
Dependency
Built with
TypeScript92%
Updated yesterday
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,284

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
81%
MIT

LibreChat

Developer Tools · AI Assistants

42,871

Unite every major AI model in one self-hosted chat platform with agents, code execution, MCP tools, and enterprise authentication.

View details
93
Repo Health
81
Technical
65
Dependency
Built with
TypeScript81%
JavaScript18%
Updated today
TypeScript
92%
Other

n8n

Automation · No Code Platforms

203,555

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
66
Dependency
Built with
TypeScript92%
Updated today
TypeScript
99%
Other

NocoBase

No Code Platforms · Low Code Platforms

24,071

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript99%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search