Skip to main content
Version: 0.13.0

Search for an agent

Introduced 0.5.0

Use this command to search for agents you've already created. You can provide any Lucenia search query in the request body.

Path and HTTP methods​

GET /_plugins/_agent/agents/_search
POST /_plugins/_agent/agents/_search
note

Agent, tool, and MCP APIs now use the preferred _plugins/_agent namespace. The legacy _plugins/_ml/... route still works for backward compatibility but is deprecated and will be removed in a future release.

Example request: Searching for all agents​

POST /_plugins/_agent/agents/_search
{
"query": {
"match_all": {}
},
"size": 1000
}

Example request: Searching for agents of a certain type​

POST /_plugins/_agent/agents/_search
{
"query": {
"term": {
"type": {
"value": "flow"
}
}
}
}

Example: Searching for an agent by description​

GET _plugins/_agent/agents/_search
{
"query": {
"bool": {
"should": [
{
"match": {
"description": "test agent"
}
}
]
}
},
"size": 1000
}

Example response​

{
"took": 2,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 6,
"relation": "eq"
},
"max_score": 0.15019803,
"hits": [
{
"_index": ".plugins-ml-agent",
"_id": "8HXlkI0BfUsSoeNTP_0P",
"_version": 1,
"_seq_no": 17,
"_primary_term": 2,
"_score": 0.13904166,
"_source": {
"created_time": 1707532959502,
"last_updated_time": 1707532959502,
"name": "Test_Agent_For_RagTool",
"description": "this is a test flow agent",
"type": "flow",
"tools": [
{
"description": "A tool to search a Lucenia index",
"include_output_in_agent_response": false,
"type": "SearchIndexTool",
"parameters": {
"input": "{\"index\": \"my_test_data\", \"query\": {\"size\": 3, \"query\": {\"neural\": {\"embedding\": {\"query_text\": \"${parameters.question}\", \"model_id\": \"Yg7HZo0B9ggZeh2gYjtu_2\", \"k\": 3}}}}}"
}
}
]
}
}
]
}
}

Response fields​

For response field descriptions, see Register Agent API request fields.