Skip to content

feat: surface per-neighbor edge counts in graph_neighbors#1460

Merged
Evanfeenstra merged 2 commits into
mainfrom
feature/jarvis-neighbor-edge-counts
Jul 10, 2026
Merged

feat: surface per-neighbor edge counts in graph_neighbors#1460
Evanfeenstra merged 2 commits into
mainfrom
feature/jarvis-neighbor-edge-counts

Conversation

@Evanfeenstra

Copy link
Copy Markdown
Collaborator

What

Follow-up to #1459. Each neighbor returned by graph_neighbors now carries an edges map ({EDGE_TYPE: count}):

[
  {
    "ref_id": "def-456",
    "node_type": "Function",
    "name": "handle_request",
    "edge_type": "CALLS",
    "direction": "forward",
    "edges": { "CALLS": 8, "CONTAINS": 1 }
  }
]

Why

#1459 added edge counts to graph_search and graph_get, but not graph_neighbors — it hits a different backend path (expand=edgesprediction_service.get_node_edges). This closes that gap so an agent can see how connected each hop target is and which edge types it can follow next, and choose where to traverse without a follow-up call per neighbor.

How

  • Sends include_edge_counts=true on the expand=edges request so Jarvis attaches each neighbor's counts inline — one call, no per-node round trips.
  • Reads the per-node edges map from the neighbor nodes and surfaces it on each returned neighbor.
  • Adds an optional namespace param to scope the counts correctly.

Dependency

Requires the matching backend change in stakwork/jarvis-backend#2976 (now extends include_edge_counts to the expand=edges path). Until it deploys, neighbors carry edges: {}.

Tests

tsc --noEmit clean; all 25 tests in toolsJarvis.test.ts pass.

Each neighbor returned by graph_neighbors now carries an "edges" map
({EDGE_TYPE: count}) showing how connected that neighbor is and which
relationship types can be traversed next — so an agent can pick which hop
target to expand without a follow-up call.

Sends include_edge_counts=true on the expand=edges request so Jarvis
attaches each neighbor's counts inline (one call, no per-node round trips),
and adds an optional namespace param to scope the counts. Depends on the
matching jarvis-backend change to the expand=edges path.
@Evanfeenstra Evanfeenstra merged commit 5645c14 into main Jul 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant