Use Meta Agent for asset Q&A

Updated at:
Copy as MD

Asset Q&A is an intelligent query feature of Meta Agent. Based on NL2SQL technology, it converts natural language questions into queries against registered database assets, allowing you to retrieve instance details, schema structures, and data volume statistics without writing SQL.

Prerequisites

  • Make sure that you have activated AI-Native Database Service. For more information, see Activate the service.

  • Make sure that you have added the target database instance to AI-Native Database Service. For more information, see Add and manage data sources.

  • Complete an asset inventory to allow the system to collect database metadata such as schema structures and column comments. This improves the accuracy of Q&A results.

How it works

Asset Q&A uses NL2SQL (Natural Language to SQL) technology to convert your natural language questions into query statements and retrieve results from registered database assets. The accuracy of Q&A results depends on the knowledge accumulated through asset inventories. The more complete the metadata and column comments, the more accurate the results.

Asset Q&A supports the following types of queries:

Query type

Description

Example question

Instance information

Query basic information about registered instances, such as instance count, engine type, and region distribution.

How many database instances are registered?

Schema structure

Query structural information about databases and tables, such as table count, column definitions, and index details.

What tables are in the order database? What columns does the orders table contain?

Data volume statistics

Query statistical information about tables, such as row count and storage usage.

Which tables have more than 1,000,000 rows?

Asset relationships

Query relationships between database assets, such as foreign key dependencies and cross-table references.

What tables are related to the orders table?

Permissions and security

Query security-related information about databases, such as permission configurations and sensitive column tags.

Which tables contain sensitive columns?

Procedure

  1. Log on to the AI-Native Database Service console.

  2. In the AI Data Assets section of the left-side navigation pane, click Meta Agent.

  3. On the Meta Agent page, find the asset Q&A card and click Asset Q&A.

    The asset Q&A panel opens on the right side of the page.

  4. In the input box of the Q&A panel, enter your question in natural language and press Enter or click the send button.

    For example, you can ask:

    • How many MySQL instances are registered?

    • What columns does the user_info table have?

    • Which databases use more than 10 GB of storage?

    • Which tables in the production environment contain a phone number column?

  5. View the results.

    The system parses your question, converts the natural language into a query, and retrieves results from the asset knowledge base of registered databases. Depending on the question type, results are displayed as text, tables, or lists.

  6. (Optional) Ask follow-up questions based on the current results to gradually narrow the scope and retrieve more specific information.

Knowledge accumulation and accuracy

The accuracy of asset Q&A is closely tied to the asset knowledge accumulated by the system. Knowledge is accumulated through the following sources:

  • Asset inventory: The system automatically collects metadata from registered databases, including instance specifications, schema structures, column types, column comments, and index details. This metadata forms the foundation of the knowledge base.

  • Column comments: Adding descriptive comments (COMMENT) to database columns helps the system understand the business meaning of each column. For example, setting the comment of the mobile_no column to "phone number" allows the system to accurately map a query about phone numbers to this column.

  • Usage feedback: The system continuously improves its query understanding based on Q&A interactions. The more frequently and diversely the feature is used, the more accurate the results become.

Best practices

To improve the accuracy of asset Q&A results, follow these best practices:

  • Complete the asset inventory: Run an asset inventory on all target databases so that the system has comprehensive metadata.

  • Ask specific questions: Use specific database names, table names, or column names in your questions. Avoid vague descriptions. For example, "How many rows are in the orders table?" yields more accurate results than "Show me something about order data."

  • Refine iteratively: If the initial results are not precise enough, ask follow-up questions to narrow the query scope.

  • Maximize column comment coverage: The higher the column comment coverage, the better the system understands business semantics. Aim for at least 80% comment coverage on core business tables.

Note

The accuracy of asset Q&A depends on the completeness of asset inventories and the quality of database metadata. Before you use this feature for the first time, complete an asset inventory.