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.storebaseBaseStorelist_namespaces
    Methodā—Since v1.0

    list_namespaces

    Copy
    list_namespaces(
      self,
      *,
      prefix: NamespacePath | None = None,
      suffix: NamespacePath | 
    View source on GitHub
    None
    =
    None
    ,
    max_depth
    :
    int
    |
    None
    =
    None
    ,
    limit
    :
    int
    =
    100
    ,
    offset
    :
    int
    =
    0
    )
    ->
    list
    [
    tuple
    [
    str
    ,
    .
    .
    .
    ]
    ]

    Parameters

    NameTypeDescription
    prefixNamespacePath | None
    Default:None

    Filter namespaces that start with this path.

    suffixNamespacePath | None
    Default:None

    Filter namespaces that end with this path.

    max_depthint | None
    Default:None
    limitint
    Default:100
    offsetint
    Default:0

    List and filter namespaces in the store.

    Used to explore the organization of data, find specific collections, or navigate the namespace hierarchy.

    Example

    "Examples":

    Setting max_depth=3. Given the namespaces:

    # Example if you have the following namespaces:
    # ("a", "b", "c")
    # ("a", "b", "d", "e")
    # ("a", "b", "d", "i")
    # ("a", "b", "f")
    # ("a", "c", "f")
    store.list_namespaces(prefix=("a", "b"), max_depth=3)
    # [("a", "b", "c"), ("a", "b", "d"), ("a", "b", "f")]

    Return namespaces up to this depth in the hierarchy. Namespaces deeper than this level will be truncated.

    Maximum number of namespaces to return.

    Number of namespaces to skip for pagination.