LangGraph state, nodes, edges and checkpoints
LangGraph is a framework for stateful AI workflows built from Node functions connected by Edge rules over shared State.
In plain terms
A Chain is a line. A LangGraph workflow is a flowchart. A StateGraph passes State between each Node, an Edge chooses where to go next, a Conditional Edge branches based on logic, and a Loop repeats until a stop condition is met.
Why it matters
Serious agents need durability, branching, human approvals and recovery. A long-running workflow should not lose its place when a process restarts.
How it works
Define the State schema, add Nodes for model calls, tools, routers or validators, connect them with Edges, and compile the StateGraph. This behaves like a State Machine: the workflow moves between steps based on changing State and conditions. Checkpointing saves workflow State after steps. Short-Term Memory usually means the active conversation or thread state; Long-Term Memory stores durable facts across runs; Conversation Memory is the message history used by the current chat.
When you use it
Use LangGraph for multi-step agents, workflows with Human-in-the-Loop approval, retries, branching, checkpoint recovery and multi-agent systems.
Common mistakes
- Using a graph before the workflow shape is clear.
- Putting everything in State until it becomes unreadable.
- Skipping Checkpointing for long tasks.
Best practices
- Keep State explicit and typed.
- Make each Node small and testable.
- Use Human-in-the-Loop gates for risky actions.
Try it yourself
Build a StateGraph with plan, retrieve, answer and human-review nodes, then add Checkpointing so it can resume after interruption.
Resources
- LangGraph docs Official docs for stateful agent workflows.