Docs menu · Reference

Walks a node’s edges and returns one hit per traversed edge. Direction is outgoing, incoming, or both; an optional edge-type filter restricts the walk. Each hit embeds both the traversed edge and the neighbor node in full, so a follow-up read is rarely needed. A missing node yields an empty page.

Paginated responses use opaque cursors. Clients should pass the returned cursor back to the same command shape and must not parse cursor contents.

Examples

Find a node’s neighbors along outgoing edges.

CLI

$ strata graph create social
$ strata graph add-node social alice
$ strata graph add-node social bob
$ strata graph add-edge social alice knows bob
$ strata graph neighbors social alice outgoing

Wire

{"graph":"social","type":"graph_create"}
{"graph":"social","node_id":"alice","type":"graph_add_node"}
{"graph":"social","node_id":"bob","type":"graph_add_node"}
{"dst":"bob","edge_type":"knows","graph":"social","src":"alice","type":"graph_add_edge"}
{"direction":"outgoing","graph":"social","node_id":"alice","type":"graph_neighbors"}

Parameters

NameTypeRequiredDescription
as_ofintegernoOptional timestamp in microseconds. Reads the graph state visible at that instant.
cursorstringnoOptional exclusive cursor.
directionGraphDirectionyesTraversal direction.
edge_typestringnoOptional edge type filter.
graphstringyesGraph name.
limitintegernoOptional item limit. Defaults to 100.
node_idstringyesNode id.

Plus the optional scope: branch and space (default to the session branch and the "default" space).

Returns

Page<GraphNeighborHit, String>.

Errors

Invocation

  • CLI: strata graph neighbors
  • Wire type: graph_neighbors

agents: this page as markdown → /docs/reference/graph/neighbors.md