MCPcopy Index your code
hub / github.com/langchain-ai/langgraphjs

github.com/langchain-ai/langgraphjs @1.4.7 sqlite

repository ↗ · DeepWiki ↗ · release 1.4.7 ↗
5,258 symbols 15,769 edges 1,012 files 746 documented · 14%
README

  <img alt="LangGraph Logo" src="https://github.com/langchain-ai/langgraphjs/raw/1.4.7/github/images/logo-dark.svg" width="50%">

Low-level orchestration framework for building stateful agents.

Docs Version npm - Downloads Open Issues

LangGraph — used by Replit, Uber, LinkedIn, GitLab and more — is a low-level orchestration framework for building controllable agents. While langchain provides integrations and composable components to streamline LLM application development, the LangGraph library enables agent orchestration — offering customizable architectures, long-term memory, and human-in-the-loop to reliably handle complex tasks.

npm install @langchain/langgraph @langchain/core

[!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 Python library, check out LangGraph and the Python docs.

Why use LangGraph?

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.

LangGraph’s ecosystem

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 (JS) — Build agents that can plan, use subagents, and leverage file systems for complex tasks. A higher-level package built on top of LangGraph.
  • 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.

Additional resources

  • LangChain Forum: Connect with the community and share all of your technical questions, ideas, and feedback.
  • LangChain Academy: Learn the basics of LangGraph in our free, structured course.
  • Streaming Cookbook: Documentation and examples around LangGraphs's streaming capabilities.
  • API Reference: Detailed reference on core classes, methods, how to use the graph and checkpointing APIs, and higher-level prebuilt components.
  • Built with LangGraph: Hear how industry leaders use LangGraph to ship powerful, production-ready AI applications.

Acknowledgements

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.

Extension points exported contracts — how you extend this code

StreamEmitter (Interface)
(no doc) [10 implementers]
libs/langgraph-core/src/stream/types.ts
ChannelProtocol (Interface)
(no doc) [12 implementers]
libs/checkpoint/src/serde/types.ts
EventStreamHandle (Interface)
(no doc) [19 implementers]
libs/sdk/src/client/stream/transport.ts
CreateCuaParams (Interface)
* Configuration for the Computer Use Agent. * @inline
libs/langgraph-cua/src/index.ts
UseStreamReturn (Interface)
(no doc) [2 implementers]
libs/sdk-react/src/use-stream.ts
PostgresSaverOptions (Interface)
@inline
libs/checkpoint-postgres/src/index.ts
CreateHandoffToolParams (Interface)
@inline
libs/langgraph-swarm/src/handoff.ts
UseStreamReturn (Interface)
(no doc) [2 implementers]
libs/sdk-angular/src/use-stream.ts

Core symbols most depended-on inside this repo

addEdge
called by 1194
libs/langgraph-core/src/graph/graph.ts
push
called by 1084
libs/langgraph-core/src/stream/types.ts
addNode
called by 1009
libs/langgraph-core/src/graph/graph.ts
invoke
called by 831
libs/langgraph-core/src/pregel/types.ts
compile
called by 616
libs/langgraph-core/src/graph/graph.ts
get
called by 406
libs/sdk/src/client/stream/types.ts
gatherIterator
called by 266
libs/langgraph-core/src/utils.ts
join
called by 265
libs/sdk/src/client/runs/index.ts

Shape

Function 2,285
Method 1,766
Class 658
Interface 549

Languages

TypeScript99%
Python1%

Modules by API surface

libs/langgraph-core/src/tests/pregel.test.ts94 symbols
libs/sdk/src/client/stream/index.ts74 symbols
libs/langgraph-core/src/errors.ts73 symbols
libs/langgraph-core/src/tests/python_port/checkpoint.test.ts72 symbols
libs/sdk/src/ui/orchestrator.ts69 symbols
libs/sdk/src/stream/controller.ts62 symbols
libs/sdk-svelte/src/use-audio-player.svelte.ts55 symbols
libs/langgraph-core/src/tests/utils.ts50 symbols
examples/ai-elements/src/components/ai-elements/prompt-input.tsx49 symbols
libs/sdk-vue/src/use-audio-player.ts48 symbols
libs/sdk/src/client/stream/media.ts46 symbols
libs/sdk/src/client/stream/messages.ts45 symbols

Dependencies from manifests, versioned

@a2a-js/sdk0.3.13 · 1×
@analogjs/vite-plugin-angular2.6.0 · 1×
@analogjs/vitest-angular2.6.0 · 1×
@angular/build22.0.0 · 1×
@angular/cli22.0.0 · 1×
@angular/common22.0.1 · 1×
@angular/compiler22.0.1 · 1×
@angular/compiler-cli22.0.0 · 1×
@angular/core22.0.1 · 1×
@angular/forms22.0.0 · 1×
@angular/platform-browser22.0.0 · 1×
@angular/platform-browser-dynamic22.0.0 · 1×

Datastores touched

(mongodb)Database · 1 repos
dbDatabase · 1 repos
invalidDatabase · 1 repos
postgresDatabase · 1 repos
testdbDatabase · 1 repos

For agents

$ claude mcp add langgraphjs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact