Brain Docs

Reference

Python SDKInstallationHTTP clientWire clientSync vs async
create_spacelist_spacesdelete_spacecreate_sessionlist_sessionsdelete_session
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Python SDKSpaces and sessionslist_spaces

list_spaces

The spaces in the caller's namespace — and the cross-shard completeness flag you must check.

PURPOSE

The spaces in the caller's namespace. Bounded by limit; it does not page.

GET/v1/spacesBearer API keystable
list_spaces(limit: int | None = None) -> ListSpacesResult
Handshake credentialstable
list_spaces(request: SpaceListRequest) -> SpaceListResponse

Parameters

ParameterTypeRequired
limitintegeroptional

Cap on returned spaces. Required on the wire request type, optional on the HTTP query.

Returns

FieldTypePresence
spacesSpaceSummary[]always

Each with space, createdAtUnixNanos, lastActiveUnixNanos, memoryCount and sessionCount.

cross_shard_completebooleanalways

Whether the listing covered the whole namespace.

Check crossShardComplete

false means the listing covered one shard, not the namespace. Treating a partial listing as complete is how a caller concludes a space is gone and re-provisions over live data. This is a different kind of incompleteness from pagination: there is no cursor to follow, only a flag saying the answer is partial.

You do not choose your space on the HTTP tier

The space comes from the credential. These verbs act on the caller's space. Addressing another space per request is a wire-tier capability — see act_as. Per-end-user isolation is a storage-key prefix inside one space, not a key per user; see Namespaces.

See also
create_spacePagination

Was this page helpful?

create_space

Provision the caller's space. Idempotent — the created flag says whether this call made it.

delete_space

Erase the caller's space and everything under it — hard, immediate and safe to retry.

On this page

ParametersReturns
Suggest an editOpen in Playground