DataAgent

Updated at:

DataAgent is the data analysis feature of MaxAgent, the AI assistant of MaxCompute. DataAgent uses natural language to find data, query business metrics, and analyze results. A published semantic package can also be selected to reuse the business definitions confirmed by a team. This topic describes the main features, use cases, and entry point of DataAgent.

Features

DataAgent views table and field information based on a question, generates and runs Structured Query Language (SQL) statements, and then explains the query results. Time ranges, filter conditions, and metric definitions can be added during the conversation to clarify the analysis requirements step by step.

Feature

Description

Data discovery and exploration

Finds tables related to an analysis topic and views their fields, partitions, and available data to determine the analysis scope.

Natural language data retrieval

Generates SQL based on a question, performs filtering, aggregation, and multi-table joins, and displays the query results.

Metric analysis and data checks

Compares metrics across time periods or dimensions and checks for duplicate records, missing values, and data granularity after joins.

Result explanation and review

Explains the calculation definitions and query results, and provides the SQL that is actually run to help verify time, filter, and deduplication rules.

Use cases

  • Query business metrics: After the analysis question is clear, provide DataAgent with the project, time range, and metric requirements. For example, calculate the number of valid orders, the number of distinct buyers, and the payment amount for each channel, and specify whether to exclude refunded orders.

  • Compare metric changes: Compare results by date, channel, or other business dimensions to identify where the differences are concentrated. Determining the causes of the differences also requires business information and cannot be based on aggregated data alone.

  • Verify data definitions: Check whether duplicate records, null values, and table joins affect the statistics. For example, if the order table stores multiple status snapshots, require that the latest status of each order be obtained first and then the number of valid orders be calculated.

Use DataAgent with semantic packages

A semantic package stores metric definitions, business terms, table relationships, and analysis rules. During analysis, DataAgent can read the published semantic content so that the business definitions commonly used by a team have a documented basis. Semantic packages are optional. Without a semantic package, the required tables, fields, and business rules can be specified directly in the question.

If a semantic package applies to the current question, select the semantic package in the conversation and ask DataAgent to explain the business definitions that it uses. After a semantic package is used, the SQL that is actually run and the query results still need to be verified. To adjust business definitions, the maintainer of the semantic package modifies and republishes the package. For more information about the features, limits, and permission configuration of semantic packages, see semantic package overview.

Entry point

Before the first use, see MaxAgent to activate the service, configure account permissions, and learn about billing.

  1. Log in to the MaxCompute console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose AI Assistant > DataAgent. In the toolbar at the bottom of the message input box, select the MaxCompute project and schema (if schema-level syntax is enabled) for the current data analysis.

  3. Ask a business question. In the question, specify the project, the table or business topic, the time range, the metric definitions, and the expected results. To reproduce a complete analysis workflow that uses a semantic package, see Manage and use semantic packages in the console.

Limits

  • The semantic package selector of the current session in the console allows only one package to be selected at a time. After the project or semantic package is switched, the change takes effect for subsequent questions.

  • DataAgent uses the data that the current identity is authorized to access. Selecting a semantic package does not grant additional query permissions on the underlying tables.

  • Analysis results depend on the source data, business rules, and the SQL that is actually run. Before the results are used, verify the statistical scope, filter conditions, and deduplication method.