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

    list_namespaces

    Copy
    list_namespaces(
      self,
      prefix: list[str] | None = None,
      suffix: list
    View source on GitHub
    [
    str
    ]
    |
    None
    =
    None
    ,
    max_depth
    :
    int
    |
    None
    =
    None
    ,
    limit
    :
    int
    =
    100
    ,
    offset
    :
    int
    =
    0
    ,
    *
    ,
    headers
    :
    Mapping
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    params
    :
    QueryParamTypes
    |
    None
    =
    None
    )
    ->
    ListNamespaceResponse

    Parameters

    NameTypeDescription
    prefixlist[str] | None
    Default:None

    Optional list of strings representing the prefix to filter namespaces.

    suffixlist[str] | None
    Default:None

    Optional list of strings representing the suffix to filter namespaces.

    max_depthint | None
    Default:None
    limitint
    Default:100
    offsetint
    Default:0
    headersMapping[str, str] | None
    Default:None

    List namespaces with optional match conditions.

    client = get_sync_client(url="http://localhost:8123")
    namespaces = client.store.list_namespaces(
        prefix=["documents"],
        max_depth=3,
        limit=10,
        offset=0
    )
    print(namespaces)
    ----------------------------------------------------------------
    
    [
        ["documents", "user123", "reports"],
        ["documents", "user456", "invoices"],
        ...
    ]

    Optional integer specifying the maximum depth of namespaces to return.

    Maximum number of namespaces to return (default is 100).

    Number of namespaces to skip before returning results (default is 0).

    Optional custom headers to include with the request.