Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
0.6.0 source code.tar.gz | 2025-07-28 | 59.2 MB | |
0.6.0 source code.zip | 2025-07-28 | 59.7 MB | |
README.md | 2025-07-28 | 7.9 kB | |
Totals: 3 Items | 118.9 MB | 0 |
LangGraph v0.6
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.
🚀 New Context API: Simplified Runtime Context Injection
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']
.
Before (v0.5):
:::python
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'}}
)
After (v0.6):
:::python
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:
- context: static data passed at the start of a run
- store: storage mechanism for long term memories
- stream_writer: custom function for writing to the graph’s output stream
- for functional API users,
previous
is also available: the previous return value for the given thread
Now, instead of injecting all of the above as separate parameters to node functions,
developers can access them all through a single runtime
parameter.
Migration Path
config_schema
is deprecated in favor ofcontext_schema
, and will be removed in v2.0.0- The new API maintains backward compatibility for existing code
- Gradual migration is supported with deprecation warnings for
config_schema
get_config_jsonschema
is deprecated in favor ofget_context_jsonschema
(though this is generally only used for graph introspection and not by most langgraph users)
🏗️ Durability Mode Support
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
- Choose between three durability modes:
"exit"
- Save checkpoint only when the graph exits- equivalent to
checkpoint_during=False
- Least durable, fastest
- equivalent to
"async"
- Save checkpoint asynchronously while next step executes- equivalent to
checkpoint_during=True
- Moderately durable, mid speed
- equivalent to
"sync"
- Save checkpoint synchronously before next step- New!
- Highly durable, slowest
Migration Path
checkpoint_during
is now deprecated in favor of the new durability
argument. Backwards compatibility will be maintained until v2.0.0.
🛡️ Enhanced Type Safety and Validation
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_schema
context_schema
input_schema
output_schema
This means that:
- Node signatures are type checked at graph creation time
- Input to
invoke
/stream
is type checked against the relevant schema context
available via the aforementionedRuntime
class matches thecontext_schema
🔧 A Refined Interrupt
Interface
In 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 value
In 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 alwaysTrue
ns
- this information is now stored in a condensed format in theid
attributeinterrupt_id
has been deprecated in favor ofid
, but is still usable for backward compatibility
🔒 Solidified Public API Surface
Gearing 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 |
N/A | ❌ Removed - Deprecated constant removed |
🎯 Looking Toward v1.0
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.
Get Involved
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.
Full Changelog
- feat(sdk-py): sdk support for
context
API (#5566) - feat(langgraph): Implement durability mode argument (#5432)
- refactor(langgraph): improve
Runtime
interface re patch/overrides (#5546) - refactor(langgraph): make constants generally private with a few select exports (#5529)
- refactor(langgraph): move private typing constructs in
constants.py
->_internal/_typing.py
(#5518) - feat(langgraph): new context api (replacing
config['configurable']
andconfig_schema
) (#5243) - feat(langgraph): add type checking for matching
node
signatures vsinput_schema
foradd_node
(#5424) - change[langgraph]: clean up
Interrupt
interface for v1 (#5405) - langgraph[change]: solidify public/private differentiations (#5252)