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
| Parameter | Type | Default | Description |
|---|---|---|---|
start_node | string | required | Key of the node to start from. |
query | string | — | What you are looking for. Steers the choice of strategy and the ranking. |
max_nodes | integer | 50 | Maximum nodes to return (1–500). |
max_depth | integer | 2 | How many hops to walk. Values up to 10 are accepted; traversal stops at 3. |
relationship_pattern | string | — | Only follow relationships whose wording matches this pattern. |
lens | string | — | Optional lens that narrows the traversal. |
session_id | string | "default" | The conversation’s id, recorded with the session’s activity. |
organization_id | string | — | Traverse an organization graph you belong to instead of your own. The result carries read_target. |
Response
| Field | Description |
|---|---|
results | Related nodes, strongest first, each with its score, depth and the relationship it was reached_via. |
count | Number of nodes returned. |
strategy_used | The strategy HyperMemory chose (chain, query_ranked or relevance_decay), with the depth requested and reached. |
truncated | true 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_recalland 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_nodesinstead.