diff --git a/src/langsmith/configure-ttl.mdx b/src/langsmith/configure-ttl.mdx index 58ce028c33..c908b13efe 100644 --- a/src/langsmith/configure-ttl.mdx +++ b/src/langsmith/configure-ttl.mdx @@ -2,6 +2,7 @@ title: How to add TTLs to your application sidebarTitle: Add TTLs to your application --- + **Prerequisites** This guide assumes familiarity with [LangSmith](/langsmith/home), [Persistence](/oss/langgraph/persistence), and [Cross-thread persistence](/oss/langgraph/persistence#memory-store) concepts. @@ -88,6 +89,21 @@ You can configure TTLs for both checkpoints and store items in the same `langgra } ``` +## Configure per-thread TTL + +You can apply [TTL configurations per-thread](https://reference.langchain.com/python/langsmith/deployment/sdk/#langgraph_sdk.client.ThreadsClient.create). + +```python +thread = await client.threads.create( + ttl={ + "strategy": "delete", + "ttl": 43200 # 30 days in minutes + } +) +``` + + + ## Runtime overrides The default `store.ttl` settings from `langgraph.json` can be overridden at runtime by providing specific TTL values in SDK method calls like `get`, `put`, and `search`.