Building with AI

LangGraph

5 min readintermediateUpdated 28 Sept 2026
1 · In one line

LangGraph is an open-source framework for building AI agents as graphs, where steps share one state that can be saved, paused and resumed.

1 · What it is

LangGraph is a free, open-source toolkit for building AI agents, released under the MIT license. It is made by LangChain Inc, but you can use it without LangChain. A matching library, LangGraph.js, covers JavaScript and TypeScript. Its makers call it a low-level orchestration framework. In plain words, it handles the plumbing that keeps a long-running agent on track. It does not hand you a ready-made agent.

The core idea is a graph: a set of boxes joined by arrows. Each box is a node. A node is a small piece of code that does one job. It might call a language model, look something up or run plain code. Each arrow is an edge. It decides which node runs next. An edge can be fixed. Or it can be a branch that looks at the current situation and picks a path. Edges can also loop back, so an agent can try, check and try again.

All the nodes share one piece of memory called the state. Think of it as a form that travels with the job. A node reads the form, does its work and hands back the fields it wants to change. Small rules called reducers decide how each change is merged in. By default, a new value simply replaces the old one.

A workflow follows a set path. An agent chooses its own steps and tools. One graph can hold both. For example, a refund check can be plain code, while the friendly reply comes from the model.

Before a graph can run, you compile it, which means turning your plan into something ready to run. Compiling checks that no node is left unconnected. It is also where you plug in a checkpointer, the part that saves progress. At each step, the checkpointer stores a snapshot of the state. Snapshots are grouped under a thread ID. That is a label for one conversation or job. Come back with the same thread ID and the graph picks up the saved state. Use a new thread ID and it starts fresh.

Those snapshots give you three things. First, memory: follow-up messages in the same thread see what came before. Second, recovery: if a node fails, you can restart from the last step that worked instead of from the beginning. Third, time travel: you can replay earlier snapshots to see where a run went wrong. For facts that should outlast one conversation, such as a user’s preferences, LangGraph has a separate store that works across threads.

Human-in-the-loop means a person checks or steers the agent during a run. In LangGraph this is done with an interrupt. Imagine a helpdesk agent that has drafted a refund. Inside the approval node, the code calls interrupt with a question such as “Approve this refund?”. LangGraph saves the state and waits for as long as needed. When the person answers, your app calls the graph again with a Command, a small message that carries the answer. That answer becomes the value the interrupt returns inside the node, and the run carries on. An interrupt needs a checkpointer and a thread ID, because resuming means loading the saved state.

LangGraph also has limits. It does not write your prompts or choose your agent’s design. The simple in-memory checkpointer keeps everything in RAM, the computer’s short-term memory. So a restart wipes it. For real use, the docs suggest one that saves to a database, such as PostgresSaver. Over long conversations, checkpoints pile up and can slow things down and cost storage. And because it is low-level, the docs point newcomers to higher-level prebuilt agents first.

2 · Why it exists

Long agent tasks are hard to control, pause and recover.

Mixing rules and AISome parts of a task should follow fixed code, while others need a language model to decide. LangGraph lets both kinds of step live in one graph.
Losing progressA long run can fail halfway. LangGraph can save its state as it goes, so a failed run can restart from the last successful step.
Waiting for peopleSome actions need a person to check them first. LangGraph can pause a run, wait for input and then carry on.
3 · How it works

Follow one support request through a small LangGraph graph.

Nodes do the work, edges pick the next node, and a checkpoint lets the run pause for a person and resume later.
  1. 1 · stateYou first define the state, the shared record every node reads from and writes to.
  2. 2 · nodesEach node is a function that takes the current state, does some work and returns an update.
  3. 3 · edgesEdges pick the next node, either as a fixed step or as a branch based on the state.
  4. 4 · checkpointAfter every step, a checkpointer stores a copy of the state, filed under a thread ID.
  5. 5 · interruptAn interrupt pauses the run and waits, and a later call resumes it from the saved state.

Saved state is what lets an interrupt pause the run and resume it later.

4 · Where it's used
WhoWhat they askWhat it works with
Support team building a helpdesk agent“Can a person approve a refund before the agent sends it?”An interrupt inside the approval node
Developer of a chat assistant“How does the bot remember earlier messages in the same conversation?”Checkpoints stored under one thread ID
Team running long research jobs“If one step crashes, do we lose an hour of work?”The last successful checkpoint
Engineer debugging an agent“What did the state look like three steps ago?”Earlier checkpoints for replay and time travel
5 · What it solves, and what it doesn't
solves
  • It lets you combine fixed, hand-written steps with steps where a language model decides.
  • It saves graph state so a run can continue a conversation or recover after a failure.
  • It lets a person inspect and change the agent's state during a run.
  • It can keep long-term data, such as user preferences, across separate threads.
doesn't solve
  • It does not design your prompts or your agent's architecture for you.
  • Its in-memory checkpointer keeps checkpoints in RAM, so they vanish when the process restarts.
  • It is low-level, so beginners are pointed to higher-level prebuilt agents first.
6 · Go deeper

Sources used

This explainer is written in original language. The links below support its factual claims.

  1. docsLangGraph overview, LangChain · read 28 Sept 2026
  2. docsGraph API overview, LangChain · read 28 Sept 2026
  3. docsPersistence, LangChain · read 28 Sept 2026
  4. docsCheckpointers, LangChain · read 28 Sept 2026
  5. docsInterrupts, LangChain · read 28 Sept 2026
  6. repolangchain-ai/langgraph, GitHub · read 28 Sept 2026
  7. docsWorkflows and agents, LangChain · read 28 Sept 2026