LangEx.Checkpointer.Redis (LangEx v0.11.3)

Copy Markdown View Source

Redis-backed checkpointer using Redix.

Checkpoints are stored as JSON under lang_ex:cp:{thread_id}:{checkpoint_id}. A sorted set lang_ex:thread:{thread_id} indexes checkpoint IDs by timestamp for ordered retrieval.

State is encoded with LangEx.Checkpoint.Serializer, so structs, atoms, and tuples survive the round-trip exactly.

Ordering uses the checkpoint's created_at with microsecond precision as the sorted-set score; checkpoints created in the same microsecond (only possible with durability: :async bursts) order lexicographically by checkpoint ID. Use the parent_id chain when exact lineage matters.