All Products
Search
Document Center

Data Management:DMS Data Copilot

Last Updated:Sep 09, 2024

Data Management (DMS) Data Copilot is an intelligent assistant that is developed based on Alibaba Cloud foundation models. DMS Data Copilot integrates the data management and usage capabilities of DMS and can help developers, O&M staff, product staff, operations staff, data analysts, and database administrators use and manage data in a more efficient and standard manner. This topic describes how to use DMS Data Copilot.

Limits

  • DMS Data Copilot creates prompts based on database metadata. Due to the limits of models, if a database has an excessively large amount of data, DMS Data Copilot samples only some of the metadata, such as tables and columns. In this case, some information may be ignored.

    DMS Data Copilot works better in small databases than in large databases.

  • DMS Data Copilot understands databases based on the names and comments of tables and columns. Therefore, you can use standardized names of tables and columns and accurate comments to improve the accuracy of returned results.

DMS features that support DMS Data Copilot

Use DMS Data Copilot on the SQLConsole tab

Prerequisites

  • The database instance is managed in Security Collaboration mode.

  • The query permissions on the required database are obtained. For more information about how to view your permissions, see View owned permissions.

Procedure

  1. Log on to the DMS console V5.0.
  2. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the DMS console and choose All Features > SQL Console > SQL Console.

    Note

    If you use the DMS console in normal mode, choose SQL Console > SQL Console in the top navigation bar.

  3. In the Please select the database first dialog box, enter a keyword to search for a database, select the database instance from the search results, and then click Confirm.

  4. Click image in the upper part of the code editor to use DMS Data Copilot. For more information about the features of DMS Data Copilot, see the Features of DMS Data Copilot section of this topic.

    DMS Data Copilot traverses all tables in the current database.

Use DMS Data Copilot in Notebook

  1. Log on to the DMS console V5.0.
  2. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the DMS console and choose All Features > Data Development > Data Workstation.

    Note

    If you use the DMS console in normal mode, choose Data Development > Data Workstation in the top navigation bar.

  3. On the page that appears, find the workspace that you want to manage and click Go to Workspace in the Actions column.

  4. On the Workspace imagetab, click image in the upper part of the SQLConsole or Notebook tab to use DMS Data Copilot. For more information about the features of DMS Data Copilot, see the Features of DMS Data Copilot section of this topic.

Features of DMS Data Copilot

Generate SQL statements

  1. Enter a question for data query and analysis.

    1. After you ask a question, DMS Data Copilot analyzes the question and filters tables that meet the conditions based on the comments and relevance of tables.

    2. You can select a table that meets your requirements from the filtered tables. Then, DMS Data Copilot automatically generates an SQL statement based on the table.

      Note

      If DMS Data Copilot cannot determine which tables meet your requirements or the filtered tables do not meet your requirements, you can click Table Mismatching to manually add tables.

  2. Optional. View the detailed information about the filtered tables.

    In the tables that are returned, find the table that you want to view and click View. You can view the information about the table, including the table data, the database to which the table belongs, the number of rows, the permissions on the database, and the fields and indexes of the table.

  3. DMS Data Copilot generates an SQL statement.

    • If you are satisfied with the generated SQL statement, you can copy and paste it to the SQLConsole or Notebook tab, and execute the statement.

    • If you are not satisfied with the generated SQL statement, click Supplementary Feedback to give feedback. DMS Data Copilot modifies the SQL statement based on the feedback and automatically extracts the business knowledge included in the feedback.

Manage SQL knowledge

To prevent AI errors when you use DMS Data Copilot, DMS provides knowledge bases and supports answers to similar questions, as shown in the following figure.

Manage business knowledge

  • Generate business knowledge

    DMS generates business knowledge from the following sources:

    • Accumulated knowledge based on historical queries and the metadata of databases, tables, and columns

    • Supplementary information from user feedback when users interact with DMS Data Copilot

    After business knowledge is generated, DMS Data Copilot references related business knowledge when it generates SQL statements, and displays the references to business knowledge.

  • Verify business knowledge

    On the Business Knowledge tab of the Table Details page, check whether the generated business knowledge is correct. If the business knowledge is correct, you can change the Knowledge Level of the business knowledge from Pending Approval or Pending Verification to Verified.

    Note

    Only the database developers and database and table owners have the permissions to verify knowledge.

  • Edit business knowledge

    If the business knowledge is incorrect, find the knowledge base referenced by SQL statements and click Edit.

Manage similar SQL statements

DMS Data Copilot can generate SQL statements by referencing historical questions, while the AI Agent references only the verified knowledge.

  • Save query records

    If you are satisfied with the generated SQL statements, you can click the Like icon in the lower-right corner of the response to save the query record. Next time you ask a similar question, DMS Data Copilot generates SQL statements based on the saved query record.

    image

  • Delete saved query records

    Double-click the table name to go to the Table Details page. On the Historical Questions tab, find the query record that you want to delete and click Delete in the Actions column.

NL2SQL

After you enter a comment, you can press the Enter key to directly trigger DMS Data Copilot to generate an SQL statement.

Note
  • The comment is in the -- comment content format.

  • You can press the Tab key to accept the generated SQL statement.

The following figure provides an example on how to generate an SQL statement to query the player with the maximum number of wins.

SQL completion

After you enter part of an SQL statement and wait for 1 to 4 seconds, DMS Data Copilot automatically completes the remaining part of the SQL statement.

Note

You can press the Tab key to accept the generated SQL statement.

image

Display data in charts

After a SELECT statement is successfully executed, you can click the Chart icon in the left-side pane of the Execution Results tab to display data in charts. You can also perform the following operations:

  • Download a chart: Click Download Image in the upper-right corner of the chart section.

  • Use a recommended chart: Click Change It in the upper-right corner of the chart section. If you use the recommended chart, the current chart configuration is cleared.

image.png

What to do next

After you use DMS Data Copilot to perform operations such as querying data, adding knowledge, or optimizing SQL statements converted from comments, you can publish an AI agent of DMS Data Copilot to meet the data Q&A requirements of product staff, operations staff, and external demanders. You can use the AI agent to obtain data in interactions with natural language. This frees you from understanding tables and SQL statements and does not require code executions. You need to only ask questions to obtain the required results. For more information, see Publish an AI agent.

FAQ

  • Q: Why do I need to like a generated SQL statement if I am satisfied with the generated SQL statement?

    A: After you like the SQL statement, DMS Data Copilot saves the SQL statement. This can greatly improve the accuracy of answers to similar questions.

  • Q: Why do I need to give feedback if a generated SQL statement cannot meet my business requirements?

    A: User feedback helps improve the accuracy of answers. DMS Data Copilot can provide basically correct answers to similar questions based on user feedback.