Change8

0.6.0

Breaking Changes
📦 langgraphView on GitHub →
3 breaking6 features6 deprecations🔧 9 symbols

Summary

LangGraph v0.6 introduces a new type-safe Context API and Runtime class to replace manual config injection, alongside a new durability mode for fine-grained persistence control. This release solidifies the public API and enhances type safety across graph schemas in preparation for the v1.0 milestone.

⚠️ Breaking Changes

  • Removed 'when', 'resumable', and 'ns' attributes from the Interrupt class.
  • Removed error classes from 'langgraph.channels'; all errors are now centralized in 'langgraph.errors'.
  • Removed 'TAG_NOSTREAM_ALT' from 'langgraph.constants' (replaced by 'NOSTREAM').

Migration Steps

  1. Replace 'config_schema' with 'context_schema' in StateGraph definitions.
  2. Update node functions to accept 'runtime: Runtime[Context]' instead of accessing 'config['configurable']'.
  3. Pass runtime data to 'invoke' or 'stream' using the 'context' keyword argument instead of 'config'.
  4. Update 'checkpoint_during' arguments to the new 'durability' enum ('exit', 'async', or 'sync').
  5. Update import paths for 'Send', 'Interrupt', and error classes to 'langgraph.types' and 'langgraph.errors' respectively.
  6. Update code referencing 'Interrupt.interrupt_id' to use 'Interrupt.id'.

✨ New Features

  • New Context API for type-safe runtime context injection via the Runtime class.
  • Added 'context_schema' to StateGraph for defining static run-scoped data.
  • Dynamic model and tool selection in 'create_react_agent' using runtime context.
  • New 'durability' mode supporting 'sync' (synchronous checkpointing), 'async', and 'exit'.
  • Enhanced type safety: StateGraph and Pregel are now generic over state, context, input, and output schemas.
  • Refined Interrupt interface with unique 'id' and 'value' attributes.

🔧 Affected Symbols

StateGraphPregelRuntimecreate_react_agentInterruptSendlanggraph.errorslanggraph.typesget_context_jsonschema

⚡ Deprecations

  • config_schema is deprecated in favor of context_schema.
  • get_config_jsonschema is deprecated in favor of get_context_jsonschema.
  • checkpoint_during is deprecated in favor of the durability argument.
  • interrupt_id is deprecated in favor of id.
  • Importing from 'langgraph.pregel.types' is deprecated (use 'langgraph.types').
  • Importing 'Send' or 'Interrupt' from 'langgraph.constants' is deprecated (use 'langgraph.types').