From 4f0472e2b807fc549b5b0ac81a05ad1c5489d05a Mon Sep 17 00:00:00 2001 From: yuye-aws Date: Tue, 5 Nov 2024 18:53:28 +0800 Subject: [PATCH 1/4] fix doc for alert summary and insight Signed-off-by: yuye-aws --- _dashboards/dashboards-assistant/alert-insight.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/_dashboards/dashboards-assistant/alert-insight.md b/_dashboards/dashboards-assistant/alert-insight.md index 26d21dda41f..3bccca61f11 100644 --- a/_dashboards/dashboards-assistant/alert-insight.md +++ b/_dashboards/dashboards-assistant/alert-insight.md @@ -41,7 +41,7 @@ To orchestrate alert insights, you'll need to create the necessary [agents]({{si {: .text-delta} ```json -POST /_plugins/_ml/agents/_register +POST /_plugins/_flow_framework/workflow?provision=true { "name": "Alert Summary Agent", "description": "Create Alert Summary Agent using Claude on BedRock", @@ -70,7 +70,7 @@ POST /_plugins/_ml/agents/_register "content-type": "application/json" }, "method": "POST", - "request_body": "{\"prompt\":\"${parameters.prompt}\", \"max_tokens_to_sample\":${parameters.max_tokens_to_sample}, \"temperature\":${parameters.temperature}, \"anthropic_version\":\"${parameters.anthropic_version}\" }", + "request_body": "{\"prompt\":\"\\n\\nHuman: ${parameters.prompt}\\n\\nAssistant:\", \"max_tokens_to_sample\":${parameters.max_tokens_to_sample}, \"temperature\":${parameters.temperature}, \"anthropic_version\":\"${parameters.anthropic_version}\" }", "action_type": "predict", "url": "https://bedrock-runtime.us-west-2.amazonaws.com/model/anthropic.claude-instant-v1/invoke" } @@ -141,13 +141,14 @@ POST /_plugins/_ml/agents/_register -For sample agent templates, see [Flow Framework sample templates](https://github.com/opensearch-project/flow-framework/tree/main/sample-templates). Note the agent ID; you'll use it in the following step. +For sample agent templates, see [Flow Framework sample templates](https://github.com/opensearch-project/flow-framework/tree/2.x/sample-templates). Note the agent ID; you'll use it in the following step. For this example, use the templates to create the following agents: - An alert insights agent - Two summary agents: - - A basic alert summary agent - - An agent for an alert summary that includes log patterns + - A basic alert summary agent see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/alert-summary-agent-claude-tested.json) + - An agent for alert insight, see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/create-knowledge-base-alert-agent.json) + - An agent for an alert summary that includes log patterns, see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/alert-summary-log-pattern-agent.json) These agents require different prompts. The prompt for the log patterns summary must include a placeholder `${parameters.topNLogPatternData}` and additional instructions to guide the LLM on using this information effectively. Note that log patterns are available only for query monitors created using OpenSearch Dashboards. @@ -194,7 +195,7 @@ POST /.plugins-ml-config/_doc/os_insight ``` {% include copy-curl.html %} -The created `os_insight` agent provides alert insights related to OpenSearch cluster metrics. For insights about alerts unrelated to OpenSearch cluster metrics, you need to register an agent with [this template](https://github.com/opensearch-project/flow-framework/blob/main/sample-templates/create-knowledge-base-alert-agent.json) and change the agent name to `KB_For_Alert_Insight`. +The created `os_insight` agent provides alert insights related to OpenSearch cluster metrics. For insights about alerts unrelated to OpenSearch cluster metrics, you need to register an agent with [this template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/create-knowledge-base-alert-agent.json) and change the agent name to `KB_For_Alert_Insight`. {: .note} ### Step 4: Test the agents From b5bf4450747b05db61ca0e9eb48bc15aa99e29c6 Mon Sep 17 00:00:00 2001 From: yuye-aws Date: Tue, 5 Nov 2024 18:59:54 +0800 Subject: [PATCH 2/4] fix doc Signed-off-by: yuye-aws --- _dashboards/dashboards-assistant/alert-insight.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/_dashboards/dashboards-assistant/alert-insight.md b/_dashboards/dashboards-assistant/alert-insight.md index 3bccca61f11..ecee2101d66 100644 --- a/_dashboards/dashboards-assistant/alert-insight.md +++ b/_dashboards/dashboards-assistant/alert-insight.md @@ -144,10 +144,9 @@ POST /_plugins/_flow_framework/workflow?provision=true For sample agent templates, see [Flow Framework sample templates](https://github.com/opensearch-project/flow-framework/tree/2.x/sample-templates). Note the agent ID; you'll use it in the following step. For this example, use the templates to create the following agents: -- An alert insights agent +- An alert insights agent, see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/create-knowledge-base-alert-agent.json) - Two summary agents: - A basic alert summary agent see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/alert-summary-agent-claude-tested.json) - - An agent for alert insight, see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/create-knowledge-base-alert-agent.json) - An agent for an alert summary that includes log patterns, see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/alert-summary-log-pattern-agent.json) These agents require different prompts. The prompt for the log patterns summary must include a placeholder `${parameters.topNLogPatternData}` and additional instructions to guide the LLM on using this information effectively. Note that log patterns are available only for query monitors created using OpenSearch Dashboards. From 5788b3a41c1677eb458b0f3e77e65dfb9f54598f Mon Sep 17 00:00:00 2001 From: yuye-aws Date: Tue, 5 Nov 2024 19:03:52 +0800 Subject: [PATCH 3/4] change main branch to 2.x branch Signed-off-by: yuye-aws --- _dashboards/dashboards-assistant/data-summary.md | 2 +- _dashboards/dashboards-assistant/suggest-anomaly-detector.md | 2 +- _dashboards/dashboards-assistant/text-to-visualization.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_dashboards/dashboards-assistant/data-summary.md b/_dashboards/dashboards-assistant/data-summary.md index 92bc3aad085..78fd8dc4465 100644 --- a/_dashboards/dashboards-assistant/data-summary.md +++ b/_dashboards/dashboards-assistant/data-summary.md @@ -220,7 +220,7 @@ POST /_plugins/_ml/agents/_register -For sample agent templates, see [Flow Framework sample templates](https://github.com/opensearch-project/flow-framework/tree/main/sample-templates). Note the agent ID; you'll use it in the following step. +For sample agent templates, see [Flow Framework sample templates](https://github.com/opensearch-project/flow-framework/tree/2.x/sample-templates). Note the agent ID; you'll use it in the following step. ### Step 3: Create a root agent diff --git a/_dashboards/dashboards-assistant/suggest-anomaly-detector.md b/_dashboards/dashboards-assistant/suggest-anomaly-detector.md index 91fa6d60422..b7a8364b0ee 100644 --- a/_dashboards/dashboards-assistant/suggest-anomaly-detector.md +++ b/_dashboards/dashboards-assistant/suggest-anomaly-detector.md @@ -38,7 +38,7 @@ assistant.smartAnomalyDetector.enabled: true To orchestrate anomaly detector suggestions, create an `os_suggest_ad` agent. To create an agent, send a `POST /_plugins/_ml/agents/_register` request and provide the agent template as a payload. For more information, see [Configuring OpenSearch Assistant]({{site.url}}{{site.baseurl}}/dashboards/dashboards-assistant/index/#configuring-opensearch-assistant). -For sample agent templates, see [Flow Framework sample templates](https://github.com/opensearch-project/flow-framework/tree/main/sample-templates). Note the agent ID; you'll use it in the following step. +For sample agent templates, see [Flow Framework sample templates](https://github.com/opensearch-project/flow-framework/tree/2.x/sample-templates). Note the agent ID; you'll use it in the following step. ### Step 3: Configure the agent diff --git a/_dashboards/dashboards-assistant/text-to-visualization.md b/_dashboards/dashboards-assistant/text-to-visualization.md index 97237f678a1..4d98860727c 100644 --- a/_dashboards/dashboards-assistant/text-to-visualization.md +++ b/_dashboards/dashboards-assistant/text-to-visualization.md @@ -46,7 +46,7 @@ View the status of the workflow, and you can find all created resources includes /_plugins/_flow_framework/workflow//_status ``` -For sample agent templates, see [Flow Framework sample templates](https://github.com/opensearch-project/flow-framework/tree/main/sample-templates). Note the agent ID; you'll use it in the following step. +For sample agent templates, see [Flow Framework sample templates](https://github.com/opensearch-project/flow-framework/tree/2.x/sample-templates). Note the agent ID; you'll use it in the following step. ### Step 3: Configure the root agent From f042b379ae23e46f1c875f553e8665681e0b1149 Mon Sep 17 00:00:00 2001 From: yuye-aws Date: Tue, 5 Nov 2024 19:04:20 +0800 Subject: [PATCH 4/4] small fix Signed-off-by: yuye-aws --- _dashboards/dashboards-assistant/alert-insight.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_dashboards/dashboards-assistant/alert-insight.md b/_dashboards/dashboards-assistant/alert-insight.md index ecee2101d66..d825a2dd343 100644 --- a/_dashboards/dashboards-assistant/alert-insight.md +++ b/_dashboards/dashboards-assistant/alert-insight.md @@ -146,7 +146,7 @@ For sample agent templates, see [Flow Framework sample templates](https://github For this example, use the templates to create the following agents: - An alert insights agent, see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/create-knowledge-base-alert-agent.json) - Two summary agents: - - A basic alert summary agent see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/alert-summary-agent-claude-tested.json) + - A basic alert summary agent, see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/alert-summary-agent-claude-tested.json) - An agent for an alert summary that includes log patterns, see [flow template](https://github.com/opensearch-project/flow-framework/blob/2.x/sample-templates/alert-summary-log-pattern-agent.json) These agents require different prompts. The prompt for the log patterns summary must include a placeholder `${parameters.topNLogPatternData}` and additional instructions to guide the LLM on using this information effectively. Note that log patterns are available only for query monitors created using OpenSearch Dashboards.