Get an agent

Introduced 2.13

You can retrieve agent information using the agent_id.

Path and HTTP methods

  1. GET /_plugins/_ml/agents/<agent_id>

Path parameters

The following table lists the available path parameters.

ParameterData typeDescription
agent_idStringThe agent ID of the agent to retrieve.

Example request

  1. GET /_plugins/_ml/agents/N8AE1osB0jLkkocYjz7D

copy

Example response

  1. {
  2. "name": "Test_Agent_For_RAG",
  3. "type": "flow",
  4. "description": "this is a test agent",
  5. "tools": [
  6. {
  7. "type": "VectorDBTool",
  8. "parameters": {
  9. "input": "${parameters.question}",
  10. "source_field": """["text"]""",
  11. "embedding_field": "embedding",
  12. "index": "my_test_data",
  13. "model_id": "zBRyYIsBls05QaITo5ex"
  14. },
  15. "include_output_in_agent_response": false
  16. },
  17. {
  18. "type": "MLModelTool",
  19. "description": "A general tool to answer any question",
  20. "parameters": {
  21. "model_id": "ygAzT40Bdo8gePIqxk0H",
  22. "prompt": """
  23. Human:You are a professional data analyst. You will always answer question based on the given context first. If the answer is not directly shown in the context, you will analyze the data and find the answer. If you don't know the answer, just say don't know.
  24. Context:
  25. ${parameters.VectorDBTool.output}
  26. Human:${parameters.question}
  27. Assistant:"""
  28. },
  29. "include_output_in_agent_response": false
  30. }
  31. ],
  32. "created_time": 1706821658743,
  33. "last_updated_time": 1706821658743
  34. }

Response fields

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