find_path
Find the shortest connection between two concepts in an ontology graph, returning hops, edges, and rationale for each link. When no path exists, suggests a concrete addition to grow the vault.
Instructions
Shortest path between two nodes (undirected BFS). Returns { from, to, hops: [slug...], nodes: [{uid, slug, kind, title, domain?}], edges: [{from, to, via, rationale?}] } where each via is the frontmatter key (domains / domain / capabilities / elements / dependencies / relates / contains / describes) that linked the two slugs and rationale is the one-line relation_notes sentence the declaring document stores for that pair (present only when one is stored) — so the agent sees not just that A and B are connected but by which key and, when someone wrote it down, why. Returns { found: false } when no path is found within maxHops, plus a growthHint — a concrete add_relation (both endpoints exist) or add_concept (an endpoint is missing) example so the unanswered question becomes a vault-growth signal instead of a dead end. maxHops defaults to 5 and is capped at 20.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Target slug. | |
| from | Yes | Source slug. | |
| maxHops | No | Non-negative integer maximum hop count (default 5, max 20). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| from | Yes | ||
| hops | No | ||
| edges | No | ||
| found | Yes | ||
| nodes | No | ||
| reason | No | ||
| hopCount | No | ||
| growthHint | No | Only present when found=false — a candidate add_relation (both endpoints exist) or add_concept (an endpoint is missing) suggestion, derived from the real vault, not invented. |