langchain-ai/langgraph · error · NotImplementedError

Unknown serialization type

Error message

Unknown serialization type: {type_}

What it means

Dispatch failure in JsonPlusSerializer.loads_typed: the type tag stored alongside the serialized payload is not one of the recognized kinds ('null', 'bytes', 'bytearray', 'json', 'msgpack', or 'pickle' when pickle_fallback is enabled). This indicates the payload was written by a different/incompatible serializer version or hand-crafted, or a pickle tag was sent while pickle_fallback=False.

Solutions

  1. Ensure the same langgraph-checkpoint version wrote and reads the checkpoint
  2. Enable pickle fallback (pickle_fallback=True) if the tag is 'pickle' and the data is trusted
  3. Re-create or migrate the stored payload instead of decoding data from an unknown source
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py:290 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26). Data as JSON: /api/errors/309b8ae833428fa2. Report an issue: GitHub.

Appendix: source

Thrown at libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py:290

    def loads_typed(self, data: tuple[str, bytes]) -> Any:
        type_, data_ = data
        if type_ == "null":
            return None
        elif type_ == "bytes":
            return data_
        elif type_ == "bytearray":
            return bytearray(data_)
        elif type_ == "json":
            return json.loads(data_, object_hook=self._reviver)
        elif type_ == "msgpack":
            return ormsgpack.unpackb(
                data_, ext_hook=self._unpack_ext_hook, option=ormsgpack.OPT_NON_STR_KEYS
            )
        elif self.pickle_fallback and type_ == "pickle":
            return pickle.loads(data_)
        else:
            raise NotImplementedError(f"Unknown serialization type: {type_}")


# --- msgpack ---

EXT_CONSTRUCTOR_SINGLE_ARG = 0
EXT_CONSTRUCTOR_POS_ARGS = 1
EXT_CONSTRUCTOR_KW_ARGS = 2
EXT_METHOD_SINGLE_ARG = 3
EXT_PYDANTIC_V1 = 4
EXT_PYDANTIC_V2 = 5
EXT_NUMPY_ARRAY = 6
EXT_DELTA_SNAPSHOT = 7


def _msgpack_default(obj: Any) -> str | ormsgpack.Ext:
    if isinstance(obj, _DeltaSnapshot):
        return ormsgpack.Ext(EXT_DELTA_SNAPSHOT, _msgpack_enc(obj.value))
    elif hasattr(obj, "model_dump") and callable(obj.model_dump):  # pydantic v2

View on GitHub (pinned to 38031739e5)