You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _automating-configurations/workflow-tutorial.md
+20-20
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,10 @@ The setup requires the following sequence of API requests, with provisioned reso
16
16
*[`deploy_model_3`](#deploy_model_3): Deploy the model.
17
17
1.**Use the deployed model for inference**
18
18
* Set up several tools that perform specific tasks:
19
-
*[`cat_index_tool`](#cat_index_tool): Set up a tool to obtain index information.
19
+
*[`list_index_tool`](#list_index_tool): Set up a tool to obtain index information.
20
20
*[`ml_model_tool`](#ml_model_tool): Set up a machine learning (ML) model tool.
21
21
* Set up one or more agents that use some combination of the tools:
22
-
*[`sub_agent`](#sub_agent): Create an agent that uses the `cat_index_tool`.
22
+
*[`sub_agent`](#sub_agent): Create an agent that uses the `list_index_tool`.
23
23
* Set up tools representing these agents:
24
24
*[`agent_tool`](#agent_tool): Wrap the `sub_agent` so that you can use it as a tool.
25
25
*[`root_agent`](#root_agent): Set up a root agent that may delegate the task to either a tool or another agent.
@@ -119,17 +119,17 @@ If you define `previous_node_inputs`, then defining edges is optional.
119
119
A CoT agent can use the deployed model in a tool. This step doesn’t strictly correspond to an API but represents a component of the body required by the [Register Agent API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/). This simplifies the register request and allows reuse of the same tool in multiple agents. For more information about agents and tools, see [Agents and tools]({{site.url}}{{site.baseurl}}/ml-commons-plugin/).
120
120
121
121
<!-- vale off -->
122
-
### cat_index_tool
122
+
### list_index_tool
123
123
<!-- vale on -->
124
124
125
-
You can configure other tools to be used by the CoT agent. For example, you can configure a `cat_index_tool` as follows. This tool does not depend on any previous steps:
125
+
You can configure other tools to be used by the CoT agent. For example, you can configure a `list_index_tool` as follows. This tool does not depend on any previous steps:
126
126
127
127
```yaml
128
-
- id: cat_index_tool
128
+
- id: list_index_tool
129
129
type: create_tool
130
130
user_inputs:
131
-
name: CatIndexTool
132
-
type: CatIndexTool
131
+
name: ListIndexTool
132
+
type: ListIndexTool
133
133
parameters:
134
134
max_iteration: 5
135
135
```
@@ -138,15 +138,15 @@ You can configure other tools to be used by the CoT agent. For example, you can
138
138
### sub_agent
139
139
<!-- vale on -->
140
140
141
-
To use the `cat_index_tool` in the agent configuration, specify it as one of the tools in the `previous_node_inputs` field of the agent. You can add other tools to `previous_node_inputs` as necessary. The agent also needs a large language model (LLM) in order to reason with the tools. The LLM is defined by the `llm.model_id` field. This example assumes that the `model_id` from the `deploy_model_3` step will be used. However, if another model is already deployed, the `model_id` of that previously deployed model could be included in the `user_inputs` field instead:
141
+
To use the `list_index_tool` in the agent configuration, specify it as one of the tools in the `previous_node_inputs` field of the agent. You can add other tools to `previous_node_inputs` as necessary. The agent also needs a large language model (LLM) in order to reason with the tools. The LLM is defined by the `llm.model_id` field. This example assumes that the `model_id` from the `deploy_model_3` step will be used. However, if another model is already deployed, the `model_id` of that previously deployed model could be included in the `user_inputs` field instead:
142
142
143
143
```yaml
144
144
- id: sub_agent
145
145
type: register_agent
146
146
previous_node_inputs:
147
147
# When llm.model_id is not present this can be used as a fallback value
148
148
deploy-model-3: model_id
149
-
cat_index_tool: tools
149
+
list_index_tool: tools
150
150
user_inputs:
151
151
name: Sub Agent
152
152
type: conversational
@@ -164,7 +164,7 @@ To use the `cat_index_tool` in the agent configuration, specify it as one of the
164
164
OpenSearch will automatically create the following edges so that the agent can retrieve the fields from the previous node:
165
165
166
166
```yaml
167
-
- source: cat_index_tool
167
+
- source: list_index_tool
168
168
dest: sub_agent
169
169
- source: deploy_model_3
170
170
dest: sub_agent
@@ -322,19 +322,19 @@ workflows:
322
322
# For example purposes, the model_id obtained as the output of the deploy_model_3 step will be used
323
323
# for several below steps. However, any other deployed model_id can be used for those steps.
324
324
# This is one example tool from the Agent Framework.
325
-
- id: cat_index_tool
325
+
- id: list_index_tool
326
326
type: create_tool
327
327
user_inputs:
328
-
name: CatIndexTool
329
-
type: CatIndexTool
328
+
name: ListIndexTool
329
+
type: ListIndexTool
330
330
parameters:
331
331
max_iteration: 5
332
332
# This simple agent only has one tool, but could be configured with many tools
333
333
- id: sub_agent
334
334
type: register_agent
335
335
previous_node_inputs:
336
336
deploy-model-3: model_id
337
-
cat_index_tool: tools
337
+
list_index_tool: tools
338
338
user_inputs:
339
339
name: Sub Agent
340
340
type: conversational
@@ -394,7 +394,7 @@ workflows:
394
394
dest: register_model_2
395
395
- source: register_model_2
396
396
dest: deploy_model_3
397
-
- source: cat_index_tool
397
+
- source: list_index_tool
398
398
dest: sub_agent
399
399
- source: deploy_model_3
400
400
dest: sub_agent
@@ -479,11 +479,11 @@ The following is the same template in JSON format:
479
479
}
480
480
},
481
481
{
482
-
"id": "cat_index_tool",
482
+
"id": "list_index_tool",
483
483
"type": "create_tool",
484
484
"user_inputs": {
485
-
"name": "CatIndexTool",
486
-
"type": "CatIndexTool",
485
+
"name": "ListIndexTool",
486
+
"type": "ListIndexTool",
487
487
"parameters": {
488
488
"max_iteration": 5
489
489
}
@@ -494,7 +494,7 @@ The following is the same template in JSON format:
494
494
"type": "register_agent",
495
495
"previous_node_inputs": {
496
496
"deploy-model-3": "llm.model_id",
497
-
"cat_index_tool": "tools"
497
+
"list_index_tool": "tools"
498
498
},
499
499
"user_inputs": {
500
500
"name": "Sub Agent",
@@ -581,7 +581,7 @@ The following is the same template in JSON format:
Copy file name to clipboardExpand all lines: _ml-commons-plugin/agents-tools/index.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ redirect_from:
12
12
**Introduced 2.13**
13
13
{: .label .label-purple }
14
14
15
-
You can automate machine learning (ML) tasks using agents and tools. An _agent_ orchestrates and runs ML models and tools. A _tool_ performs a set of specific tasks. Some examples of tools are the `VectorDBTool`, which supports vector search, and the `CATIndexTool`, which executes the `cat indices` operation. For a list of supported tools, see [Tools]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/index/).
15
+
You can automate machine learning (ML) tasks using agents and tools. An _agent_ orchestrates and runs ML models and tools. A _tool_ performs a set of specific tasks. Some examples of tools are the `VectorDBTool`, which supports vector search, and the `ListIndexTool`, which executes the `cat indices` operation. For a list of supported tools, see [Tools]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/index/).
16
16
17
17
## Agents
18
18
@@ -109,7 +109,7 @@ Assistant:"""
109
109
110
110
### Conversational agents
111
111
112
-
Similarly to a conversational flow agent, a conversational agent stores the conversation in an index, in the following example, the `conversation_index`. A conversational agent can be configured with an LLM and a set of supplementary tools that perform specific jobs. For example, you can set up an LLM and a `CATIndexTool` when configuring an agent. When you send a question to the model, the agent also includes the `CATIndexTool` as context. The LLM then decides whether it needs to use the `CATIndexTool` to answer questions like "How many indexes are in my cluster?" The context allows an LLM to answer specific questions that are outside of its knowledge base. For example, the following agent is configured with an LLM and a `CATIndexTool` that retrieves information about your OpenSearch indexes:
112
+
Similarly to a conversational flow agent, a conversational agent stores the conversation in an index, in the following example, the `conversation_index`. A conversational agent can be configured with an LLM and a set of supplementary tools that perform specific jobs. For example, you can set up an LLM and a `ListIndexTool` when configuring an agent. When you send a question to the model, the agent also includes the `ListIndexTool` as context. The LLM then decides whether it needs to use the `ListIndexTool` to answer questions like "How many indexes are in my cluster?" The context allows an LLM to answer specific questions that are outside of its knowledge base. For example, the following agent is configured with an LLM and a `ListIndexTool` that retrieves information about your OpenSearch indexes:
113
113
114
114
```json
115
115
POST /_plugins/_ml/agents/_register
@@ -142,7 +142,7 @@ POST /_plugins/_ml/agents/_register
142
142
}
143
143
},
144
144
{
145
-
"type": "CatIndexTool",
145
+
"type": "ListIndexTool",
146
146
"name": "RetrieveIndexMetaTool",
147
147
"description": "Use this tool to get OpenSearch index information: (health, status, index, uuid, primary count, replica count, docs.count, docs.deleted, store.size, primary.store.size)."
Copy file name to clipboardExpand all lines: _ml-commons-plugin/agents-tools/tools/index.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -32,10 +32,10 @@ Each tool takes a list of parameters specific to that tool. In the preceding exa
32
32
|Tool | Description |
33
33
|:--- |:--- |
34
34
|[`AgentTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/agent-tool/)|Runs any agent. |
35
-
|[`CatIndexTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/cat-index-tool/)|Retrieves index information for the OpenSearch cluster. |
36
35
|[`ConnectorTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/connector-tool/)| Uses a [connector]({{site.url}}{{site.baseurl}}/ml-commons-plugin/remote-models/connectors/) to call any REST API function. |
37
-
|[`IndexMappingTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/index-mapping-tool/)|Retrieves index mapping and setting information for an index. |
38
36
|[`CreateAnomalyDetectorTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/create-anomaly-detector/)| Enables an LLM to suggest required parameters for creating an anomaly detector. |
37
+
|[`IndexMappingTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/index-mapping-tool/)|Retrieves index mapping and setting information for an index. |
38
+
|[`ListIndexTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/list-index-tool/)|Retrieves index information for the OpenSearch cluster. Introduced in OpenSearch version 3.0 as a replacement for the `CatIndexTool`. |
|[`PPLTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/ppl-tool/)|Translates natural language into a Piped Processing Language (PPL) query. |
Copy file name to clipboardExpand all lines: _ml-commons-plugin/agents-tools/tools/list-index-tool.md
+16-12
Original file line number
Diff line number
Diff line change
@@ -1,35 +1,38 @@
1
1
---
2
2
layout: default
3
-
title: CAT Index tool
3
+
title: List Index tool
4
4
has_children: false
5
5
has_toc: false
6
-
nav_order: 20
6
+
nav_order: 35
7
7
parent: Tools
8
8
grand_parent: Agents and tools
9
9
---
10
10
11
11
<!-- vale off -->
12
-
# CAT Index tool
13
-
**Introduced 2.13**
12
+
# List Index tool
13
+
**Introduced 3.0**
14
14
{: .label .label-purple }
15
15
<!-- vale on -->
16
16
17
-
The `CatIndexTool` retrieves index information for the OpenSearch cluster, similarly to the [CAT Indices API]({{site.url}}{{site.baseurl}}/api-reference/cat/cat-indices/).
17
+
The `ListIndexTool` retrieves index information for the OpenSearch cluster, similarly to the [List Indices API]({{site.url}}{{site.baseurl}}/api-reference/list/list-indices/).
18
18
19
-
## Step 1: Register a flow agent that will run the CatIndexTool
19
+
The `ListIndexTool` replaces the `CatIndexTool` starting with OpenSearch version 3.0.
20
+
{: .note}
21
+
22
+
## Step 1: Register a flow agent that will run the ListIndexTool
20
23
21
24
A flow agent runs a sequence of tools in order and returns the last tool's output. To create a flow agent, send the following register agent request:
22
25
23
26
```json
24
27
POST /_plugins/_ml/agents/_register
25
28
{
26
-
"name": "Test_Agent_For_CatIndex_tool",
29
+
"name": "Test_Agent_For_ListIndex_tool",
27
30
"type": "flow",
28
-
"description": "this is a test agent for the CatIndexTool",
31
+
"description": "this is a test agent for the ListIndexTool",
29
32
"tools": [
30
33
{
31
-
"type": "CatIndexTool",
32
-
"name": "DemoCatIndexTool",
34
+
"type": "ListIndexTool",
35
+
"name": "DemoListIndexTool",
33
36
"parameters": {
34
37
"input": "${parameters.question}"
35
38
}
@@ -118,8 +121,9 @@ The following table lists all tool parameters that are available when registerin
118
121
Parameter | Type | Required/Optional | Description
119
122
:--- | :--- | :--- | :---
120
123
`input` | String | Required | The user input used to return index information.
121
-
`index` | String | Optional | A comma-delimited list of one or more indexes on which to run the CAT operation. Default is an empty list, which means all indexes.
122
-
`local` | Boolean | Optional | When `true`, retrieves information from the local node only instead of the cluster manager node (default is `false`).
124
+
`indices` | String | Optional | A comma-delimited list of one or more indexes on which to run the list index operation. Default is an empty list, which means all indexes.
125
+
`local` | Boolean | Optional | When `true`, retrieves information from the local node only instead of the cluster manager node. Default is `false`.
126
+
`page_size` | Integer | Optional | Specifies the number of index results returned per page when using the List Indices API. The API retrieves index status in a paginated manner. Default is `100`.
Copy file name to clipboardExpand all lines: _tutorials/gen-ai/chatbots/build-chatbot.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -279,7 +279,7 @@ POST _plugins/_ml/agents/_register
279
279
}
280
280
},
281
281
{
282
-
"type": "CatIndexTool",
282
+
"type": "ListIndexTool",
283
283
"description": "Use this tool to get OpenSearch index information: (health, status, index, uuid, primary count, replica count, docs.count, docs.deleted, store.size, primary.store.size). \nIt takes 2 optional arguments named `index` which is a comma-delimited list of one or more indices to get information from (default is an empty list meaning all indices), and `local` which means whether to return information from the local node only instead of the cluster manager node (default is false)."
284
284
},
285
285
{
@@ -313,7 +313,7 @@ Note the following testing tips:
313
313
- Avoid configuring many tools in an agent.
314
314
- Provide a detailed tool description clarifying what the tool can do.
315
315
- Specify the tool to use in the LLM question, for example, `Can you use the PPLTool to query the opensearch_dashboards_sample_data_ecommerce index so it can calculate how many orders were placed last week?`.
316
-
- Specify the tool to use when executing an agent. For example, specify that only `PPLTool` and `CatIndexTool` should be used to process the current request.
316
+
- Specify the tool to use when executing an agent. For example, specify that only the `PPLTool` and `ListIndexTool` should be used to process the current request.
317
317
318
318
Test the agent:
319
319
@@ -323,7 +323,7 @@ POST _plugins/_ml/agents/your_agent_id/_execute
323
323
"parameters": {
324
324
"question": "Can you query with index opensearch_dashboards_sample_data_ecommerce to calculate how many orders in last week?",
0 commit comments