Neighbors

Return the local typed subgraph around a known node.

GET /v1/nodes/{type}/{id}/neighbors

Authentication

API key with scope graph.

Request

Path parameter Type Notes
type enum note | claim | position | project | entity
id uuid required
Query parameter Type Default Notes
limit integer 20 1 ≤ limit ≤ 100

Response: 200 OK

{
  "schemaVersion": "marrow-neighbors-v1",
  "node": {
    "type": "claim",
    "id": "1f0e…",
    "title": "Led cross-functional delivery of the Northstar onboarding rollout.",
    "snippet": "Avery drove the rollout of the onboarding flow …",
    "facets": ["cross-functional-delivery", "onboarding-rollout"]
  },
  "neighbors": [
    {
      "type": "note",
      "id": "9b2c…",
      "title": "Northstar rollout retrospective interview, 2019.",
      "snippet": "On the Northstar team, I drove the onboarding rollout …",
      "edge": {
        "predicate": "extracted-from",
        "direction": "outgoing",
        "sourceKind": "interview",
        "sourceRunId": "f1a3…",
        "confidenceKind": "asserted",
        "confidenceScore": 0.95
      }
    }
  ]
}

Field reference

Field Type Description
node object The target node, with type, id, title, snippet, and facets
neighbors[] array Adjacent nodes
neighbors[].type enum Same set as the path type
neighbors[].edge.predicate string Seeded predicate (extracted-from, demonstrates, supersedes, …) or distiller-minted
neighbors[].edge.direction enum "outgoing" (target → neighbour) or "incoming" (neighbour → target)
neighbors[].edge.sourceKind string extracted / distilled / user-context / feedback / identity-resolution / canonicalization
neighbors[].edge.confidenceScore number [0, 1]

Errors

Code error.code Reason
401 unauthorized Missing or invalid API key
403 forbidden API key lacks scope graph
404 not_found Node not found for this account
422 validation_error Path uuid or type failed validation
429 rate_limit_exceeded Rate limit hit

CLI mapping

npm run dev -- neighbors <node_id> --node-type note

For deeper graph traversal (BFS, components, bridges, canonicalization), use the CLI: marrow graph report, graph analyze, graph canonicalize, graph enrich, graph export.