LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph-clischemasSerdeConfig
    Class●Since v0.4

    SerdeConfig

    Copy
    SerdeConfig()

    Bases

    TypedDict

    Constructors

    Attributes

    View source on GitHub
    constructor
    __init__
    NameType
    allowed_json_moduleslist[list[str]] | bool | None
    allowed_msgpack_moduleslist[list[str]] | bool | None
    pickle_fallbackbool
    attribute
    allowed_json_modules: list[list[str]] | bool | None

    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 } }

    attribute
    allowed_msgpack_modules: list[list[str]] | bool | None

    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 } }

    attribute
    pickle_fallback: bool

    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.

    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).