Operations 10 min read

Agent + CLI + Skill: The Architecture Behind Huawei DWS AI Diagnostics

Huawei Cloud DWS introduces an AI diagnostic feature using a three-layer Agent-CLI-Skill architecture that automates the data warehouse troubleshooting loop—collection, analysis, root-cause reasoning, and reporting—turning expert DBA knowledge into reusable, pluggable skills that cut diagnosis time from hours to minutes.

Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Agent + CLI + Skill: The Architecture Behind Huawei DWS AI Diagnostics

Overview

Huawei Cloud Data Warehouse Service (DWS) recently launched an AI diagnosis capability built on a three-layer architecture: Agent + CLI + Skill . This architecture systematizes, automates, and makes evolvable the classic operations loop of information gathering → pattern recognition → root-cause reasoning → solution output , which traditionally relies heavily on individual DBA experience—manual terminal logins, running dozens of CLI commands, and mentally correlating multi-dimensional metrics—taking tens of minutes to hours per incident.

Architecture Layers

CLI Layer – Responsible for collection . A lightweight, read-only, standardized command set that fetches raw runtime data from the cluster bottom layer. It does not interpret data meaning; it only guarantees accuracy and low overhead.

Skill Layer – Responsible for analysis . Each Skill encapsulates an independent diagnostic capability, including built-in analysis logic, judgment thresholds, and output templates. Skills are decoupled from each other.

Agent Layer – Responsible for orchestration . Receives user requests, decides which CLIs to invoke, which Skills to schedule, how to correlate results, and generates the diagnostic report.

Adding a new diagnostic capability only requires developing and registering a new Skill—no changes to Agent or CLI. Optimizing collection strategies only touches the CLI layer; Skills and Agent remain unaware. Each layer evolves independently.

Design Philosophies

1. Separation of Concerns

Each layer does one thing and interacts via standardized interfaces.

2. Skill as Knowledge Unit

A Skill is not just a functional module; it codifies a seasoned DBA's diagnostic pattern. The first three Skills released:

CPU Diagnosis Skill – Collects CPU utilization, node load distribution, high-consumption SQL; identifies load skew and resource contention; outputs resource optimization and SQL rewrite suggestions.

IO Diagnosis Skill – Analyzes read/write latency, IOPS peaks, data written to disk; correlates high-IO queries; pinpoints root causes like abnormal table scans and sort spills.

Memory Diagnosis Skill – Parses dynamic memory allocation and reclamation; identifies abnormal sessions and SQL; warns of OOM risk; provides parameter tuning and resource isolation plans.

Skills use a plugin design; future extensions (lock-wait diagnosis, long-transaction diagnosis, SQL skew diagnosis, network diagnosis) can be added with zero intrusion to existing architecture.

3. Agent Orchestrates, Does Not Analyze

The Agent is strictly an orchestrator —deciding what to do and in what order —without performing concrete metric calculations or root-cause judgments. This keeps the Agent lightweight and generic; orchestration logic stays stable regardless of how many Skills are added.

4. From Tool to Growable Platform

Skills are reusable – Independent of specific clusters, shareable across clusters, and support user-defined extensions for business scenarios.

CLI is composable – Standardized interfaces can be embedded into existing monitoring/alerting, CI/CD pipelines, or ticketing systems. The CLI module will be officially released, allowing users to build DWS intelligent operations capabilities on their own Agent platforms.

Agent evolves – As Skills grow and experience accumulates, correlation analysis and root-cause reasoning continuously strengthen, moving from "assisted diagnosis" toward "autonomous operations."

Real-World Scenario: CPU Spikes to 96% Caused by a Self-Join SQL

During an evening business peak, a DWS cluster node's CPU usage exceeded 96%, and query response slowed. The operator selected the anomalous time window on the cluster detail page, chose the CPU dimension, and triggered one-click diagnosis. The Agent automatically scheduled the CPU Diagnosis Skill and produced a structured report within minutes.

The report not only pinpointed the defective SQL writing pattern (a self-join consuming all compute) but also proactively discovered cross-layer resource contention risks and provided directly actionable optimization paths. This demonstrates the deeper value: the system doesn't just "look at metrics"—it "understands the business."

Traditional troubleshooting required DBAs to manually log into nodes, run diagnostic commands one by one, switch between multiple terminals, and piece together the full root-cause chain—a time-consuming, error-prone process heavily dependent on individual experience (e.g., another person might not think to check non-database process CPU usage). The AI diagnosis closed the full loop from "anomaly perception" to "root-cause reasoning" to "solution output" in minutes, achieving expert-level quality that is replicable and evolvable.

Availability

The AI diagnosis feature is live in Beijing 4 and Guiyang 1 regions. Access it via the DWS management console → cluster detail page. Some Skills are already published on the Huawei Cloud Skill Market , and developers can build custom diagnostic capabilities on their own Agent platforms using Skill + CLI.

GitHub repository: https://github.com/huaweicloud/huaweicloud-skills/tree/master/skills/bigdata/dws

Conclusion

One Agent, one CLI set, many Skills—the DWS AI diagnosis architecture is not complex, but its design philosophy is clear: use separation of concerns to reduce complexity, turn operations experience into reusable knowledge units via Skills, replace manual stitching with Agent orchestration, and leave room for the future with plugin-based design. From a product experience perspective, operators need only a single click on the cluster detail page to receive a minute-level report containing root-cause analysis and optimization suggestions—behind which the three-layer architecture silently completes the full closed loop. This architecture not only compresses troubleshooting from "hour-level" to "minute-level" but also provides an extensible, evolvable, and accumulable capability framework for intelligent data warehouse operations, moving from "reliance on individuals" to "reliance on platform"—the architectural cornerstone of mature intelligent data warehouses.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

plugin architecturedata warehouseRoot Cause Analysisintelligent operationsHuawei CloudDWSAI diagnosticsAgent-CLI-Skill architecture
Huawei Cloud Developer Alliance
Written by

Huawei Cloud Developer Alliance

The Huawei Cloud Developer Alliance creates a tech sharing platform for developers and partners, gathering Huawei Cloud product knowledge, event updates, expert talks, and more. Together we continuously innovate to build the cloud foundation of an intelligent world.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.