Key Concepts
State Graphs
Define agent logic as a directed graph with nodes (functions) and edges (transitions):
graph.add_node("research", research_fn)
graph.add_node("write", write_fn)
graph.add_conditional_edges("research", route_fn, {"done": "write", "more": "research"})Persistence & Checkpoints
Save and resume agent state across sessions:
from langgraph.checkpoint.memory import MemorySaver
app = graph.compile(checkpointer=MemorySaver())Human-in-the-Loop
Pause execution for human approval before critical actions:
graph.add_node("approve", interrupt_before=True)Streaming
Stream intermediate results, tool calls, and token-by-token output.
LangGraph Platform
Deploy agents as scalable APIs with built-in monitoring via LangGraph Cloud.
FAQ
Q: What is LangGraph? A: A LangChain framework for building stateful AI agents as directed graphs, with support for cycles, persistence, human-in-the-loop, and streaming. 28K+ GitHub stars.
Q: Do I need LangChain to use LangGraph? A: LangGraph can work standalone, but integrates seamlessly with LangChain for model providers, tools, and retrievers.