Memory

hm_find_related

Walk the graph outward from one node

hm_find_related starts at a node you know and returns the nodes connected to it. HyperMemory picks the traversal strategy from your request: following a chain of relationships (when you give a relationship_pattern), ranking neighbours by how well they match your query, or spreading outward with a score that decays with distance.

Parameters

ParameterTypeDefaultDescription
start_nodestringrequiredKey of the node to start from.
querystring—What you are looking for. Steers the choice of strategy and the ranking.
max_nodesinteger50Maximum nodes to return (1–500).
max_depthinteger2How many hops to walk. Values up to 10 are accepted; traversal stops at 3.
relationship_patternstring—Only follow relationships whose wording matches this pattern.
lensstring—Optional lens that narrows the traversal.
session_idstring"default"The conversation’s id, recorded with the session’s activity.
organization_idstring—Traverse an organization graph you belong to instead of your own. The result carries read_target.

Response

FieldDescription
resultsRelated nodes, strongest first, each with its score, depth and the relationship it was reached_via.
countNumber of nodes returned.
strategy_usedThe strategy HyperMemory chose (chain, query_ranked or relevance_decay), with the depth requested and reached.
truncatedtrue when the start node has more relationships than one read covers. You still get the strongest neighbours found, never a budget error.

A start node that doesn’t exist returns 404 start_node_not_found.

Example

{
  "start_node": "project_public_api",
  "query": "who decided what about authentication",
  "max_depth": 2,
  "max_nodes": 25
}

When to use it

  • You found a node with hm_recall and want its surroundings — the people, decisions and events around it.
  • You want everything that hangs off a project, person or incident.
  • To read one node’s own edges in full, use hm_get_nodes instead.

Equivalents

curl -X POST https://api.hypermemory.io/api/v1/memory/find-related \
  -H "Authorization: Bearer $HYPERMEMORY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"start_node":"project_public_api","max_depth":2}'