NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #450 most downloaded on PyPI
Building stateful, multi-actor applications with LLMs
Last release 8 days ago
21 Sep 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
10 versions withdrawn
withdrawn after publishing
3 years old
277 releases · first in 2024
fix(langgraph): use parent runtime when available
Changes since 0.6.0
These changes make it easier to maintain a higher quality public API and reduce the surface area for potential breaking changes.
We’re excited to announce the release of LangGraph v0.6.0, another significant step toward our v1.0 milestone. This release emphasizes providing a cleaner, more intuitive developer experience for building agentic workflows. Below we’ll cover the headline improvements and minor changes.
The biggest improvement in v0.6 is the introduction of the new Context API, which makes it easier to pass run-scoped context in an intuitive and type safe way.
This pattern replaces the previously recommended pattern of injecting run-scoped context into config['configurable'].
from langchain_core.runnables import RunnableConfig
from langgraph.graph import StateGraph
def node(state: State, config: RunnableConfig):
# verbose .get() access pattern for nested dicts
user_id = config.get("configurable", {}).get("user_id")
db_conn = config.get("configurable", {}).get("db_connection")
...
builder = StateGraph(state_schema=State, config_schema=Config)
# add nodes, edges, compile the graph...
# nested runtime context passed to config's configurable key
result = graph.invoke(
{'input': 'abc'},
config={'configurable': {'user_id': '123', 'db_connection': 'conn_mock'}}
)
from dataclasses import dataclass
from langgraph.graph import StateGraph
from langgraph.runtime import Runtime
@dataclass
class Context:
"""Context schema defined by the developer."""
user_id: str
db_connection: str
def node(state: State, runtime: Runtime[Context]):
# type safe access to context attributes
user_id = runtime.context.user_id
db_conn = runtime.context.db_connection
...
builder = StateGraph(state_schema=State, context_schema=Context)
# add nodes, edges, compile the graph...
# top level context arg is typed as Context for autocomplete and type checking
result = graph.invoke(
{'input': 'abc'},
context=Context(user_id='123', db_conn='conn_mock')
)
The Runtime class provides a single interface for accessing information like:
previous is also available: the previous return value for the given threadNow, instead of injecting all of the above as separate parameters to node functions,
developers can access them all through a single runtime parameter.
config_schema is deprecated in favor of context_schema, and will be removed in v2.0.0config_schemaget_config_jsonschema is deprecated in favor of get_context_jsonschema (though this is generally only used for graph introspection and not by most langgraph users)create_react_agent can now dynamically choose both the model and tools at runtime using a custom context object:
from langgraph.prebuilt import create_react_agent
@dataclass
class CustomContext:
provider: Literal["anthropic", "openai"]
tools: list[str]
def select_model(state, Runtime[Context]):
model = {
"openai": openai_model,
"anthropic": anthropic_model,
}[runtime.context.provider]
selected_tools = [
tool for tool in [weather, compass]
if tool.name in runtime.context.tools
]
return model.bind_tools(selected_tools)
agent = create_react_agent(
select_model,
# Initialize the agent with all known tools
tools=[weather, compass]
)
Then invoke the agent with your desired settings:
agent.invoke(
some_input,
context=CustomContext(provider="openai", tools=["compass"])
)
Now agents can flexibly adapt their behavior based on runtime context.
LangGraph v0.6 introduces a new durability ****argument that gives you fine-grained control over persistence behavior. This provides finer grained control than its predecessor, checkpoint_during.
This was predated
"exit" - Save checkpoint only when the graph exits
checkpoint_during=False"async" - Save checkpoint asynchronously while next step executes
checkpoint_during=True"sync" - Save checkpoint synchronously before next step
checkpoint_during is now deprecated in favor of the new durability argument. Backwards compatibility will be maintained until v2.0.0.
In an effort to make graph building easier for developers, we’ve enhanced the type safety of the LangGraph APIs.
LangGraph’s StateGraph and Pregel interfaces are now generic over a graph’s:
state_schemacontext_schemainput_schemaoutput_schemaThis means that:
invoke / stream is type checked against the relevant schemacontext available via the aforementioned Runtime class matches the context_schemaInterrupt InterfaceIn preparation for v1.0, we’ve made a few changes to the Interrupt interface.
Interrupts now have two attributes:
id - a unique identifier for the interruptvalue - the interrupt valueIn v0.6, we’ve removed the following attributes from the Interrupt class:
when - this was always "during" and offered no practical valueresumable - functionally, this is always Truens - this information is now stored in a condensed format in the id attributeinterrupt_id has been deprecated in favor of id, but is still usable for backward compatibilityGearing up for v1.0, we’ve solidified what’s public vs. private in the LangGraph API. We’ve also deprecated some old import paths that have supported backports for ~1 year.
These changes make it easier to maintain a higher quality public API and reduce the surface area for potential breaking changes.
The following table summarizes the changes:
| Old Import | New Import | Status |
|---|---|---|
from langgraph.pregel.types import ... |
from langgraph.types import ... |
⚠️ Deprecated - Will be removed in V2 |
from langgraph.constants import Send |
from langgraph.types import Send |
⚠️ Deprecated - Will be removed in V2 |
from langgraph.constants import Interrupt |
from langgraph.types import Interrupt |
⚠️ Deprecated - Will be removed in V2 |
from langgraph.channels import <ErrorClass> |
from langgraph.errors import <ErrorClass> |
❌ Removed - All errors now centralized in langgraph.errors |
from langgraph.constants import TAG_NOSTREAM_ALT |
from langgraph.constants import NOSTREAM |
❌ Removed - Deprecated constant removed |
LangGraph v0.6 represents our final major changes before the stable v1.0 release. We anticipate adhering strictly to SemVer post v1.0, leaning into a promise of stability and predictability.
LangGraph is an open source project, and we’d love to hear from you! We’ve rolled out a new LangChain forum for questions, feature requests, and discussions.
Please let us know what you think about the new Runtime API and other changes in v0.6, and if you have any difficulties with which we can help.
context API (#5566)Runtime interface re patch/overrides (#5546)constants.py -> _internal/_typing.py (#5518)config['configurable'] and config_schema) (#5243)node signatures vs input_schema for add_node (#5424)Interrupt interface for v1 (#5405)One column per month.
release: langgraph v0.6.0a2, langgraph-prebuilt v0.6.0a1
Changes since 0.6.0a1
feat(sdk-py): sdk support for context API
Changes since 0.5.4
context API (#5566)Runtime interface re patch/overrides (#5546)constants.py -> _internal/_typing.py (#5518)config['configurable'] and config_schema) (#5243)node signatures vs input_schema for add_node (#5424)Interrupt interface for v1 (#5405)feat(langgraph): Handle ParentCommand in RemoteGraph
Changes since 0.5.3
END with Command (#5601)stacklevel=2 to the warnings to point to the caller’s codes (#5457)chore[deps]: upgrade dependencies with uv lock --upgrade
Changes since 0.5.2
uv lock --upgrade (#5471)ABC spec for PregelProtocol (#5485)patch[langgraph]: Fix hint for invoke/stream to allow for Command and None
Changes since 0.5.1
invoke/stream to allow for Command and None (#5414)langgraph[fix]: remove deprecated pydantic logic + fix schema gen behavior for typed dicts
Changes since 0.5.0
The old names still work but raise a deprecation warning.
TL;DR – 0.5 is not a radical rewrite, but a scrub-down and tune-up of the LangGraph core.
APIs are a little stricter, you have more control over streaming, checkpoints are lighter, etc. 99 % of users can upgrade with nothing more than a pip install --upgrade langgraph==0.5.*.
The team’s next big milestone is a 1.0 release in a few months.
To get there we needed to:
0.5 is that housekeeping release.
state_schema is now mandatory.
“Untyped” graphs were never shown in the docs and produced surprising runtime errors. Requiring an explicit schema fixes that class of bugs and improves static analysis.
input/output → input_schema/output_schema
The old names still work but raise a deprecation warning.
graph = StateGraph(
state_schema=MyState,
input_schema=UserQuery,
output_schema=AssistantResponse,
)
New NodeBuilder utility
A simpler, declarative way to create nodes and attach them to channels. The old Channel.subscribe_to helper keeps working but will be removed in 1.0.
stream_mode="debug" is now an alias for the pair["tasks", "checkpoints"]. You can now turn them on individually:graph.stream(stream_mode="tasks") # only task-level updates
graph.stream(stream_mode="checkpoints") # only checkpoint deltas
This makes it cheaper to subscribe only to the information you need.
JsonPlusSerializer now handles NumPy arrays stored in your state (including Fortran-ordered ones) without falling back to pickle.state_schema required – add it if you were passing only input and output schemas instead (very rare).input / output renaming – rename to input_schema / output_schema.PregelNode and Runnable, drop the latter.Nothing else should require code changes.
pip install -U "langgraph>=0.5"
If you maintain a plugin / custom checkpointer, run your test suite once; the public interfaces are untouched.
We’re hard at work on LangGraph 1.0, chime in here with any comments, feedback or questions, we want to hear from everyone.
MessageGraph (#4875)"output usage in favor of output_schema (#5095)PregelNode's inheritance from Runnable (#5093)input and output in favor of input_schema and output_schema (#4983)pep 604 union syntax and pep 585 generic syntax (#4963)StateGraph(dict) (#4964)retry -> retry_policy (#4957)init and invoke/stream (#4932)state_schema in StateGraph.__init__ (#4897)MessageGraph (#4875)Changes since 0.5.0rc0 * langgraph 0.5.0rc1
Changes since 0.5.0rc0
fix(langgraph): remove deprecated output usage in favor of output_schema
Changes since 0.4.8
output usage in favor of output_schema (#5095)PregelNode's inheritance from Runnable (#5093)input and output in favor of input_schema and output_schema (#4983)pep 604 union syntax and pep 585 generic syntax (#4963)StateGraph(dict) (#4964)retry -> retry_policy (#4957)init and invoke/stream (#4932)state_schema in StateGraph.__init__ (#4897)fix(langgraph): remove deprecated output usage in favor of output_schema
Changes since 0.4.9
MessageGraph (#4875)"output usage in favor of output_schema (#5095)PregelNode's inheritance from Runnable (#5093)input and output in favor of input_schema and output_schema (#4983)pep 604 union syntax and pep 585 generic syntax (#4963)StateGraph(dict) (#4964)retry -> retry_policy (#4957)init and invoke/stream (#4932)state_schema in StateGraph.__init__ (#4897)MessageGraph (#4875)Revert change to default value of checkpoint_during arg
Changes since 0.5.0rc1
Remove unused deprecation decorator/warning
Changes since 0.4.7
state_schema in StateGraph.__init__ (#4897)MessageGraph (#4875)Fix stream mode not respected in subgraphs
Changes since 0.4.6
Fix exception handling for imperative tasks
Changes since 0.4.5
messages / message-tuple stream (#4722)messages / message-tuple streamImprove how we match cached writes for async imperative tasks
Changes since 0.4.4
langgraph: fix drawing graph with __root__ channel
Changes since 0.4.3
langgraph: use tuples for streamed message events in RemoteGraph
Changes since 0.4.2
langgraph: decouple name from assistant ID in RemoteGraph
Changes since 0.4.1
Fixed an issue handling END in StateGraph edges to properly terminate graph execution #4458
END in StateGraph edges to properly terminate graph execution #4458merge parameter #4473TAG_NOSTREAM from "langsmith:nostream" to "nostream", maintaining backwards compatibility #4473push_ui_message #4467END constant in get_writes and _control_static functions, ensuring proper graph termination when returning to END #4458merge parameter to push_ui_message function, allowing incremental updates to UI messages #4473ui_message_reducer to support merging props from existing messages when the merge flag is set #4473push_ui_message by removing old metadata merging which could cause unexpected behavior #4467TAG_NOSTREAM from "langsmith:nostream" to "nostream" #4473TAG_NOSTREAM_ALT with the old value ("langsmith:nostream") for backward compatibility #4473SchemaCoercionMapper #4448lru_cache for better performance #4448Added improved support for interrupt handling in streaming modes, with interrupts now properly propagated in "values" stream mode #4374
"values" stream mode #4374interrupt_id property that generates a unique ID for the interrupt based on its namespace #4406| as a separator between namespace elements for better uniqueness #4406"values" mode emits all values including interrupts after each step #4374interrupts field to track interrupts that occurred in a step and are pending resolution #4406resume parameter to support mapping interrupt IDs to resume values #4406resume parameter #4406invoke and ainvoke methods to properly collect and handle interrupts in streamed output #4374"values" and "updates" stream modes #4374Fixed handling of interrupts in nested graph execution by properly marking tasks with execution context information #4389
_output_writes to check task path context before emitting interrupts #4389path[0] == PUSH and path[-1] is True (indicating a call context), interrupts are not emitted as they'll be handled by the parentcopy method to properly drop cached properties when copying nodes #4389flat_writers, node, and input_cache_key cached properties to ensure proper initialization of the copied node_sanitize_config method to use the new sanitize_config_value function #4389Nothing published for this version
Fixed SchemaCoercionMapper to properly handle Pydantic models with validators
draw_graph functionality (#4354)model_validate instead of model_constructget_static_writes method to support static analysis of what a writer might write (#4354)register_writer to accept static declarations for writersChannelWriteTupleEntry to declare writes for static analysis_assemble_writes function for better code organizationdraw_graph function that simulates execution to discover edges_find_and_emit_messages (#4379)Improved thread ID handling in checkpointing and state management for more reliable concurrent execution
get_state, aget_state) to properly handle thread IDsImproved streaming support for Command objects by properly handling unwrapping in responses #4250
Command objects by properly handling unwrapping in responses #4250Command objects in streaming responses by extracting the .update value #4250Command objects to be used more seamlessly in streaming contexts, both as individual responses and when contained in sequences_get_updates function to use the new get_update_as_tuples utility, reducing code duplication #4255_update_as_tuples method to use the new centralized utility function #4255Performance optimizations for StateGraph and Pregel execution
schema_to_mapper dictionary to avoid recreating schema mappers repeatedly (#4242)input_cache_key property for efficient input caching (#4242)_proc_input to return a value directly instead of being an iterator (#4242)Added support for multiple retry policies, where the first matching policy will be applied when an exception occurs #4240
functools.lru_cache to avoid redundant processingadd_node to support sequences of retry policies, with documentation for how multiple policies are applied #4240_get_updates to correctly detect Pydantic model field sets based on their version #4200_should_retry_on helper function to determine if a policy applies to a specific exceptiondefault_retry_on function with optimized ordering of HTTP error checks for better performancePregelExecutableTask.retry_policy type to support sequences of policies #4240Added a new checkpoint_during parameter to control when checkpoints are created, allowing users to optimize graph execution performance by only checkp
checkpoint_during parameter to control when checkpoints are created, allowing users to optimize graph execution performance by only checkpointing at the end of a run (PR #4169)checkpoint_during parameter to stream(), astream(), invoke() and ainvoke() methods. When set to False, the graph only creates a checkpoint at the end of execution rather than after each step, which can improve performance for large graphs (PR #4169)_StreamingCallbackHandler is not available, making the library more robust (PR #4203)checkpoint_every_step to checkpoint_during for clearer semantics (PR #4169)_put_pending_writes() to handle persisting writes when checkpointing is deferred (PR #4169)orjson in favor of strict type checking (PR #4205)CONF_DROPLIST to exclude internal configuration keys from being serialized (PR #4205)_StreamingCallbackHandler to improve robustness when the class is not available (PR #4203)Fixed an issue where GraphInterrupt exceptions were raised unnecessarily in remote graph streaming when no caller namespace was present
GraphInterrupt exceptions were raised unnecessarily in remote graph streaming when no caller namespace was present (#4202)GraphInterrupt exceptions in the stream and astream methods when a caller namespace is present, preventing unnecessary interrupts in certain streaming contexts (#4202)Added new UI messaging system for LangGraph, enabling developers to send and manage UI component updates during graph execution
UIMessage TypedDict to represent UI component updates with properties and metadata (#4157)RemoveUIMessage TypedDict for removing UI components from the current state (#4157)AnyUIMessage Union type combining both message types (#4157)push_ui_message() function to create and send UI messages for rendering components (#4157)delete_ui_message() function to remove UI components by ID (#4157)ui_message_reducer() function to merge UI message lists, handling both additions and removals (#4157)Added checkpoint migration mechanism to ensure backward compatibility with older checkpoint formats
_migrate_checkpoint method to handle migrating between different checkpoint formats (#4125)start:node, branch:source:condition:node, or just node) to the new unified format branch:to:node (#4125)_migrate_checkpoint method to support checkpoint migration (#4125)Added a special REMOVE_ALL_MESSAGES identifier to allow clearing all messages in a MessageGraph conversation in one operation #4117
REMOVE_ALL_MESSAGES identifier to allow clearing all messages in a MessageGraph conversation in one operation #4117empty_checkpoint function from being imported from a base module to being defined in the pregel checkpoint module #4126REMOVE_ALL_MESSAGES constant identifier ("__remove_all__")RemoveMessage with this special ID is includedlanggraph.checkpoint.base to being directly defined in langgraph.pregel.checkpointLATEST_VERSION = 2 in the same moduleImproved error display by removing internal frames from tracebacks, making it easier to identify the actual source of errors
copy() method to all channel classes for more efficient state copying, improving performance (#4106)LazyAtomicCounter implementation (#4101)destinations parameter in StateGraph.add_node() (#4053)PregelScratchpad (#4098)StateGraph edge handling for better consistency (#4064)copy() method to all channel classes for more efficient state copying (#4106)MISSING constant instead of None (#4103)Optional types where appropriatePregelScratchpad to improve thread safetycopy() method instead of creating checkpoints, significantly improving performance (#4106)destinations parameter in add_node() to correctly support tuples with multiple strings (#4053)Added a warning and early return when attempting to add an edge between non-existent nodes in Graph
Graph (#4021)Interrupt objects from the received data (#4040)update method in Topic channel from None to bool (#4029)Interrupt objects from the received data, ensuring proper serialization/deserialization of interrupts (#4040)update method from None to bool to align with the interface of other channel types (#4029)Replaced msgpack dependency with ormsgpack for improved serialization performance #3953
msgpack dependency with ormsgpack for improved serialization performance #3953add_edge method to log a warning and continue execution instead of raising a ValueError when a subgraph has a missing entrypoint #3997_xxhash_str from xxh3_64_hexdigest to xxh3_128_hexdigest for better collision resistance when generating UUIDs #4005msgpack with ormsgpack (version 1.8.0+) dependency for faster and more efficient MessagePack serialization #3953Added significant performance optimization for node execution by only triggering nodes dependent on updated channels (#3916, #3931)
trigger_to_nodes and updated_channels to support the optimization (#3916)trigger_to_nodes property to store mapping from triggers to dependent nodes (#3931)validate method to compute trigger_to_nodes mapping (#3931)tick and _first methods to track and pass updated channels information (#3916)subgraphs parameter to directly specify subgraphs instead of extracting them from bound runnable (#3949)copy method to properly handle subgraphs (#3949)writers.append() instead of |= operator (#3949)func_accepts_config parameter to explicitly control whether a function accepts config parameter (#3949)Improved memory usage in task execution by using weak references for task objects
NamedTuple to dataclass to support weak references (#3924)weakref_slot=True for Python 3.11+ to reduce memory footprint during execution_call and _acall methods to properly handle weak references to tasksdataclasses.replace() instead of _replace() to be compatible with the new task implementation (#3924)set_config_context context manager for better context handling (#3922)Added new bulk state update functionality for more efficient sequential state updates
bulk_update_state and abulk_update_state methods to allow applying multiple updates to a graph state in sequence (#3737)update_state and aupdate_state methods to use the new bulk update functionality (#3737)StateUpdate type as a NamedTuple with fields values and as_node to represent individual state updates (#3737)Improved schema coercion with better error handling and type compatibility, increasing default max depth and adding support for set types
get_function_nonlocals to reduce external dependencies (#3894)max_depth from 5 to 12, allowing deeper nested schema structuresset types in schema coercionweakref.WeakMethod for runner callbacks_call and _acall)get_function_nonlocals functionNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →