Get Subgraph

Returns the bounded neighborhood of a set of seed nodes as a single {nodes, edges} payload: breadth-first expansion up to a caller-specified depth, subject to explicit budgets, with explicit truncation reporting.

Request

Subgraph request
seed_node_uuidslist of stringsRequired

Seed node UUIDs to expand from, in traversal-priority order: seeds are admitted before any expansion, in this order, and count toward max_nodes first. 1-20 entries, required. Seeds that do not exist in the target graph are ignored, not an error.

depthintegerOptional1-3

Maximum traversal depth from the seeds. 1-3. Defaults to 1.

directionstringOptional

Edge orientation followed during expansion, relative to each frontier node: “in” | “out” | “both”. Defaults to “both”.

graph_idstringOptional

graph_id identifies the target named graph. Exactly one of user_id or graph_id is required.

max_edgesintegerOptional1-1000

Maximum number of edges in the response. 1-1000. Defaults to 200.

max_nodesintegerOptional1-500

Maximum number of nodes in the response, including admitted seeds. 1-500. Defaults to 100.

search_filtersobjectOptional

Filters constraining traversed edges and included nodes. Reuses the graph.search filter type. search_filters.episode_metadata_filters is rejected: it cannot be enforced during graph traversal (spec-2 §9.4).

user_idstringOptional

user_id identifies the target user graph. Exactly one of user_id or graph_id is required.

Response

Subgraph
edgeslist of objectsOptional

Every traversed edge that passed the request filters. Both endpoints of every edge are present in Nodes (edge-endpoint closure).

nodeslist of objectsOptional
Every admitted seed and every node reached within budget.
truncatedbooleanOptional
True whenever any budget or internal limit reduced the result.
truncation_reasonstringOptional

Names the binding limit (for example “max_nodes”, “max_edges”) when Truncated is true; nil otherwise.

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error