Link Search Menu Expand Document Documentation Menu

You're viewing version 3.5 of the OpenSearch documentation. This version is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

List Context Management API

Introduced 3.5

Use this API to retrieve a list of all context management configurations in the cluster.

Endpoints

GET /_plugins/_ml/context_management

Query parameters

The following table lists the available query parameters.

Parameter Data type Required/Optional Description
size Integer Optional The maximum number of results to return. Default is 10.
from Integer Optional The starting index for pagination. Default is 0.

Example request

GET /_plugins/_ml/context_management

Example request with pagination

GET /_plugins/_ml/context_management?size=20&from=0

Example response

{
  "total": 1,
  "context_management": [
    {
      "name": "sliding_window_max_40000_tokens_managers",
      "description": "Context management for truncating tool outputs to prevent input length issues",
      "hooks": {
        "pre_llm": [
          {
            "type": "SlidingWindowManager",
            "config": {
              "max_messages": 8,
              "activation": {
                "rule_type": "always"
              }
            }
          }
        ],
        "post_tool": [
          {
            "type": "ToolsOutputTruncateManager",
            "config": {
              "max_output_length": 40000,
              "activation": {
                "rule_type": "always"
              }
            }
          }
        ]
      },
      "created_time": 1769457277774,
      "last_modified": 1769457277774
    }
  ]
}

For more information, see Context management.

350 characters left

Have a question? .

Want to contribute? or .