Configuration for the built-in serde, which handles checkpointing of state.
If omitted, no serde is set up (the object store will still be present, however).
SerdeConfig()Optional. List of allowed python modules to de-serialize custom objects from JSON.
If provided, only the specified modules will be allowed to be deserialized. If omitted, no modules are allowed, and the object returned will simply be a json object OR a deserialized langchain object.
Example: {... "serde": { "allowed_json_modules": [ ["my_agent", "my_file", "SomeType"], ] } }
If you set this to True, any module will be allowed to be deserialized.
Example: {... "serde": { "allowed_json_modules": True } }
Optional. List of allowed python modules to de-serialize custom objects from msgpack.
Known safe types (langgraph.checkpoint.serde.jsonplus.SAFE_MSGPACK_TYPES) are always allowed regardless of this setting. Use this to allowlist your custom Pydantic models, dataclasses, and other user-defined types.
If True (default), unregistered types will log a warning but still be deserialized. If None, only known safe types will be deserialized; unregistered types will be blocked.
Example - allowlist specific types (no warnings for these): {... "serde": { "allowed_msgpack_modules": [ ["my_agent.models", "MyState"], ] } }
Example - strict mode (only safe types allowed): {... "serde": { "allowed_msgpack_modules": null } }
Optional. Whether to allow pickling as a fallback for deserialization.
If True, pickling will be allowed as a fallback for deserialization. If False, pickling will not be allowed as a fallback for deserialization. Defaults to True if not configured.