Graph neighbors

Returns the local typed subgraph around a single node. Use graph_neighbors (GET /v1/nodes/{type}/{id}/neighbors) once you have a node id from an evidence-backed query, a source-run evidence pack, or a previous neighbors call, and you want to walk outward.

Marrow stores edges as typed predicates between any node type. Neighbors collapses the graph around the target node into adjacent nodes plus the typed edges that connect them.

  • Works on every node type: note, claim, position, project, entity.
  • Edges are typed (extracted-from, substantiates, demonstrates, contribution-to, shipped-on, supersedes, evolved-from, references, …).
  • Returned edges keep their source kind and confidence, so identity-resolution (INFERRED) edges remain distinguishable from source-extracted edges.

Example

Walk outward from a known claim:

curl "$MARROW_API_BASE_URL/v1/nodes/claim/1f0e.../neighbors?limit=20" \
  -H "Authorization: Bearer $MARROW_API_KEY"

Returns the target node, the neighbouring nodes, and the typed edges that connect them.

{
  "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…",
        "confidenceScore": 0.95
      }
    },
    {
      "type": "project",
      "id": "d7c1…",
      "title": "Northstar onboarding rollout",
      "edge": {
        "predicate": "contribution-to",
        "direction": "outgoing",
        "sourceKind": "distilled",
        "confidenceScore": 0.88
      }
    },
    {
      "type": "entity",
      "id": "ae90…",
      "title": "Product Operations",
      "edge": {
        "predicate": "references",
        "direction": "outgoing",
        "sourceKind": "identity-resolution",
        "confidenceScore": 0.7
      }
    }
  ]
}

Edge direction

Edges in Marrow are directional. direction: "outgoing" means the edge points from the target node toward the neighbour; direction: "incoming" means the opposite. Some predicates (e.g. supersedes, extracted-from) are meaningful only in one direction.

Source kinds

edge.sourceKind identifies how the edge entered the graph:

  • extracted / distilled: produced by LLM distillation during ingest.
  • user-context: direct first-person assertions made through the context command.
  • feedback: accepted corrections via feedback/corrections.
  • identity-resolution: bridge edges inferred by graph enrich to stitch duplicates.
  • canonicalization: reviewed same-as / variant-of / related-to edges from graph canonicalize.

Inferred edges remain visible but tagged, so calling agents can choose whether to treat them the same as source-extracted facts.

Common traversals

Starting point Step out by What you learn
A claim extracted-from The exact source notes that substantiate the claim
A claim contribution-to / demonstrates Projects and skills the claim links to
A project contribution-to (incoming) All claims and notes tied to that project
A note extracted-from (incoming) Every claim distilled out of that note
A correction claim supersedes The reviewed target the correction replaces

What you get back

Field Description
node The target node with its type, id, title, snippet, and facets
neighbors Adjacent nodes, each with type, id, title/snippet, and the typed edge linking them
edge predicate, direction, sourceKind, sourceRunId, confidenceScore for each connection

Limits

limit caps neighbour count at 100 (default 20). Use repeated neighbours calls to traverse rather than asking for unbounded subgraphs. Marrow does not expose a BFS or path-find endpoint over the hosted API yet. For full-graph analysis, the CLI ships marrow graph export, graph report, and graph analyze.

Scope

Requires an API key with scope graph. See the Neighbors API Reference for the full schema.