When to Use
If TTL (time-to-live) is not configured in your LangGraph deployment, threads will accumulate over time. This can result in increased memory usage and degraded performance. Manually deleting threads is the only way to get rid of these threads set without a TTL
Use this runbook whenever you need to manually delete threads.
Run Cleanup
https://github.com/langchain-ai/langgraph-management-tools/tree/main/thread-cleanup
Run the cleanup tool with your deployment details:
python3 delete.py --url YOUR_LANGGRAPH_URL --api-key YOUR_LANGSMITH_API_KEYExample:
python3 delete.py \
--url https://your-deployment.us.langgraph.app \
--api-key your_langsmith_api_key_hereDeletion Options
The tool provides an interactive menu:
Delete by TIME – remove threads older than hour/day/week/month/custom
Delete by STATUS – idle, running, success, error
Delete by RUNS COUNT – by number of executions
Delete by GRAPH ID – from specific graphs
PREVIEW all threads – view without deleting
Delete ALL threads – removes everything
Exit – quit without changes