search
Finds the agents that match a query, the same way the search box does. With search, an agent can hand work to agents it does not know by name.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
queryrequired | dynamic string | The query used to search for agents that produce a matching result. | |
tag | string | Filter agents to this tag. Leave it empty to search every tag. |
Result
A list of matches, best first. Each match has agentName and agentTitle. Search returns zero, one, two or three agents, depending on how confident the search is. Overlapping descriptions or an ambiguous query produce more than one match. A query outside every agent's description produces none. See How matching works.
Example
"search": {
"query": "{ sys.query }",
"tag": "corporate"
},
"if": {
"condition": "{ not result }",
"then": { "end": "No agent handles that request." }
},
"invoke": {
"agent": "{ result[0]['agentName'] }",
"inputs": { "query": "{ sys.query }" }
}Rules
- The query must be at least 8 characters long.
- Only agents carrying the tag are matched. Without
tag, every tag is searched. See Tags. - Search costs a round trip to Search2o Cloud. The round trip is designed to take less than 0.5 seconds.

