LangGraph
LangGraph is an open-source framework for building AI agents as graphs, where steps share one state that can be saved, paused and resumed.
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.
Long agent tasks are hard to control, pause and recover.
Follow one support request through a small LangGraph graph.
- 1 · stateYou first define the state, the shared record every node reads from and writes to.
- 2 · nodesEach node is a function that takes the current state, does some work and returns an update.
- 3 · edgesEdges pick the next node, either as a fixed step or as a branch based on the state.
- 4 · checkpointAfter every step, a checkpointer stores a copy of the state, filed under a thread ID.
- 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.
| Who | What they ask | What 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 |
- 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.
- 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.
Sources used
This explainer is written in original language. The links below support its factual claims.
- docsLangGraph overview, LangChain · read 28 Sept 2026
- docsGraph API overview, LangChain · read 28 Sept 2026
- docsPersistence, LangChain · read 28 Sept 2026
- docsCheckpointers, LangChain · read 28 Sept 2026
- docsInterrupts, LangChain · read 28 Sept 2026
- repolangchain-ai/langgraph, GitHub · read 28 Sept 2026
- docsWorkflows and agents, LangChain · read 28 Sept 2026