Get message traces

Introduced 2.12

Use this API to retrieve message trace information for conversational search. This can be useful for debugging.

For each message, an agent may need to run different tools. You can use the Get Traces API to get all trace data for a message. The trace data includes detailed steps of a message execution.

When the Security plugin is enabled, all memories exist in a private security mode. Only the user who created a memory can interact with that memory and its messages.

Path and HTTP methods

  1. GET /_plugins/_ml/memory/message/<message_id>/traces

Path parameters

The following table lists the available path parameters.

ParameterData typeDescription
message_idStringThe ID of the message to trace.

Example request

  1. GET /_plugins/_ml/memory/message/TAuCZY0BT2tRrkdmCPqZ/traces

copy

Example response

  1. {
  2. "traces": [
  3. {
  4. "memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
  5. "message_id": "TQuCZY0BT2tRrkdmEvpp",
  6. "create_time": "2024-02-01T16:30:39.719968032Z",
  7. "input": "Which index has most documents",
  8. "prompt_template": null,
  9. "response": "Let me check the document counts of each index",
  10. "origin": null,
  11. "additional_info": {},
  12. "parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
  13. "trace_number": 1
  14. },
  15. {
  16. "memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
  17. "message_id": "TguCZY0BT2tRrkdmEvp7",
  18. "create_time": "2024-02-01T16:30:39.732979687Z",
  19. "input": "",
  20. "prompt_template": null,
  21. "response": """health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
  22. green open .plugins-ml-model-group lHgGEgJhT_mpADyOZoXl2g 1 1 9 2 33.4kb 16.7kb
  23. green open .plugins-ml-memory-meta b2LEpv0QS8K60QBjXtRm6g 1 1 13 0 117.5kb 58.7kb
  24. green open .ql-datasources 9NXm_tMXQc6s_4uRToSNkQ 1 1 0 0 416b 208b
  25. green open sample-ecommerce UPYOQcAfRGqFAlSxcZlRjw 1 1 40320 0 4.1mb 2mb
  26. green open .plugins-ml-task xYTlprYCQnaaYici69SOjA 1 1 117 0 115.5kb 57.6kb
  27. green open .opendistro_security 7DAqhm9QQmeEsQYhA40cJg 1 1 10 0 117kb 58.5kb
  28. green open sample-host-health Na5tq6UiTt6r_qYME1vV-w 1 1 40320 0 2.6mb 1.3mb
  29. green open .opensearch-observability 6PthtLluSKyYCdZR3Mw0iw 1 1 0 0 416b 208b
  30. green open .plugins-ml-model WYcjBHcnRuSDHeVWPVupoA 1 1 191 45 4.2gb 2.1gb
  31. green open index_for_neural_sparse GQswGabQRIazM_trnqaDrw 1 1 5 0 28.4kb 14.2kb
  32. green open security-auditlog-2024.01.30 BhXR7Nd3QVOVGxJNpR0-jw 1 1 27768 0 13.8mb 7mb
  33. green open sample-http-responses 0gmYYYdOTiCbVUvl_uDL0w 1 1 40320 0 2.5mb 1.2mb
  34. green open security-auditlog-2024.02.01 2VD1ieDGS5m-TfjIdfT8Eg 1 1 36386 0 37mb 18.2mb
  35. green open opensearch_dashboards_sample_data_ecommerce wnE6r7OvSPqc5YHj8wHSLA 1 1 4675 0 8.8mb 4.4mb
  36. green open security-auditlog-2024.01.31 cNRK5-2eTwes0SRlXTl0RQ 1 1 34520 0 20.5mb 9.8mb
  37. green open .plugins-ml-memory-message wTNBU4BBQVSFcFhNlUdfBQ 1 1 88 1 399.7kb 205kb
  38. green open .plugins-flow-framework-state dJUNDv9MSJ2jjwKbzXPlrw 1 1 39 0 114.1kb 57kb
  39. green open .plugins-ml-agent 7X1IzoLuSGmIujOh9i5mmg 1 1 27 0 146.6kb 73.3kb
  40. green open .plugins-flow-framework-templates _ecC0KahTlmG_3tFUst7Uw 1 1 18 0 175.8kb 87.9kb
  41. green open .plugins-ml-connector q45iJfVjQ5KgxeNC65DLSw 1 1 11 0 313.1kb 156.5kb
  42. green open .kibana_1 vRjXK4bHSUueB_4iXiQ8yw 1 1 257 0 264kb 132kb
  43. green open .plugins-ml-config G7gxGQB7TZeQzBasHd5PUg 1 1 1 0 7.8kb 3.9kb
  44. green open .plugins-ml-controller NQTZPREZRhWoDdjCglRLFg 1 1 0 0 50.1kb 49.9kb
  45. green open opensearch_dashboards_sample_data_logs 9gpOTB3rRgqBLvqis_k5LQ 1 1 14074 0 18mb 9mb
  46. green open .plugins-flow-framework-config JlKPsCh6SEq-Jh6rPL_x9Q 1 1 1 0 7.8kb 3.9kb
  47. green open opensearch_dashboards_sample_data_flights pJde0irnTce4-uobHwYmMQ 1 1 13059 0 11.9mb 5.9mb
  48. green open my_test_data T4hwNs7CTJGIfw2QpCqQ_Q 1 1 6 0 91.7kb 45.8kb
  49. green open .opendistro-job-scheduler-lock XjgmXAVKQ4e8Y-ac54VBzg 1 1 3 0 38.7kb 19.4kb
  50. """,
  51. "origin": "CatIndexTool",
  52. "additional_info": {},
  53. "parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
  54. "trace_number": 2
  55. },
  56. {
  57. "memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
  58. "message_id": "UwuCZY0BT2tRrkdmHPos",
  59. "create_time": "2024-02-01T16:30:42.217897656Z",
  60. "input": "Which index has most documents",
  61. "prompt_template": null,
  62. "response": "Based on the cluster health information provided, the index with the most documents is .plugins-ml-model with 191 documents",
  63. "origin": null,
  64. "additional_info": {},
  65. "parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
  66. "trace_number": 3
  67. },
  68. {
  69. "memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
  70. "message_id": "UQuCZY0BT2tRrkdmHPos",
  71. "create_time": "2024-02-01T16:30:42.218120716Z",
  72. "input": "Which index has most documents",
  73. "prompt_template": null,
  74. "response": "The index with the most documents is the .plugins-ml-model index, which contains 191 documents based on the cluster health information provided.",
  75. "origin": null,
  76. "additional_info": {},
  77. "parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
  78. "trace_number": 4
  79. },
  80. {
  81. "memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
  82. "message_id": "UguCZY0BT2tRrkdmHPos",
  83. "create_time": "2024-02-01T16:30:42.218240713Z",
  84. "input": "Which index has most documents",
  85. "prompt_template": null,
  86. "response": "The index with the most documents is the .plugins-ml-model index, which contains 191 documents based on the cluster health information provided.",
  87. "origin": null,
  88. "additional_info": {},
  89. "parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
  90. "trace_number": 5
  91. }
  92. ]
  93. }

Response fields

For information about response fields, see Create Message request fields.