LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph.checkpointbaseBaseCheckpointSaverprune
    Method●Since v4.0

    prune

    Prune checkpoints for the given threads.

    Copy
    prune(
      self,
      thread_ids: Sequence[str],
      *,
      strategy: str = 'keep_latest'
    ) -> None

    Parameters

    NameTypeDescription
    thread_ids*Sequence[str]

    The thread IDs to prune.

    strategystr
    Default:'keep_latest'

    The pruning strategy. "keep_latest" retains only the most recent checkpoint per namespace. "delete" removes all checkpoints.

    View source on GitHub