Skip to main content

What Is LangGraph?

LangGraph is an open-source library, for Python and JavaScript, for building applications that work through a task in steps, where some steps ask an AI model and others are ordinary code. You describe the application as a graph: the data it works on, the steps that read and update that data, and the arrows that say which step runs next. LangGraph runs it, and it can save the run after every step, pause it for a person, and pick it up again after a crash. This page explains those pieces, shows a small graph that mixes a Claude step with a Python step, and maps every concept of LangGraph to the tutorial in this track that teaches it.

What LangGraph Does​

An application built on an AI model rarely makes a single call. It reads something, asks the model, checks the answer in code, maybe asks again, and saves the result. Some steps can run at the same time, some need a person's approval, and a long run can fail halfway. You can write all of that by hand, but then you also write the saving, the resuming and the pausing yourself.

LangGraph's overview describes what it takes over: LangGraph is a low-level orchestration framework and runtime for long-running, stateful agents. You define workflows as graphs of shared state, nodes, and edges, and can mix deterministic steps with LLM-driven steps in the same graph. An LLM, a large language model, is the kind of AI model behind Claude. A deterministic step is ordinary code, which gives the same result every time.

What you get from the runtime, in the overview's words:

  • Deterministic and agentic steps: Combine hand-coded nodes with model-driven nodes in one graph.
  • Persistence: Checkpoint state and resume after failures or pauses.
  • Human-in-the-loop: Pause execution, inspect or edit state, then continue.
  • Memory: Short-term thread state and longer-term memory across sessions.
  • Streaming: Stream tokens, state updates, and other events as the graph runs.

What you don't get is just as deliberate: LangGraph does not prescribe prompts or agent architecture. You write the prompts and decide what each step does, and LangGraph runs the steps in the order the graph describes.

Where It Comes From​

LangGraph is one of LangChain's products, next to the LangChain framework and LangSmith. Its first release on PyPI, the Python package index, came out in January 2024, and version 1.0 in October 2025. It runs graphs in the style of Google's Pregel system, a design for processing large graphs in rounds, which is where its super-steps come from.

  • Languages: Python and JavaScript. This track uses Python 3.14.
  • License: open source under the MIT license, and free.
  • Version: this track uses langgraph 1.2.25, released on December 1, 2026.

State, Nodes and Edges​

LangGraph's Graph API overview names the three parts of every graph:

  1. State: A shared snapshot of the application. Usually a typed schema. In Python, it can be a TypedDict, a dataclass or a Pydantic model. This track starts with TypedDict: a class that lists the keys the state has and the type of each value.
  2. Nodes: Functions that read state, do work, and return updates. A node is an ordinary Python function. It receives the state and returns only the keys it changes.
  3. Edges: Fixed or conditional transitions that determine the next node. A fixed edge always leads to the same node. A conditional edge calls a function that picks the next node at run time.

Or, as the same page puts it: nodes do the work; edges decide what runs next. Two special names mark where a run begins and ends: START and END.

You build a graph with StateGraph, add nodes and edges to it, and then compile it. The Graph API overview says that Compilation checks the graph structure (for example for orphaned nodes), and that You must compile the graph before you invoke or stream it. invoke runs the compiled graph from a starting state and returns the final one.

A Graph in a Few Lines of Python​

Here's a complete graph: a proofreader. It has two nodes. proofread sends a sentence to Claude Opus 5.5 and keeps the corrected version. compare is plain Python: it lists the words that changed. You'll build graphs yourself, step by step, starting in the next tutorial. For now, read the code and look at what it prints.

main.py
from typing import TypedDict

from dotenv import load_dotenv
from langchain_anthropic import ChatAnthropic
from langgraph.graph import END, START, StateGraph

load_dotenv() # Reads ANTHROPIC_API_KEY from the .env file.

claude = ChatAnthropic(model="claude-opus-5-5", effort="low")


# The state: the data every step of the graph reads and updates.
class State(TypedDict):
text: str
corrected: str
changed_words: list[str]


# A step that asks Claude.
def proofread(state: State) -> dict:
reply = claude.invoke(
"Correct the spelling and grammar of this sentence. "
"Reply with the corrected sentence only.\n\n" + state["text"]
)
return {"corrected": reply.text}


# A step in plain Python.
def compare(state: State) -> dict:
original = state["text"].split()
changed = [word for word in state["corrected"].split() if word not in original]
return {"changed_words": changed}


# The graph: START -> proofread -> compare -> END.
builder = StateGraph(State)
builder.add_node("proofread", proofread)
builder.add_node("compare", compare)
builder.add_edge(START, "proofread")
builder.add_edge("proofread", "compare")
builder.add_edge("compare", END)
graph = builder.compile()

result = graph.invoke({"text": "Their going too the libary tomorow."})
for key, value in result.items():
print(f"{key}: {value}")

macOS-style code window titled main.py — proofreader showing a LangGraph graph in Python: load_dotenv, a ChatAnthropic model for claude-opus-5-5 with low effort, a State TypedDict with text, corrected and changed_words, a proofread node that asks Claude to correct the sentence, a compare node that lists the changed words, a StateGraph with the edges START, proofread, compare and END, and an invoke with a sentence full of mistakes.

  • load_dotenv() reads your Claude API key, ANTHROPIC_API_KEY, from a .env file next to the code, so the key never appears in the code itself. If the script can't find that file, the call to Claude fails with a misleading Connection error., as Fixed: "AnthropicConnectionError: Connection error." When a LangGraph Node Calls Claude explains.
  • ChatAnthropic is the Claude model, from the langchain-anthropic package. effort="low" asks Claude to work quickly: proofreading one sentence is a small job.
  • State lists the three keys of the state. The input fills in only text, and the two nodes add the other keys as the graph runs.
  • proofread is a node. It reads text from the state, asks Claude, and returns {"corrected": …}: only the key it changes.
  • compare is a node too, with no AI in it. It splits both sentences into words and keeps the corrected words that weren't in the original.
  • builder puts the graph together: two nodes, and three fixed edges from START through proofread and compare to END. compile() turns it into a graph you can run.
  • graph.invoke runs it with a starting state and returns the final state, which the loop prints key by key.

When I ran it with uv run main.py, it printed:

Output
text: Their going too the libary tomorow.
corrected: They're going to the library tomorrow.
changed_words: ["They're", 'to', 'library', 'tomorrow.']

macOS-style terminal window titled Terminal — proofreader showing uv run main.py printing the text Their going too the libary tomorow., the corrected sentence They're going to the library tomorrow., and the changed words They're, to, library and tomorrow. with its full stop.

The final state holds all three keys. text is the input, corrected came from Claude through proofread, and changed_words came from compare. 'tomorrow.' keeps its full stop because split() splits only at spaces. I ran the graph three times and got the same sentence each time, but Claude writes every reply fresh, so yours can be worded differently.

The input {"text": …} leaves out two keys that State lists. Python doesn't mind, and the graph ran. A type checker such as mypy does mind, and Fixed: No overload variant of "stream" of "Pregel" matches argument types shows the two ways to tell it which keys the input needs.

What Happens During a Run​

LangGraph runs one node at a time here, because each node has only one edge leading out of it. Each node gets the state as it stands, and LangGraph merges what the node returns into the state before the next node runs:

To see each step for real, I streamed the run's updates with graph.stream(..., stream_mode="updates"), as How to See What Each Node Returns in a LangGraph Graph in Python shows. It printed one line per node, with what that node returned:

Output
{'proofread': {'corrected': "They're going to the library tomorrow."}}
{'compare': {'changed_words': ["They're", 'to', 'library', 'tomorrow.']}}

Each node returned only its own key, and LangGraph kept the rest of the state. That's the default for every key: The default reducer replaces the left value with the right. Nodes return partial updates, not the full state. A reducer decides how an update merges into a key, and other reducers can, for example, add to a list instead of replacing it. In LangGraph's terms, each node ran in its own super-step, because Nodes that run in sequence use separate super-steps. Nodes that run in parallel share one.

If you copy that loop, spell the mode updates, with an s. A misspelled mode doesn't raise an error: the loop prints nothing at all, as Fixed: LangGraph graph.stream() Prints Nothing and Raises No Error shows.

The Graph as a Diagram​

LangGraph can draw a compiled graph: graph.get_graph().draw_mermaid() returns the graph as a Mermaid diagram, in text, and drawing it never calls Claude. How to Draw a LangChain Agent as a Mermaid Diagram in Python uses the same call. This is the proofreader, redrawn from what draw_mermaid() printed for it:

A straight line: __start__ and __end__ are how LangGraph writes START and END. Later graphs in this track branch, loop and run nodes in parallel, and the same call draws those too. If you show the diagram on a page with a dark theme, its labels can be nearly invisible, as Fixed: LangChain draw_mermaid() Diagram Labels Unreadable in Dark Mode explains.

How LangGraph Relates to LangChain, Deep Agents and LangSmith​

LangGraph is one of several products from the same company. LangGraph's overview describes how they fit together:

ProductWhat LangChain says it isIn this track
LangGraphThe orchestration runtime: durable execution, streaming, human-in-the-loop, and persistenceEverything: the graph and its runtime
LangChainThe agent framework: abstractions and integrations for models, tools, and agent loopsThe Claude model inside the nodes, through langchain-anthropic
Deep AgentsAn agent harness: planning, subagents, filesystem tools, and context management on top of LangGraphNot covered here
LangSmithThe platform for tracing, evaluation, prompts, and deployment across frameworksNot used. Every graph in this track runs on your computer

LangChain's agents run on LangGraph: an agent made with LangChain's create_agent is a compiled LangGraph graph. LangGraph doesn't need LangChain, though: Docs examples often use LangChain for those integrations, but LangGraph does not require LangChain. A node is a Python function, so it can call any model library, or none at all.

So which one should you use? LangGraph's overview answers: If you want a higher-level agent loop first, use Deep Agents or LangChain agents. Use LangGraph when you need explicit control over state and control flow. With LangGraph, you decide every step and every path, which suits applications whose steps you know in advance, such as read, classify, check and save. When you just want a model that calls tools until it has an answer, LangChain's create_agent gives you that loop ready-made, and the LangChain tutorials teach it.

The Model in a Node​

This track uses Claude Opus 5.5 (claude-opus-5-5) in every node that needs a model, through ChatAnthropic from langchain-anthropic. Its main setting is effort: how hard Claude works on each request. Anthropic's effort guide says that Claude Opus 5.5 supports all five effort levels, and medium is the default, and describes low as Most efficient. Significant token savings with some capability reduction.

Effort also steers Claude's thinking, the reasoning it can do before it answers. At low, Anthropic's guide to thinking says, Claude minimizes thinking. Skips thinking for simple tasks where speed matters most. That's what happened in the proofreader: its call to Claude used no thinking tokens at all. Each node can use its own effort, so a graph can spend more on its hard steps and less on its easy ones.

The Packages​

LangGraph comes as a set of packages. A project adds the ones it uses, and each brings the packages it needs. These are the ones this track uses:

PackageWhat it gives youVersion
langgraphStateGraph, nodes, edges and the runtime that runs them1.2.25
langgraph-checkpointThe base for saving a graph's state, with an in-memory saver. Comes with langgraph4.3.2
langgraph-prebuiltReady-made parts for agents, such as a node that runs tools. Comes with langgraph1.1.3
langgraph-sdkA Python client for a LangGraph server. Comes with langgraph0.4.14
langchain-coreThe building blocks LangGraph and the model packages share, such as messages. Comes with langgraph1.8.5
langchain-anthropicClaude models1.7.13
langgraph-checkpoint-sqliteSaving a graph's state in a SQLite file3.1.3
langgraph-cliRunning a graph as a local server0.4.45
python-dotenvLoading the API key from a .env file1.2.4

The proofreader needed three of them: uv add langgraph langchain-anthropic python-dotenv. In a new project on Python 3.14, that installed 44 packages, every one of them ready-built, with nothing to compile. How to Install LangGraph in Python with uv installs LangGraph on its own, checks the version and explains the packages it brings.

Why Python 3.14​

Python 3.15 is out, but one package that every LangGraph project installs isn't ready for it yet: zstandard. LangGraph needs langchain-core, which needs langsmith, which needs zstandard, and the newest zstandard, 0.25.0, has no ready-built package (a wheel) for Python 3.15. On 3.15, it has to be compiled from source, which needs a C compiler on your computer. On Python 3.14, everything installs from wheels. Every project in this track starts with uv init --python 3.14.

Every Concept, and Where This Track Teaches It​

This track teaches LangGraph one concept at a time, in the order below. Each tutorial has its own small example, like the proofreader on this page, and builds only on the tutorials before it. They're published one at a time, and each concept becomes a link here when its tutorial is out. The last three columns show which of the product lines below will use each concept.

ConceptWhat it lets you doWhere you'll learn itFeedback AnalyzerInvoice ApprovalContent Studio
What LangGraph isKnow what state, nodes and edges are, what happens during a run, and when to choose LangGraphThis page✓✓✓
Your first graphInstall LangGraph, build a graph step by step, add a Claude node and draw the graphComing soon✓✓✓
How a graph runsFollow state updates through a run, one super-step at a time, and stream themComing soon✓✓✓
ReducersDecide how an update merges into the state, such as adding to a listComing soon✓✓✓
Messages in graph stateKeep a conversation in the state, with a Claude chat nodeComing soon✓
Input, output and private stateControl what goes into a graph, what comes out, and what stays between nodesComing soon
Conditional edgesChoose the next node while the graph runsComing soon
Loops and the recursion limitRepeat steps, and stop a graph that runs too longComing soon
Parallel branchesRun nodes at the same time and join their resultsComing soon✓
Map-reduce with SendRun a node once for every item of a list, in parallelComing soon✓✓
CommandUpdate the state and choose the next node in one return valueComing soon✓
Claude in a graph nodeSet effort, output length, prompt caching and refusal handling for each callComing soon✓✓✓
Tools and the agent loopLet Claude call your functions, in a loop you build yourselfComing soon
Structured output and routingGet typed results from Claude, and route on themComing soon✓✓
Workflow patternsBuild chains, routers, orchestrator-workers and evaluator-optimizersComing soon
Runtime context and configurationPass settings and connections into your nodesComing soon✓
Checkpointers and threadsSave the state after every step, and pick a run up laterComing soon✓✓
Durable execution with SQLiteResume a crashed run from its last saved stepComing soon✓✓
Human-in-the-loop with interrupt()Pause a graph for a person's answer, then continueComing soon✓✓
Approve, edit, reject and validateUse the common approval patternsComing soon✓
Time travelReplay a run from an earlier step, or fork it with a changeComing soon✓
Short-term memoryKeep conversations within their limits, safely with ClaudeComing soon✓
Long-term memory with storesRemember facts across conversationsComing soon✓
StreamingShow tokens, updates and progress while a graph runsComing soon✓✓
Event streamingFollow typed events for messages, state and subgraphsComing soon
SubgraphsBuild a graph from smaller graphsComing soon✓
Multi-agent graphs and handoffsMake several agents work together in one graphComing soon
Retries, timeouts and errorsRecover from steps that failComing soon✓✓
Node cachingSkip work a node has already done for the same inputComing soon✓
The Functional APIWrite a workflow as plain functions with @entrypoint and @taskComing soon✓
A local serverServe a graph over HTTP on your computer, and call it from PythonComing soon✓
Application structure and safe changesLay out a project, and change a graph without breaking runs in progressComing soon
The LangGraph runtimeSee how Pregel, channels and super-steps run every graphComing soon

The Product Lines​

Below the Fundamentals in the sidebar, three product lines will put the concepts together in complete applications, each built from an empty folder to a finished product, one part at a time. Where a part uses a concept, it links the concept's tutorial and spends its own words on what's specific to the product. All three are coming soon:

  • Customer Feedback Analyzer reads a file of customer reviews, sorts them by topic and mood with Claude in parallel batches, and drafts a report of the main themes that a person approves before it's saved. A long run that crashes resumes where it stopped, without paying again for the batches it finished.
  • Invoice Approval Workflow reads invoices, checks them against a database of vendors and purchase orders, and asks a person to approve each one. When an invoice was read wrongly, you can go back to that step, fix it and run on from there.
  • Content Repurposing Studio turns a Markdown blog post into drafts for LinkedIn, X and a newsletter, keeps your brand voice between sessions, and lets you revise the drafts in a chat.

What It Costs​

  • LangGraph: nothing. It's open source under the MIT license.
  • Claude: you pay Anthropic for the tokens your graphs send and receive. Claude Opus 5.5 costs $4 per million input tokens and $20 per million output tokens. There's no free tier: Anthropic's pricing page says The Claude API has no free tier or self-serve trial, and new accounts don't include free credits, and the smallest credit purchase is $5. How to Get a Claude API Key shows how to buy credit and create a key.
  • LangSmith: not needed. The graphs in this track run without a LangSmith account or API key.

To see what that means in practice, I measured the proofreader's call to Claude, as How to Get the Token Usage and Cost of a LangChain Agent Run in Python measures an agent. One run used 51 input tokens and 14 output tokens, and no thinking tokens. That's about $0.0005, so a dollar pays for about 2,000 runs. The compare node costs nothing, because it's plain Python.

Tools You'll Use​

ToolWhat it's for
uvCreates Python 3.14 projects, installs packages and runs your code
A code editor, such as Visual Studio CodeWriting the code
A Claude API key with creditThe model in the nodes that need one

The next tutorial, Install LangGraph and Build Your First Graph, creates a project with LangGraph and builds a graph one step at a time.

Frequently Asked Questions​

Is LangGraph free?​

Yes. LangGraph is open source under the MIT license, and its packages are free. You pay for the services your nodes use, such as an AI model.

Do I need LangChain to use LangGraph?​

No. LangGraph's overview says it does not require LangChain. When you install langgraph, it brings langchain-core with it, but not the langchain package. This track adds langchain-anthropic only because its nodes talk to Claude through it. A node can just as well call Anthropic's own SDK, or no model at all.

What's the difference between LangGraph and LangChain's agents?​

A LangChain agent is a ready-made graph: a model node and a tools node, with a loop between them. LangGraph lets you build any graph you like, with your own nodes, your own state and your own paths. Use LangChain's agents when that ready-made loop is what you need, and LangGraph when you need to decide the steps yourself.

Do I need LangSmith?​

No. The proofreader ran with no LangSmith account, and no graph in this track uses one. LangSmith shows you what each run did, and it's useful once your graphs grow, but nothing here depends on it.

Can I use another model instead of Claude?​

Yes. A node is a Python function, so it can call any model, through LangChain's integrations or the provider's own library. Different models behave differently, though, so this track uses Claude throughout, and every output on these pages comes from Claude Opus 5.5.

Can I use JavaScript instead of Python?​

Yes. LangGraph has a JavaScript version, @langchain/langgraph, with its own documentation. This track uses Python throughout, so every example, command and output here is Python.

Conclusion​

LangGraph runs applications that are built as graphs: a state that holds the data, nodes that do the work, and edges that decide what runs next. The proofreader showed both kinds of node in one graph, Claude correcting a sentence and plain Python comparing the words, for about a twentieth of a cent per run. The rest of LangGraph builds on those three parts: saving the state after every step, pausing for a person, running nodes in parallel and picking a crashed run up where it stopped.

Next: Install LangGraph and Build Your First Graph (coming soon) creates a Python 3.14 project with LangGraph, builds a graph one node and one edge at a time, adds a Claude node and draws the result.

Additional Resources​

  • LangGraph overview — what LangGraph is, its capabilities, and how the LangChain products fit together.
  • Graph API overview — state, nodes, edges, reducers and super-steps.
  • Streaming — the stream modes, including updates.
  • ChatAnthropic — Claude models in LangChain, including effort.
  • Effort — Claude's effort levels and their defaults.
  • Claude pricing — what each Claude model costs per token.
  • langgraph on PyPI — releases, supported Python versions and the license.