LangGraph: Build Resilient Agents with Low-Level Orchestration and 36.1k+ GitHub Stars

LangGraph is the low-level orchestration framework for building resilient, stateful AI agents with durable execution, state management, and production deployment capabilities. Learn how it powers production systems at companies like Klarna, Uber, and J.P. Morgan.

LangGraph: Build Resilient Agents with Low-Level Orchestration and 36.1k+ GitHub Stars

LangGraph has emerged as the go-to framework for building production-grade AI agents that need to persist through failures, handle complex workflows, and maintain state across extended execution periods. With 36.1k GitHub stars and active development (latest release 1.2.7 on June 29, 2026), LangGraph represents a fundamental shift in how developers approach agent orchestration—moving away from high-level abstractions toward explicit, debuggable control flow.

Created by LangChain Inc and trusted by companies like Klarna, Uber, and J.P. Morgan, LangGraph provides the low-level infrastructure that powers production AI systems. Unlike higher-level frameworks that hide complexity, LangGraph gives you complete visibility and control over agent behavior, making it ideal for teams building mission-critical applications.

What is LangGraph?

LangGraph is a low-level orchestration framework and runtime for building, managing, and deploying long-running, stateful agents. It's not a complete agent framework—it's the orchestration layer that sits beneath frameworks like LangChain, providing the durable execution, state management, and human-in-the-loop capabilities that production systems require.

The framework is inspired by Google's Pregel and Apache Beam, drawing on decades of distributed systems research. LangGraph lets you define agents as explicit graphs of nodes and edges, where each node represents a computation step and edges define the flow between them. This graph-based approach makes agent behavior transparent, testable, and debuggable—critical requirements for production deployments.

LangGraph is language-agnostic at its core, with official support for Python (via the main library) and JavaScript/TypeScript (via LangGraph.js). The framework integrates seamlessly with LangChain components but doesn't require them, allowing you to use LangGraph with any LLM provider or tool ecosystem.

Core Features and Architecture

1. Durable Execution and Persistence
LangGraph agents can persist through failures and resume from exactly where they left off. The framework supports multiple checkpoint backends (in-memory, PostgreSQL, and custom implementations), allowing agents to recover from crashes, network failures, or intentional interruptions. This is essential for long-running workflows that might take hours or days to complete.

2. State Management with Channels
LangGraph uses a channel-based state system where each piece of state is stored in a named channel. Channels support reducers (functions that merge new values with existing state), enabling sophisticated state accumulation patterns. The new DeltaChannel feature (introduced in v1.2) dramatically reduces checkpoint blob sizes for long-running agents with accumulating state like message histories—achieving 5-100x compression for typical use cases.

3. Graph API and Functional API
LangGraph offers two complementary APIs. The Graph API lets you explicitly define nodes and edges, building agents as directed acyclic graphs. The Functional API (newer) lets you write agents as standard Python functions with control flow, making the code feel more natural while maintaining the same underlying capabilities. Both compile to the same execution model.

4. Human-in-the-Loop Interrupts
Agents can be paused at specific points to allow human review or modification. You can inspect agent state, modify it, and resume execution—enabling workflows where critical decisions require human approval before proceeding. This is invaluable for high-stakes applications in finance, healthcare, or legal domains.

5. Streaming and Real-Time Feedback
LangGraph supports streaming outputs, allowing you to receive agent updates in real-time as they execute. This enables responsive UIs that show agent reasoning, tool calls, and intermediate results as they happen, rather than waiting for the entire workflow to complete.

6. Comprehensive Memory Systems
LangGraph distinguishes between short-term working memory (for ongoing reasoning within a single execution) and long-term persistent memory (across sessions). This dual-memory approach enables agents to maintain context across multiple conversations while keeping individual runs focused and efficient.

7. LangSmith Integration
LangGraph integrates deeply with LangSmith, LangChain's observability platform. You get automatic tracing of all agent executions, visualization of execution graphs, detailed metrics, and LangSmith Engine—which monitors traces, detects issues, and proposes fixes automatically.

Get free AI agent insights weekly

Join our community of builders exploring the latest in AI agents, frameworks, and automation tools.

Join Free

Getting Started

Installation
Install LangGraph with pip:

pip install -U langgraph

Hello World Example
Here's the simplest LangGraph agent:

from langgraph.graph import StateGraph, MessagesState, START, END

def mock_llm(state: MessagesState):
    return {"messages": [{"role": "ai", "content": "hello world"}]}

graph = StateGraph(MessagesState)
graph.add_node("llm", mock_llm)
graph.add_edge(START, "llm")
graph.add_edge("llm", END)
agent = graph.compile()

result = agent.invoke({"messages": [{"role": "user", "content": "hi!"}]})
print(result)

Building a Tool-Using Agent
A more realistic example with tool calling:

from langchain.tools import tool
from langchain.chat_models import init_chat_model
from langgraph.graph import StateGraph, START, END
from typing import Literal

@tool
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

model = init_chat_model("claude-sonnet-4-6", temperature=0)
model_with_tools = model.bind_tools([add])

def llm_node(state):
    return {"messages": [model_with_tools.invoke(state["messages"])]}

def tool_node(state):
    results = []
    for tool_call in state["messages"][-1].tool_calls:
        result = add.invoke(tool_call["args"])
        results.append({"role": "tool", "content": str(result)})
    return {"messages": results}

def should_continue(state) -> Literal["tools", END]:
    if state["messages"][-1].tool_calls:
        return "tools"
    return END

graph = StateGraph(MessagesState)
graph.add_node("llm", llm_node)
graph.add_node("tools", tool_node)
graph.add_edge(START, "llm")
graph.add_conditional_edges("llm", should_continue)
graph.add_edge("tools", "llm")

agent = graph.compile()
result = agent.invoke({"messages": [{"role": "user", "content": "What is 5 + 3?"}]})

Real-World Use Cases

Financial Analysis Workflows
LangGraph powers agents that analyze market data, generate reports, and require human approval before executing trades. The human-in-the-loop capability ensures compliance teams can review agent decisions before they impact real money.

Customer Support Automation
Multi-turn support agents that maintain conversation context, escalate to humans when needed, and learn from past interactions. LangGraph's memory systems enable agents to remember customer history across sessions while keeping individual conversations focused.

Research and Data Processing
Long-running agents that gather data from multiple sources, synthesize findings, and generate reports. Durable execution means these workflows can run for hours without losing progress, and streaming enables real-time visibility into agent progress.

Autonomous Code Generation
Agents that write, test, and refine code across multiple iterations. LangGraph's explicit control flow makes it easy to implement complex reasoning patterns like reflection loops, where agents review their own output and iterate toward better solutions.

How It Compares

LangGraph vs CrewAI
CrewAI emphasizes role-based agent design with predefined agent archetypes (researcher, analyst, etc.). It's faster to get started but less flexible for custom workflows. LangGraph requires more upfront work but gives you complete control over agent behavior and state management. Choose CrewAI for rapid prototyping; choose LangGraph for production systems with complex requirements.

LangGraph vs AutoGen
AutoGen focuses on multi-agent conversation patterns where agents discuss problems and reach consensus. It's excellent for collaborative reasoning but less suitable for deterministic workflows. LangGraph is more general-purpose, supporting both conversational and deterministic patterns. LangGraph also has better production deployment support through LangSmith.

LangGraph vs Smolagents
Smolagents is a lightweight library (~1,000 lines) focused on simplicity and code-based reasoning. It's ideal for simple agents but lacks LangGraph's persistence, human-in-the-loop, and production deployment features. Smolagents is great for learning; LangGraph is built for production.

What's Next

LangGraph's roadmap focuses on deepening production capabilities. Upcoming features include enhanced batch reconstruction for faster state recovery, improved sync write ordering for consistency guarantees, and expanded checkpoint backend support. The community is also exploring ShallowPostgresSaver compatibility for edge deployments and more efficient delta channel implementations.

The framework is rapidly becoming the standard for production AI agents. As more teams deploy LangGraph-based systems, the ecosystem of integrations, templates, and best practices continues to grow. LangSmith's recent enhancements to observability and the new LangSmith Engine for automatic issue detection signal LangChain's commitment to making agent development and deployment accessible to all teams.

Sources

Read more