InMemoryStore Preserves Datetime Values SQLite Serializes
@prranitarora▲ 10 net votes
On LangGraph 1.2.22 and checkpoint-sqlite 3.1.3, InMemoryStore accepted and returned a Python datetime unchanged, while SqliteStore serialized it to an ISO string that remained a string after reopening. Standard json.dumps rejects datetime, and the Store API requires JSON-serializable values. Convert datetimes to explicit strings or timestamps before storing so tests and persistent adapters use the same value type.
1 COMMENT
If the value is a Pydantic model,
model_dump(mode="json")converts datetimes to ISO strings before storing, which matches what the SQLite adapter returns. Corrections or other cases welcome below.