Skip to content

Conversation

@shuangli-z
Copy link
Contributor

@shuangli-z shuangli-z commented Aug 11, 2025

Description

Add index insight feature that aims to improve the understanding of indices for other LLM-based index-related features.
Currently supports three types of insights: statistical data, field description and log related index check.

API examples

  1. Open index insight by
PUT /_plugins/_ml/index_insight_config
{
    "is_enable": true
}

The API will put the index insight config into a system index. Then create an index with the fixed name ml_index_insight to store the index insight.

You can disable the config with the API

PUT /_plugins/_ml/index_insight_config
{
    "is_enable": false
}

Only admin user can change the index insight config.

also, you can check the config through

GET /_plugins/_ml/index_insight_config
  1. Set agent id for index insight feature, the agent will be used to call LLM to generate some descriptive content like field description.
POST /_plugins/_ml/agents/_register
{
  "name": "GENERAL_TOOL",
  "type": "flow",
  "tools": [
    {
      "type": "MLModelTool",
      "description": "A general tool to answer any question",
      "parameters": {
        "model_id": "<model_id>"
      }
    }
  ]
}

PUT /.plugins-ml-config/_doc/os_index_insight_agent
{
    "type": "os_index_insight_agent",
    "configuration": {
    "agent_id": "<agent_id>"
    }
}
  1. Invoke index insight feature
GET /_plugins/_ml/insights/<target_index>/<insight_type>

We also wrap a tool for index insight action to use.

POST /_plugins/_ml/agents/_register
{
  "name": "flow agent with only index insight tool",
  "type": "flow",
  "description": "this is a flow agent which only has a index insight tool",
  "tools": [
    {
      "type": "IndexInsightTool",
      "name": "IndexInsightTool",
      "description": "Use this tool to get details of one index according to different tast type, including STATISTICAL_DATA: the data distribution and index mapping of the index, FIELD_DESCRIPTION: The description of each column, LOG_RELATED_INDEX_CHECK: Whether the index is related to log/trace and whether it contains trace/log fields",
      "attributes": {
                "input_schema": "{\"type\":\"object\",\"properties\":{\"indexName\":{\"description\":\"The index name you want to query with\",\"type\":\"string\"},\"taskType\":{\"description\":\"The task type of index insight, including STATISTICAL_DATA: the data distribution and index mapping of the index, FIELD_DESCRIPTION: The description of each column, LOG_RELATED_INDEX_CHECK: Whether the index is related to log/trace and whether it contains trace/log fields \",\"type\":\"string\"}}}",
                "strict": "false"
              }
    }
  ],
  "app_type": "my_app"
}

and execute by

POST /_plugins/_ml/agents/<agent_id>/_execute
{
  "parameters": {
    "index_name": "<index_name>",
    "task_type": "STATISTICAL_DATA"
  }
}

Related Issues

Resolves #3993

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

shuangli-z and others added 29 commits July 22, 2025 14:57
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
…exInsightTask is now processed one at a time

Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
- TODO: Add prerequisite chain logic

Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: shuangli-z <shualee@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
@shuangli-z shuangli-z requested a review from b4sjoo as a code owner August 11, 2025 08:27
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 17, 2025 08:24 — with GitHub Actions Failure
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 17, 2025 08:28 — with GitHub Actions Failure
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 17, 2025 08:28 — with GitHub Actions Failure
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 17, 2025 08:28 — with GitHub Actions Error
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 17, 2025 08:28 — with GitHub Actions Error
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 18, 2025 02:32 — with GitHub Actions Failure
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 18, 2025 02:32 — with GitHub Actions Failure
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 18, 2025 02:32 — with GitHub Actions Error
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 18, 2025 02:32 — with GitHub Actions Error
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 18, 2025 02:48 — with GitHub Actions Failure
@shuangli-z shuangli-z temporarily deployed to ml-commons-cicd-env-require-approval September 18, 2025 02:48 — with GitHub Actions Inactive
@shuangli-z shuangli-z temporarily deployed to ml-commons-cicd-env-require-approval September 18, 2025 02:48 — with GitHub Actions Inactive
@shuangli-z shuangli-z temporarily deployed to ml-commons-cicd-env-require-approval September 18, 2025 02:48 — with GitHub Actions Inactive
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 18, 2025 04:06 — with GitHub Actions Failure
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 18, 2025 04:06 — with GitHub Actions Failure
zane-neo
zane-neo previously approved these changes Sep 18, 2025
xinyual and others added 2 commits September 18, 2025 17:24
Signed-off-by: xinyual <xinyual@amazon.com>
@shuangli-z shuangli-z temporarily deployed to ml-commons-cicd-env-require-approval September 18, 2025 09:27 — with GitHub Actions Inactive
@shuangli-z shuangli-z temporarily deployed to ml-commons-cicd-env-require-approval September 18, 2025 09:27 — with GitHub Actions Inactive
@shuangli-z shuangli-z temporarily deployed to ml-commons-cicd-env-require-approval September 18, 2025 09:27 — with GitHub Actions Inactive
@shuangli-z shuangli-z temporarily deployed to ml-commons-cicd-env-require-approval September 18, 2025 09:27 — with GitHub Actions Inactive
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 19, 2025 04:15 — with GitHub Actions Failure
@shuangli-z shuangli-z had a problem deploying to ml-commons-cicd-env-require-approval September 19, 2025 04:15 — with GitHub Actions Failure
@xinyual xinyual merged commit 7bf4b54 into opensearch-project:main Sep 19, 2025
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] RFC: Index insight: A feature to enhance indices related AI features

6 participants