LangGraph, Concept by Concept

LangGraph explained one concept at a time — state, nodes, edges, checkpointing, and human-in-the-loop — for building reliable stateful agent graphs.

11 parts · written by Pratik Dhanave. Start with Part 1 →

← All series · All posts

Part 1 · ·6 min read

LangGraph Is a Pregel Program: Shared State vs Message Passing

The foundational mental model — why "the graph" is a Pregel program, and how shared state differs from message passing.

LangGraph is shared-state, not message-passing, and both models descend from Google's Pregel/BSP: work advances in supersteps that end at a synchronization barrier. Get this mental model first and the whole API stops being magic.

Part 2 · ·5 min read

State, Channels, and Reducers: How LangGraph Merges Updates

The one idea that makes everything else in LangGraph click: nodes don't pass messages, they update a shared state — and reducers decide how.

State is a typed dict of channels; each channel has an optional reducer. No reducer overwrites; a reducer (like add_messages or operator.add) combines. This is the single idea the rest of LangGraph is built on.

Part 6 · ·6 min read

Cycles and the Agent Loop: Branch, Act, Loop Back

The single most important pattern in LangGraph — a branch plus a back-edge, and the `recursion_limit` that keeps it from running forever.

Branching plus a back-edge is a cycle, and that cycle IS the agent loop: model proposes tool calls, tools run, control returns to the model, repeat until done. Plus recursion_limit, the guardrail that stops a runaway loop.

Part 7 · ·6 min read

Command: Update State and Pick the Next Node in One Return

How a single `Command` object folds a state update and a routing decision together — and the tiny lowering that makes `goto` just another guarded edge.

Command lets a node return a state update and a goto in one object, moving the routing decision inside the node. It is the cleanest way to express supervisor handoffs and dynamic control flow.

Part 10 · ·6 min read

Human-in-the-Loop, Tools, and the Send API

The higher-level building blocks LangGraph stacks on top of the graph engine — pausing for a human, running an agent loop, calling tools, and fanning out dynamically.

The building blocks on top of the core graph: interrupt() to pause for human input, create_react_agent and ToolNode for tool-using agents, and the Send API for dynamic parallel fan-out with a reducer fan-in.

This series is part of a larger body of work by Pratik Dhanave, an Agentic AI Architect writing about production AI systems, distributed systems, and cloud-native engineering. Explore all course series, browse every post, or find topics via the tag index.