Search
POST /api/exec/search is the search box as an API call. It returns the agents that match a query, best first, and leaves the running to the caller.
The request
query is the user's text, at least 8 characters. tag is optional: leave it out, or send an empty string, to search every tag, or name a tag to search only that tag. See Tags.
$ curl -s -X POST http://127.0.0.1:9020/api/exec/search \
-H "Authorization: Bearer $SEARCH2O_SERVICE_KEY" -H "Content-Type: application/json" \
-d '{"query": "how many vacation days do I have left"}'
{"success": true,
"searchResults": [{"agentName": "hr_policy", "agentTitle": "HR policies and entitlements"}]}The response
searchResults holds zero, one or two agents, best first; How matching behaves says when each happens. An empty list means nothing matched. Say so to the user and run nothing. What to do with two matches, run the first or offer the choice, is the client's own search behavior.
Running the match
Search runs nothing. Take the chosen agentName and call execAgent with the same query under inputs.query. For a follow-up, send the query to search again and pass the conversation's convid to execAgent, whichever agent matched.

