Skip to content

0.2.24

Choose a tag to compare

@github-actions github-actions released this 23 Sep 15:34

langgraph 0.2.24

Summary of Changes

  • Introduced a new langgraph.types module containing important data types including Send and Interrupt which were moved from constants.py for better organization
  • Added detection and prevention of multiple subgraphs being called inside the same node with a new MultipleSubgraphsError
  • Simplified the managed values system by refactoring ManagedValueMapping to a simple type alias
  • Improved configuration system with better key handling, using constants instead of string literals
  • Optimized memory usage by applying sys.intern() to frequently used string constants

Detailed Changes

langgraph.types

  • Created a new module containing important data types and classes
  • Moved Send and Interrupt classes from constants.py to this module (they're still re-exported from constants for backward compatibility)
  • Improved type definitions for Checkpointer, StreamMode, RetryPolicy, and other core types
  • Better organized type definitions for improved code organization and readability

langgraph.errors.MultipleSubgraphsError

  • Added a new exception type to detect and prevent multiple subgraphs from being called inside the same node
  • Introduced _SEEN_CHECKPOINT_NS tracking mechanism to detect when this scenario occurs
  • Improved error documentation for various error types to make troubleshooting easier

langgraph.managed.base.ManagedValueMapping

  • Simplified from a custom class with complex behavior to a straightforward type alias (dict)
  • Removed runtime placeholder functionality which was previously used for managing runtime values

langgraph.pregel.loop.PregelLoop

  • Added subgraph detection to prevent problematic multiple subgraph execution
  • Standardized configuration key usage across both synchronous and asynchronous implementations
  • Improved error handling for better debuggability

langgraph.pregel.algo

  • Simplified the local_write function by removing unnecessary parameters
  • Enhanced documentation throughout the module for better clarity
  • Added better validation for Send objects in Pregel tasks

langgraph.constants

  • Most constants now use sys.intern() to optimize memory usage
  • Added new constants like EMPTY_MAP, EMPTY_SEQ for reusable empty collections
  • Reorganized RESERVED for better clarity with logical groupings

langgraph.utils.config

  • Replaced string literals with constants for configuration keys
  • Improved config merging and patching functionality
  • Standardized config handling across the codebase