Search nodes
POST /ontology/v1/search
Resolve text to the nodes it most likely names, when a mirror holds a name and needs the node id it corresponds to. Results are ranked candidates, not an answer, each reporting whether the match came from the node’s name, an alias, its description or a relation’s fact. Narrow with types, and cap the result count with limit (1–50, default 20). This reads structure; it is not an agent’s recall, which reads the graph from that agent’s own viewpoint inside its sessions.
Support: supported
Request body (application/json)
Required: true
| Name | Type | Description |
|---|---|---|
| text | string | Text to find nodes for, matched against names, aliases, descriptions and relation facts; an empty string is refused. |
| types | array<string> | Registered node type names to search within; omit to search every type. |
| window | object | Restrict matches to facts recorded within a period; omit to search all time. |
| window.from | string | Start of the period, inclusive, in ISO 8601 UTC; omit to leave the start open. |
| window.to | string | End of the period, exclusive, in ISO 8601 UTC; omit to leave the end open. |
| limit | integer | Maximum candidate nodes to return, from 1 to 50; defaults to 20 when omitted. |
{ "type": "object", "required": [ "text" ], "description": "The text to resolve, optionally narrowed to types and a result count.", "properties": { "text": { "type": "string", "description": "Text to find nodes for, matched against names, aliases, descriptions and relation facts; an empty string is refused.", "example": "李总" }, "types": { "type": "array", "description": "Registered node type names to search within; omit to search every type.", "items": { "type": "string", "example": "customer" }, "example": [ "customer" ] }, "window": { "type": "object", "description": "Restrict matches to facts recorded within a period; omit to search all time.", "properties": { "from": { "type": "string", "format": "date-time", "description": "Start of the period, inclusive, in ISO 8601 UTC; omit to leave the start open.", "example": "2026-10-01T00:00:00.000Z" }, "to": { "type": "string", "format": "date-time", "description": "End of the period, exclusive, in ISO 8601 UTC; omit to leave the end open.", "example": "2026-11-01T00:00:00.000Z" } } }, "limit": { "type": "integer", "minimum": 1, "maximum": 50, "description": "Maximum candidate nodes to return, from 1 to 50; defaults to 20 when omitted.", "example": 10 } }}Response
HTTP 200
Ranked candidate nodes, best match first, with the field each one matched on.
application/json
| Name | Type | Description |
|---|---|---|
| hits | array<object> | The candidate nodes, strongest match first; an empty array means nothing matched. |
| hits[].node | string | Node id of the candidate; pass it to nodes.retrieve to confirm before writing with it. |
| hits[].score | number | Match strength from 0 to 1; compare candidates within one response rather than across queries. |
| hits[].matched | string | Which field matched, so a weak fact match can be checked against the node itself. |