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

    search

    Copy
    search(
      self,
      *,
      metadata: Json = None,
      graph_id: str | 
    View source on GitHub
    None
    =
    None
    ,
    name
    :
    str
    |
    None
    =
    None
    ,
    limit
    :
    int
    =
    10
    ,
    offset
    :
    int
    =
    0
    ,
    sort_by
    :
    AssistantSortBy
    |
    None
    =
    None
    ,
    sort_order
    :
    SortOrder
    |
    None
    =
    None
    ,
    select
    :
    list
    [
    AssistantSelectField
    ]
    |
    None
    =
    None
    ,
    response_format
    :
    Literal
    [
    'array'
    ,
    'object'
    ]
    =
    'array'
    ,
    headers
    :
    Mapping
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    params
    :
    QueryParamTypes
    |
    None
    =
    None
    )
    ->
    AssistantsSearchResponse
    |
    list
    [
    Assistant
    ]

    Parameters

    NameTypeDescription
    metadataJson
    Default:None

    Metadata to filter by. Exact match filter for each KV pair.

    graph_idstr | None
    Default:None

    The ID of the graph to filter by. The graph ID is normally set in your langgraph.json configuration.

    namestr | None
    Default:None
    limitint
    Default:10
    offsetint
    Default:0
    sort_byAssistantSortBy | None
    Default:None
    sort_orderSortOrder | None
    Default:None
    selectlist[AssistantSelectField] | None
    Default:None
    response_formatLiteral['array', 'object']
    Default:'array'
    headersMapping[str, str] | None
    Default:None
    paramsQueryParamTypes | None
    Default:None

    Search for assistants.

    client = get_client(url="http://localhost:2024")
    response = await client.assistants.search(
        metadata = {"name":"my_name"},
        graph_id="my_graph_id",
        limit=5,
        offset=5,
        response_format="object"
    )
    next_cursor = response["next"]
    assistants = response["assistants"]

    The name of the assistant to filter by. The filtering logic will match assistants where 'name' is a substring (case insensitive) of the assistant name.

    The maximum number of results to return.

    The number of results to skip.

    The field to sort by.

    The order to sort by.

    Specific assistant fields to include in the response.

    Controls the response shape. Use "array" (default) to return a bare list of assistants, or "object" to return a mapping containing assistants plus pagination metadata. Defaults to "array", though this default will be changed to "object" in a future release.

    Optional custom headers to include with the request.

    Optional query parameters to include with the request.