Last Updated: 3/11/2026
LangGraph Overview
LangGraph is a low-level orchestration framework for building, managing, and deploying long-running, stateful agents. Trusted by companies like Klarna, Replit, and Elastic, LangGraph gives you precise control over agent workflows without abstracting away the underlying mechanics.
What is LangGraph?
LangGraph models agent workflows as graphs where:
- Nodes are functions that do work (call LLMs, query databases, process data)
- Edges define the flow between nodes
- State is shared data that persists throughout execution
Unlike higher-level frameworks, LangGraph focuses entirely on orchestration. You define the logic, LangGraph handles the execution, persistence, and state management.
Core Benefits
Durable Execution
Build agents that persist through failures and run for extended periods. If your agent crashes, it automatically resumes from exactly where it left off using checkpoints.
Human-in-the-Loop
Incorporate human oversight by pausing execution at any point. Inspect agent state, make modifications, and resume—perfect for approval workflows and quality control.
Comprehensive Memory
Create stateful agents with:
- Short-term memory: Conversation history within a session (thread-scoped)
- Long-term memory: Facts and preferences across sessions (shared across threads)
Debugging with LangSmith
Gain deep visibility into agent behavior with visualization tools that trace execution paths, capture state transitions, and provide detailed runtime metrics.
Production-Ready Deployment
Deploy sophisticated agent systems with scalable infrastructure designed for stateful, long-running workflows.
When to Use LangGraph
Use LangGraph when you need:
- Fine-grained control over agent flow and state
- Long-running workflows that must survive failures
- Human approval steps in your automation
- Memory that persists across conversations
- Complex branching logic or parallel execution
Consider higher-level tools when:
- You want prebuilt agent patterns (use LangChain’s
create_agent) - Your workflow is simple and stateless
- You don’t need persistence or checkpointing
LangGraph Ecosystem
LangGraph integrates seamlessly with the LangChain ecosystem:
- LangSmith: Observability, tracing, and evaluation for agent development
- LangSmith Deployment: Purpose-built platform for deploying stateful agents
- LangChain: Integrations and components for LLM applications (models, tools, prompts)
You can use LangGraph standalone or combine it with these tools for a complete agent development experience.
How LangGraph Works
At its core, LangGraph uses a message-passing algorithm inspired by Google’s Pregel:
- Define state: Create a schema for data that flows through your graph
- Add nodes: Write functions that read state, do work, and return updates
- Connect with edges: Define static or conditional transitions between nodes
- Compile: Build the executable graph with optional checkpointing
- Run: Invoke the graph with input and get output
Here’s a minimal example:
from langgraph.graph import StateGraph, START, END
from typing_extensions import TypedDict
class State(TypedDict):
text: str
def node_a(state: State) -> dict:
return {"text": state["text"] + "a"}
def node_b(state: State) -> dict:
return {"text": state["text"] + "b"}
graph = StateGraph(State)
graph.add_node("node_a", node_a)
graph.add_node("node_b", node_b)
graph.add_edge(START, "node_a")
graph.add_edge("node_a", "node_b")
graph.add_edge("node_b", END)
app = graph.compile()
result = app.invoke({"text": ""})
print(result) # {'text': 'ab'}Next Steps
- Installation: Install LangGraph and dependencies
- Quickstart: Build your first calculator agent
- Core Concepts: Understand state, nodes, and edges in depth
- Building Graphs: Learn the Graph API and state management patterns
Acknowledgements
LangGraph is inspired by Pregel and Apache Beam . The public interface draws inspiration from NetworkX . LangGraph is built by LangChain Inc, but can be used without LangChain.