API Reference

memory_get_relationships

Get all edges and hyperedges connected to a node

memory_get_relationships

Get all edges and hyperedges connected to a specific node. Unlike memory_find_related, this returns the relationship metadata itself, not just the connected nodes.

Parameters

The ID of the node to get relationships for.

Filter by edge direction. Options: "incoming", "outgoing", "both". Default: "both".

Filter to only edges/hyperedges of this type.

Target graph. Defaults to your account’s default graph.

Example request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "memory_get_relationships",
    "arguments": {
      "node_id": "node_sarah_abc123",
      "direction": "both"
    }
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "node": {
      "id": "node_sarah_abc123",
      "content": "Sarah Chen, Backend Tech Lead"
    },
    "edges": [
      {
        "id": "edge_xyz789",
        "edge_type": "manages",
        "directed": true,
        "source": "node_sarah_abc123",
        "target": "node_phoenix_def456",
        "metadata": {
          "since": "2026-01",
          "role": "tech_lead"
        },
        "created_at": "2026-01-15T10:00:00Z"
      },
      {
        "id": "edge_uvw456",
        "edge_type": "reports_to",
        "directed": true,
        "source": "node_sarah_abc123",
        "target": "node_cto_mno123",
        "metadata": {},
        "created_at": "2026-01-10T09:00:00Z"
      }
    ],
    "hyperedges": [
      {
        "id": "hedge_qrs101",
        "edge_type": "decision_context",
        "content": "Q3 roadmap planning decision",
        "nodes": [
          "node_sarah_abc123",
          "node_marcus_ghi789",
          "node_api_v2_jkl012",
          "node_q3_planning_pqr345"
        ],
        "metadata": {
          "date": "2026-02-01",
          "outcome": "approved"
        },
        "created_at": "2026-02-01T15:00:00Z"
      }
    ],
    "total_edges": 2,
    "total_hyperedges": 1
  }
}

Response fields

FieldTypeDescription
nodeobjectThe queried node’s summary
edgesarrayBinary edges connected to the node
edges[].idstringEdge identifier
edges[].edge_typestringType/label of the edge
edges[].directedbooleanWhether edge has direction
edges[].sourcestringSource node ID (for directed edges)
edges[].targetstringTarget node ID (for directed edges)
edges[].metadataobjectEdge metadata
edges[].created_atstringEdge creation timestamp
hyperedgesarrayHyperedges containing the node
hyperedges[].idstringHyperedge identifier
hyperedges[].edge_typestringType/label of the hyperedge
hyperedges[].contentstringOptional description of the hyperedge
hyperedges[].nodesarrayAll node IDs in the hyperedge
hyperedges[].metadataobjectHyperedge metadata
total_edgesnumberCount of binary edges
total_hyperedgesnumberCount of hyperedges

Errors

CodeDescription
INVALID_PARAMETERMissing node_id or invalid direction
NODE_NOT_FOUNDNode doesn’t exist
GRAPH_NOT_FOUNDSpecified graph_id doesn’t exist
QUOTA_EXCEEDEDMonthly query limit reached

Notes

Query cost — Each memory_get_relationships call counts as 1 query.

Direction filtering

For directed edges:

  • incoming — Edges where this node is the target
  • outgoing — Edges where this node is the source
  • both — All edges

Hyperedges don’t have direction, so they’re always included regardless of direction filter.

Use cases

Get all context for a node:

{"node_id": "node_xyz", "direction": "both"}

Find what a person manages:

{"node_id": "node_sarah", "direction": "outgoing", "edge_type": "manages"}

Find who manages a project:

{"node_id": "node_project", "direction": "incoming", "edge_type": "manages"}
ToolReturnsBest for
memory_find_relatedConnected nodes”What’s related to X?”
memory_get_relationshipsEdge/hyperedge metadata”How is X connected?”

Use memory_find_related to discover connected knowledge. Use memory_get_relationships to understand the nature of connections.