# TTL strategies — sliding TTL and a per-thread checkpoint cap?

**URL:** <https://forum.langchain.com/t/ttl-strategies-sliding-ttl-and-a-per-thread-checkpoint-cap/4622>\
**Category:** LangSmith Product Help\
**Created:** [September 28, 2026, 5:30pm UTC](https://forum.langchain.com/t/ttl-strategies-sliding-ttl-and-a-per-thread-checkpoint-cap/4622 "2026-09-28T17:30:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![santosh-nallur](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/santosh-nallur/32/3178_2.png) [@santosh-nallur](https://forum.langchain.com/u/santosh-nallur)\
**Post date:** [September 28, 2026, 5:30pm UTC](https://forum.langchain.com/t/ttl-strategies-sliding-ttl-and-a-per-thread-checkpoint-cap/4622/1 "2026-09-28T17:30:31Z")

</div>

Hi team,

I’ve been working through the thread/checkpoint TTL model on LangGraph Platform (`checkpointer.ttl` in `langgraph.json`, plus per-thread `ttl` via the Threads API) and I’ve read the existing threads on this — [Checkpoint cleanup (#3037)](https://forum.langchain.com/t/checkpoint-cleanup/3037), [How to handle growing checkpoint blob (#4448)](https://forum.langchain.com/t/how-to-handle-growing-checkpoint-blob/4448), [configuring TTL via env vars (#4253)](https://forum.langchain.com/t/how-to-configure-thread-checkpointer-ttl-when-deploying-the-langgraph-server-with-docker-using-environment-variables/4253), and the [keep\_latest pruning proposal (#4291)](https://forum.langchain.com/t/proposal-add-safe-keep-latest-pruning-to-postgressaver/4291).  
Also the official docs on [configure ttl](https://docs.langchain.com/langsmith/configure-ttl)

Those cover the pieces individually, but I couldn’t find one place that ties together how TTL is supposed to coexist with **human-in-the-loop (HITL) _and_ replay/time-travel debugging**. I want to confirm my understanding and raise two potential feature-shaped questions.

## **My understanding (please correct)**

- **`delete`** : at expiry, the entire thread (runs + all checkpoints + blobs + writes) is removed. The timer is **absolute** — it starts when the TTL is applied and does **not** refresh on activity.

- **`keep_latest`** : here the docs are genuinely ambiguous to me. I can read it two ways:

The rest of this post assumes **Interpretation A**.

If that’s right, then:

## **1. HITL + replay seem to be in tension under any single strategy**

- `keep_latest` preserves the latest checkpoint → **HITL survives** , but it prunes the older checkpoints that **replay/time-travel/debug** depend on.
- `delete` keeps the full chain (so replay works) but only until the absolute deadline, after which **both** HITL and replay are gone.

So it looks like there’s **no strategy that supports HITL + full replay history beyond the TTL window** — you must size `delete` to cover your entire replay/debug horizon, or disable TTL and manage growth manually. **Is that the intended model?** Is there a recommended pattern for “keep the latest for continuity/HITL, but retain the last N checkpoints (not just 1) for replay”?

## **2. Is there a sliding TTL for `delete`?**

For long-running conversations that stay active for many days, `delete` will remove an _active_ thread at the deadline regardless of activity. Today the workarounds I see are:

- switch to `keep_latest` (loses replay history), or
- `PATCH /threads/{id}` with a fresh relative `ttl` on each activity to roll the window myself, or
- set a very large `default_ttl` upfront.

**Is application-managed `PATCH` the blessed way to get a sliding `delete` TTL?** Or is an activity-refreshing option for `delete` on the roadmap?

## **3. No count-based cap on checkpoints per thread?**

There’s a time-based prune (`keep_latest`) but no `max_checkpoints_per_thread` style cap. For long threads under a large TTL, checkpoints accumulate until the sweeper acts. Two asks:

- A **count-based retention** (“keep last N checkpoints per namespace”) would serve replay + bounded growth better than keep-exactly-1.
- Separately, even with `keep_latest`, each surviving blob still holds the **entire message history** (raised in #4448). Is `ReducingSaver` / state-level trimming the recommended answer for blob-size growth, or is there platform-level guidance?

Thanks in advance — mainly want to confirm the HITL-vs-replay tradeoff is by design and hear the recommended production pattern.

---

<div class="post-metadata">

**Author:** ![memorysync](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@memorysync](https://forum.langchain.com/u/memorysync)\
**Post date:** [October 28, 2026, 3:35pm UTC](https://forum.langchain.com/t/ttl-strategies-sliding-ttl-and-a-per-thread-checkpoint-cap/4622/2 "2026-10-28T15:35:23Z")

</div>

Not staff, but here’s what the current docs ([How to add TTLs to your application - Docs by LangChain](https://docs.langchain.com/langsmith/configure-ttl)) and SDK say on each point:

**keep\_latest, A vs B.** The docs describe `keep_latest` as: “Retains the thread and latest checkpoint, but deletes older checkpoint data that subsequent runs won’t need”, and say “The `keep_latest` window refreshes when a run finishes or thread state is updated.” That reads as your Interpretation A (the thread is kept, and older checkpoints are pruned). The page doesn’t spell out the “thread survives forever” part in so many words, though, so it’s worth a staff confirmation.

**Sliding TTL for `delete`.** The same page says: “The `delete` window starts when the TTL is applied and does not refresh with activity.” So there’s no built-in sliding `delete`. Re-applying a TTL yourself is the workable route: `client.threads.update(thread_id, ttl=...)` in the Python SDK accepts the same `ttl` (int minutes, or a mapping with `ttl` and `strategy`) as `threads.create`. Calling it after each run gives you a rolling window. That’s my reading of the SDK signature; I haven’t confirmed that an update resets an already-running `delete` timer, so test it on a short TTL first.

**HITL + replay.** Yes, with a single strategy that tension is real. A pattern that avoids it: keep `keep_latest` for continuity/HITL, and for the threads you might need to debug, copy the history out before it’s pruned (`client.threads.get_history(...)` into your own storage or a LangSmith trace you keep). Replay then works from your copy instead of relying on the live checkpoint chain.

**Count-based cap / blob size.** In the OSS savers, `prune()` only offers `keep_latest` and `delete` strategies today (see `BaseCheckpointSaver.prune` and the Postgres implementation), so “keep last N” would be a feature request. For blob size, `keep_latest` doesn’t help, because the surviving checkpoint still holds the whole `messages` channel. Bounding the message list (`trim_messages` / `RemoveMessage`, or summarization) is what actually caps it, as discussed in #4448.

(All untested on a live deployment; based on the docs and SDK source.)
