Unable to pass serde to PostgresSaver in langgraph.checkpoint.postgres via function from_conn_string
Checked other resources
- This is a bug, not a usage question.
- I added a clear and descriptive title that summarizes this issue.
- I used the GitHub search to find a similar question and didn't find it.
- I am sure that this is a bug in LangGraph rather than my code.
- The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package).
- This is not related to the langchain-community package.
- I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.
Related Issues / PRs
When using AyncPostgresSaver fromlanggraph.checkpoint.postgres.aio, users can pass serde to from_conn_string function but unable to pass serde to PostgresSaver in langgraph.checkpoint.postgres via function from_conn_string.
The fix is simple keep an argument in from_conn_string function 'serde' and pass it to cls instance as its being returned.
Reproduction Steps / Example Code (Python)
from langgraph.checkpoint.postgres import PostgresSaver
conn_str = 'example_conn_str'
serde = {}
with PostgresSaver.from_conn_string(conn_string=conn_string, serde=serde) as checkpointer:
passError Message and Stack Trace (if applicable)
Description
I'm trying to pass serde to from_conn_string in the PostgresSaver it simply does not accept the serde argument.
System Info
System Information
OS: Linux OS Version: #139-Ubuntu SMP PREEMPT_DYNAMIC Sat Aug 1 03:52:05 UTC 2026 Python Version: 3.11.15 (main, Mar 11 2026, 17:20:07) [GCC 14.3.0]
Package Information
langchain_core: 1.4.0 langchain: 1.3.2 langchain_community: 0.4.1 langsmith: 0.7.22 langchain_classic: 1.0.4 langchain_deepseek: 1.1.0 langchain_gemini: 0.1.1 langchain_openai: 1.1.14 langchain_openrouter: 0.2.3 langchain_protocol: 0.0.16 langchain_text_splitters: 1.1.2 langgraph_api: 0.7.89 langgraph_cli: 0.4.26 langgraph_runtime_inmem: 0.26.0 langgraph_sdk: 0.3.12
Optional packages not installed
deepagents deepagents-cli
Other Dependencies
aiohttp: 3.13.5 blockbuster: 1.5.26 click: 8.4.2 cloudpickle: 3.1.2 croniter: 6.2.2 cryptography: 46.0.5 dataclasses-json: 0.6.7 grpcio: 1.78.0 grpcio-health-checking: 1.78.0 grpcio-tools: 1.78.0 httpx: 0.28.1 httpx-sse: 0.4.3 jsonpatch: 1.33 jsonschema-rs: 0.44.1 langgraph: 1.2.2 langgraph-checkpoint: 4.1.1 numpy: 2.3.5 openai: 2.32.0 openrouter: 0.9.1 opentelemetry-api: 1.40.0 opentelemetry-exporter-otlp-proto-http: 1.40.0 opentelemetry-sdk: 1.40.0 orjson: 3.11.7 packaging: 26.2 pathspec: 1.1.1 protobuf: 6.33.6 pydantic: 2.12.5 pydantic-settings: 2.14.0 pyjwt: 2.12.1 python-dotenv: 1.2.2 PyYAML: 6.0.2 pyyaml: 6.0.2 requests: 2.34.2 requests-toolbelt: 1.0.0 rich: 15.0.0 SQLAlchemy: 2.0.49 sqlalchemy: 2.0.49 sse-starlette: 3.3.3 starlette: 1.0.0 structlog: 25.5.0 tenacity: 9.1.4 tiktoken: 0.12.0 truststore: 0.10.4 typing-extensions: 4.15.0 uuid-utils: 0.14.1 uvicorn: 0.42.0 watchfiles: 1.1.1 websockets: 16.0 wrapt: 2.2.2 xxhash: 3.6.0 zstandard: 0.25.0
Source: langchain-ai/langgraph