find_path
Find how two concepts connect. The shortest chain of links joining two concepts of one tree, following links either way (at most 6 links), each step saying which way its link points. For questions like “how does A relate to B?”. Read-only.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
from |
string | Yes | Concept ID, its tree first: company:product/okforest-product-brief. In a Forest of one tree, the tree may be left out. |
to |
string | Yes | The other concept’s ID, in the same tree as from. |
Returns
Section titled “Returns”One JSON object (see All tools):
| Field | Type | Always | Description |
|---|---|---|---|
tree |
Tree reference | Yes | The tree they’re in, and the commit it was read at. |
connected |
boolean | Yes | Whether a chain of at most 6 links joins them. |
steps |
list of Path step | Yes | The concepts from from to to, both included; empty when they aren’t joined. |
Example
Section titled “Example”Asked “How is Acme Corp connected to Rival Co?”, an assistant might call find_path with:
{ "from": "company:customers/acme-corp", "to": "company:competitors/rival-co"}On OKForest’s test Forest (Acme’s made-up company knowledge), it returns:
{ "tree": { "slug": "company", "repo": "acme/acme-okf", "commit": "abc1234abc1234abc1234abc1234abc1234abc12", "url": "https://app.okforest.ai/@/3f2b8c1e-9a4d-4c7b-8e2f-6d1a0b5c9e7f/company/" }, "connected": true, "steps": [ { "id": "company:customers/acme-corp", "title": "Acme Corp", "tree": "company", "url": "https://app.okforest.ai/@/3f2b8c1e-9a4d-4c7b-8e2f-6d1a0b5c9e7f/company/customers/acme-corp" }, { "id": "company:competitors/rival-co", "title": "Rival Co", "tree": "company", "url": "https://app.okforest.ai/@/3f2b8c1e-9a4d-4c7b-8e2f-6d1a0b5c9e7f/company/competitors/rival-co", "link": "from previous" } ]}