LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    LangGraph Store
    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
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph.checkpointbaseBaseCheckpointSavercopy_thread
    Method●Since v4.0

    copy_thread

    Copy all checkpoints and writes from one thread to another.

    Copy
    copy_thread(
      self,
      source_thread_id: str,
      target_thread_id: str
    ) -> None

    Implementations must copy the complete parent chain (all ancestor checkpoints and their checkpoint_writes) — copying only the head checkpoint will leave the target thread with DeltaChannel state that cannot be reconstructed (no path back to a _DeltaSnapshot ancestor). Equivalently, the copy must include enough ancestors that every DeltaChannel-backed key has either a _DeltaSnapshot in channel_values somewhere in the chain, or a complete write history back to the chain root.

    Parameters

    NameTypeDescription
    source_thread_id*str

    The thread ID to copy from.

    target_thread_id*str

    The thread ID to copy to.

    View source on GitHub