LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    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

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphpregelremoteRemoteGraphaget_state_history
    Methodā—Since v0.2

    aget_state_history

    Copy
    aget_state_history(
      self,
      config: RunnableConfig,
      *,
      filter: dict[str, Any]
    View source on GitHub
    |
    None
    =
    None
    ,
    before
    :
    RunnableConfig
    |
    None
    =
    None
    ,
    limit
    :
    int
    |
    None
    =
    None
    ,
    headers
    :
    dict
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    params
    :
    QueryParamTypes
    |
    None
    =
    None
    )
    ->
    AsyncIterator
    [
    StateSnapshot
    ]

    Parameters

    NameTypeDescription
    config*RunnableConfig

    A RunnableConfig that includes thread_id in the configurable field.

    filterdict[str, Any] | None
    Default:None

    Metadata to filter on.

    beforeRunnableConfig | None
    Default:None
    limitint | None
    Default:None
    headersdict[str, str] | None
    Default:None
    paramsQueryParamTypes | None
    Default:None

    Get the state history of a thread.

    This method calls POST /threads/{thread_id}/history.

    A RunnableConfig that includes checkpoint metadata.

    Max number of states to return.

    Optional custom headers to include with the request.

    Optional query parameters to include with the request.