Registry / llm-agents / langgraph

langgraph

JSON →
library1.2.11pypypi✓ verified 26d ago

LangGraph is a low-level agent orchestration framework providing graph-based execution with durable state, built-in persistence, and human-in-the-loop patterns. As of v1.0 it is the foundational runtime for LangChain agents. Use LangChain for high-level agent abstractions, LangGraph for fine-grained control.

pip install langgraph
INSTALL
IMPORT
SIG · LANGGRAPH
L
langgraph
llm-agentspythonv1.2.11
Install
7.8s avg
Import
2419ms
Disk
77MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.11 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 2.500s · 74.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.8s · import 2.338s · 82MB
77MB installed
● package 77MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

StateGraph
from langgraph.graph import StateGraph
Core graph primitive. Unchanged in 1.0.
create_react_agent
from langchain import create_agent
from langgraph.prebuilt import create_react_agent
langgraph.prebuilt deprecated in 1.0. create_react_agent moved to langchain.agents. Use create_agent from langchain instead.
MemorySaver
from langgraph.checkpoint.memory import MemorySaver
In-memory checkpointer for dev/testing. Not for production.

Minimal single-node StateGraph in LangGraph 1.0.

from langgraph.graph import StateGraph, END from typing import TypedDict class State(TypedDict): messages: list def call_model(state: State): # your LLM call here return {"messages": state["messages"]} graph = StateGraph(State) graph.add_node("agent", call_model) graph.set_entry_point("agent") graph.add_edge("agent", END) app = graph.compile() result = app.invoke({"messages": [{"role": "user", "content": "hello"}]})
langgraph --version
Debug
Known issues
deprecatedlanggraph.prebuilt module deprecated in 1.0. All prebuilt functionality moved to langchain.agents.
fix
Replace from langgraph.prebuilt import create_react_agent with from langchain import create_agent
affects: < 1.0.0
breakinglanggraph-prebuilt==1.0.2 introduced a breaking signature change to ToolNode.afunc adding a required runtime parameter. langgraph==1.0.1 does not pin this dependency.
fix
Pin langgraph-prebuilt==1.0.1 explicitly or upgrade to latest langgraph
affects: 1.0.1
gotchaMemorySaver is in-memory only. State is lost on process restart. Not for production.
fix
Use langgraph-checkpoint-postgres or langgraph-checkpoint-sqlite for persistence
affects: all
gotchaLangGraph requires a compiled graph before invocation. Always call graph.compile() before graph.invoke().
fix
app = graph.compile() then app.invoke(...)
affects: all
gotchaState TypedDict must be defined before StateGraph instantiation. Missing keys raise KeyError at runtime not at definition time.
fix
Define all state keys in your TypedDict schema upfront
affects: all
gotchaTest output contains warnings and notices from the 'pip' package manager that are unrelated to the langgraph library's functionality or application-specific failures. These messages typically pertain to environmental setup (e.g., running pip as root) or general system information (e.g., pip updates).
fix
Review pip warnings for environmental issues relevant to your setup. If they do not impact the application's functionality, they may be ignored or suppressed. This is not a langgraph-specific issue.
affects: all
Errors
Common errors & fixes
AttributeError: 'StateGraph' object has no attribute 'compile'
You are attempting to use a `StateGraph` object directly for execution (e.g., calling `invoke()`, `stream()`) without first compiling it into an executable `CompiledStateGraph`.
fix
Call the `.compile()` method on your `StateGraph` instance before attempting to invoke or stream from it.

```python
from langgraph.graph import StateGraph, END

workflow = StateGraph(State)
# ... add nodes and edges ...
app = workflow.compile() # Add this line
# app.invoke(...)
```
ModuleNotFoundError: No module named 'langgraph.prebuilt'; 'langgraph' is not a package
This error often occurs when you have a local Python file or directory named `langgraph.py` or `langgraph` in your project's working directory, which shadows the installed `langgraph` package.
fix
Rename your local `langgraph.py` file or `langgraph` directory to something else (e.g., `my_langgraph_app.py`) to avoid conflicts with the installed library. Then, try your import again.
No checkpointer set
You are attempting to use state persistence features (like resuming an interrupted graph run) without configuring a checkpointer when compiling your `StateGraph`.
fix
Provide a `checkpointer` instance (e.g., `SqliteSaver`) to the `compile()` method of your `StateGraph`.

```python
from langgraph.graph import StateGraph
from langgraph.checkpoint.sqlite import SqliteSaver

memory = SqliteSaver(conn='sqlite:///graph.sqlite')

workflow = StateGraph(State)
# ... add nodes and edges ...
app = workflow.compile(checkpointer=memory)
```
Invalid parameter: messages with role 'tool' must be a response to a preceeding message with 'tool_calls'.
This error occurs when the sequence of messages in your agent's state doesn't correctly follow the tool-calling protocol, specifically when a tool output message (`role='tool'`) is not immediately preceded by an AI message containing `tool_calls`.
fix
Ensure that your graph's state updates maintain the correct conversational turn structure: an AI message with `tool_calls` must be followed by one or more tool messages responding to those specific tool calls before any other AI or human messages are added.
ImportError: cannot import name 'ServerInfo' from 'langgraph.runtime'
This error typically indicates a version incompatibility, where `langgraph-prebuilt` or another `langgraph` extension package is trying to import a symbol (`ServerInfo`) from `langgraph.runtime` that does not exist in your currently installed `langgraph` core library version.
fix
Ensure that all `langgraph` related packages (`langgraph`, `langgraph-prebuilt`, etc.) are updated to their latest compatible versions. Use `pip install -U langgraph langgraph-prebuilt` (or specific versions if a known compatible set exists).
Upgrade
Version history
1.2.11latest on PyPI · released Aug 11, 2026
Audit
Dependencies
langchainoptionalRequired for high-level agent abstractions built on LangGraph runtime.
langgraph-checkpoint-sqliteoptionalRequired for persistent checkpointing with SQLite. Use for local dev.
langgraph-checkpoint-postgresoptionalRequired for persistent checkpointing with Postgres. Use for production.
Agent activity
73 hits · last 30 days
node
70
OpenAI (training)
1
Resources
langgraph — pip install langgraph · libregistry