Brain Docs

Reference

Rust SDKInstallationHTTP clientWire client
encoderecallforgetencode_vectormemory_listmemory_inspectgraph_fetchlinkunlink
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Rust SDKMemorygraph_fetch

graph_fetch

A cursor-paged node and edge view of the space, for drawing — not a query.

PURPOSE

A page of the space as a node/edge graph, for visualisation. It is not a query verb — use list_statements or traverse_relations to ask questions.

GET/v1/graphBearer API keystable
async fn graph_fetch(&self, query: &GraphFetchQuery) -> Result<GraphPage, BrainHttpError>
Handshake credentialstable
async fn graph_fetch(&self, request: &GraphFetchRequest) -> Result<(Vec<GraphNode>, Vec<GraphEdge>)>
async fn graph_fetch_frames(&self, request: &GraphFetchRequest) -> Result<Vec<GraphFetchResponseFrame>>

Parameters

ParameterTypeRequired
limitintegeroptional

Page size.

cursorstring (wire: bytes)optional

Cursor from the previous page.

include_statementsbooleanoptional

Include statement nodes.

include_memoriesbooleanoptional

Include memory nodes.

include_memory_edgesbooleanoptional

Include memory-to-memory edges.

include_tombstonedbooleanoptional

Include tombstoned nodes. Defaults to false.

Returns

FieldTypePresence
nodesGraphNode[]always

Each with id, kind, label and typeQname.

edgesGraphEdge[]always

Each with fromId, toId, kind and label.

next_cursorstring

Absent on the last page.

Turn the includes off for a large space

With every include on, a graph page is the whole store rendered as nodes. Fetch what you will actually draw — a visualisation that cannot show ten thousand nodes should not ask for them.

See also
traverse_relationsPagination

Was this page helpful?

memory_inspect

See everything the write pipeline derived from one memory — vector, keyword fields, HyPE questions, graph and edges.

link

Assert a typed memory-to-memory edge, alongside the ones the write pipeline infers.

On this page

ParametersReturns
Suggest an editOpen in Playground