API Reference

memory_find_related

Find nodes related to a given node by traversing relationships

memory_find_related

Find nodes related to a given node by traversing edges and hyperedges in the graph.

Parameters

The ID of the source node to find relations for.

How many relationship hops to traverse. Default: 1. Maximum: 5.

Filter to only edges of this type (e.g., “manages”, “depends_on”).

Maximum number of results to return. Default: 10. Maximum: 100.

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

Example request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "memory_find_related",
    "arguments": {
      "node_id": "node_sarah_abc123",
      "depth": 2,
      "max_results": 10
    }
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "source_node": {
      "id": "node_sarah_abc123",
      "content": "Sarah Chen, Backend Tech Lead"
    },
    "results": [
      {
        "id": "node_phoenix_def456",
        "content": "Project Phoenix: API modernization initiative",
        "node_type": "project",
        "distance": 1,
        "path": ["manages"]
      },
      {
        "id": "node_marcus_ghi789",
        "content": "Marcus Lee, Senior Backend Developer",
        "node_type": "person",
        "distance": 2,
        "path": ["manages", "member_of"]
      },
      {
        "id": "node_decision_jkl012",
        "content": "Decision to use PostgreSQL for new service",
        "node_type": "decision",
        "distance": 1,
        "path": ["participated_in"]
      }
    ],
    "total": 3
  }
}

Response fields

FieldTypeDescription
source_nodeobjectThe node you queried from
resultsarrayArray of related nodes
results[].idstringRelated node’s ID
results[].contentstringRelated node’s content
results[].node_typestringRelated node’s type
results[].distancenumberNumber of hops from source
results[].patharrayEdge types traversed to reach this node
totalnumberTotal related nodes found

Errors

CodeDescription
INVALID_PARAMETERMissing node_id or invalid depth
NODE_NOT_FOUNDSource node doesn’t exist
GRAPH_NOT_FOUNDSpecified graph_id doesn’t exist
QUOTA_EXCEEDEDMonthly query limit reached

Notes

Query cost — Each memory_find_related call counts as 1 query.

Traversal behavior

  • Depth 1 — Direct connections only
  • Depth 2 — Direct connections + their connections
  • Depth N — Up to N hops away

Higher depths exponentially increase the potential result set but don’t increase query cost.

Including hyperedges

Related nodes connected via hyperedges are included. If node A and node B are both members of the same hyperedge, they’re considered directly connected (distance 1).

Node A ───┐
          ├──── Hyperedge "Sprint Planning"
Node B ───┘

A → B distance = 1 (via hyperedge)

Path information

The path array shows how each result was reached:

{
  "id": "node_xyz",
  "distance": 3,
  "path": ["manages", "member_of", "works_on"]
}

This means: source → (manages) → X → (member_of) → Y → (works_on) → node_xyz

Filtering by edge type

Use edge_type to find specific relationships:

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

Returns only nodes Sarah manages directly.

Large graphs — With depth > 2 on highly connected nodes, results may be truncated at max_results. Use edge_type filters to narrow results.