Brain Docs

Reference

Python SDKInstallationHTTP clientWire clientSync vs async
create_relationget_relationlist_relationstraverse_relationssupersede_relationtombstone_relation
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Python SDKRelationslist_relations

list_relations

List an entity's relations in either direction — one HTTP verb, two wire verbs.

PURPOSE

An entity's relations, filtered by direction and type. The HTTP tier takes one entity plus a direction; the wire tier has two separate verbs instead.

GET/v1/entities/:id/relationsBearer API keystable
list_relations(entity_id: str, direction=None, type=None, include_superseded=None, include_tombstoned=None, limit=None, cursor=None) -> ListRelationsResult
Handshake credentialstable
list_relations_from(request: RelationListFromRequest) -> list[RelationView]
list_relations_from_frames(request: RelationListFromRequest) -> list[RelationListFromResponseFrame]
list_relations_to(request: RelationListToRequest) -> list[RelationView]
list_relations_to_frames(request: RelationListToRequest) -> list[RelationListToResponseFrame]

Parameters

ParameterTypeRequired
entity_idstringrequired

The entity whose relations to list. Positional on the HTTP tier.

directionstringoptional

Which way the edges point. The wire tier splits this into two verbs.

typestringoptional

Restrict to one relation type. The wire field is relationTypeFilter.

include_supersededbooleanoptional

Include non-head versions. Defaults to false.

include_tombstonedbooleanoptional

Defaults to false.

limitintegeroptional

Page size.

cursorstring (wire: bytes)optional

Cursor from the previous page.

Returns

FieldTypePresence
relationsRelationDetail[]always

The page.

next_cursorstring

Absent on the last page.

Both wire verbs have a frame-level form — list_relations_from_frames and list_relations_to_frames — and both add timeRangeStartUnixNanos / timeRangeEndUnixNanos, which the HTTP tier does not expose.

On the wire

Entity ids are UUID bytes, properties is a propertiesBlob, and evidence is a single reference rather than an array. Every request carries a requestId plus an optional actAs.

See also
traverse_relationsPagination

Was this page helpful?

get_relation

Read one relation, including its symmetry flag and its place in the supersession chain.

traverse_relations

Walk the relation graph outward from an entity and get paths back — with a truncation flag you must check.

On this page

ParametersReturnsOn the wire
Suggest an editOpen in Playground