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-sdk_syncthreadsSyncThreadsClientsearch
    Method●Since v0.3

    search

    Copy
    search(
      self,
      *,
      metadata: Json = None,
      values: Json = None

    Used in Docs

    • Docusaurus integration
    View source on GitHub
    ,
    ids
    :
    Sequence
    [
    str
    ]
    |
    None
    =
    None
    ,
    status
    :
    ThreadStatus
    |
    None
    =
    None
    ,
    limit
    :
    int
    =
    10
    ,
    offset
    :
    int
    =
    0
    ,
    sort_by
    :
    ThreadSortBy
    |
    None
    =
    None
    ,
    sort_order
    :
    SortOrder
    |
    None
    =
    None
    ,
    select
    :
    list
    [
    ThreadSelectField
    ]
    |
    None
    =
    None
    ,
    extract
    :
    dict
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    headers
    :
    Mapping
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    params
    :
    QueryParamTypes
    |
    None
    =
    None
    )
    ->
    list
    [
    Thread
    ]

    Parameters

    NameTypeDescription
    metadataJson
    Default:None

    Thread metadata to filter on.

    valuesJson
    Default:None

    State values to filter on.

    idsSequence[str] | None
    Default:None
    statusThreadStatus | None
    Default:None
    limitint
    Default:10
    offsetint
    Default:0
    sort_byThreadSortBy | None
    Default:None
    sort_orderSortOrder | None
    Default:None
    selectlist[ThreadSelectField] | None
    Default:None
    extractdict[str, str] | None
    Default:None
    headersMapping[str, str] | None
    Default:None
    paramsQueryParamTypes | None
    Default:None

    Search for threads.

    client = get_sync_client(url="http://localhost:2024")
    threads = client.threads.search(
        metadata={"number":1},
        status="interrupted",
        limit=15,
        offset=5
    )

    List of thread IDs to filter by.

    Thread status to filter on. Must be one of 'idle', 'busy', 'interrupted' or 'error'.

    Limit on number of threads to return.

    Offset in threads table to start search from.

    Sort by field.

    Sort order.

    List of fields to include in the response.

    Dictionary mapping aliases to JSONB paths to extract from thread data. Paths use dot notation for nested keys and bracket notation for array indices (e.g., {"last_msg": "values.messages[-1]"}). Extracted values are returned in an extracted field on each thread. Maximum 10 paths per request.

    Optional custom headers to include with the request.

    Optional query parameters to include with the request.