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

    List and filter namespaces in the store.

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

    Copy
    list_namespaces(
      self,
      *,
      prefix: NamespacePath | None = None,
      suffix: NamespacePath | None = None,
      max_depth: int | None = None,
      limit: int = 100,
      offset: int = 0
    ) -> list[tuple[str, ...]]
    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")]

    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

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

    limitint
    Default:100

    Maximum number of namespaces to return.

    offsetint
    Default:0

    Number of namespaces to skip for pagination.

    View source on GitHub