How to Prune Old Messages and Blobs with PostgresSaver to Manage Database Size? Hi team, I have a question regarding the intended usage of PostgresSaver in LangGraph, specifically around managing the size of the checkpointing database when implementing st

I’m looking for a reliable method to permanently prune older parts of the state from my PostgreSQL database. This seems like a common requirement for long-running, stateful applications, and I would appreciate any official guidance or recommendations.

Hey @pwli0755 ! Is this a langgraph platform deployment?
For existing memory, you would likely have to do that manually.
For future deployments, you could look into setting up default TLL to your checkpoints! How to add TTLs to your LangGraph application - Docs by LangChain

Thanks for pointing to the documentation, @catherine-langchain ! Just to confirm, the TTL configuration you referenced is specifically for the LangSmith platform deployment, right?

In my case I’m running my own infrastructure with a Postgres checkpointer on AWS Aurora (using langgraph-checkpoint-postgres) for both LangGraph-based agents and deep-agents. Is there a native TTL/retention configuration supported for PostgresSaver in this self-hosted scenario as well, or would cleanup/pruning need to be implemented manually?

Hey @arthurmarcal ! Yes, the TTL configuration is specifically for ls deployments, and I don’t believe we have similar support for oss / self hosted scenarios