All Products
Search
Document Center

Data Management:Data Copilot

Last Updated:Dec 17, 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 engineers, service 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.

Public preview

DMS Data Copilot is in public preview. You can use DMS Data Copilot free of charge during the public preview.

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.

Usage notes

You can use DMS Data Copilot on the SQL Console and Notebook tabs of the DMS console.

Use DMS Data Copilot on the SQL Console tab

Prerequisites

  • The database instance that you want to manage uses the 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 the image icon 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 > Notebook.

    Note

    If you use the DMS console in normal mode, choose Data Development > Notebook in the top navigation bar. The Notebook page appears.

  3. In the Workspace section of the Notebook page, find the workspace that you want to manage and click Go to Workspace in the Actions column.

    For more information about how to create a workspace, see Create a workspace and import resources.

  4. On the page that appears, click the imageicon to go to the SQL Console or Notebook tab. Then, click the image icon in the upper part of the 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 of the filtered tables.

    In the returned table list, find the table that you want to view and click View. You can view the information of 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 the generated SQL statement meets your expectations, you can copy and paste the SQL statement to the SQL Console or Notebook tab, and execute the statement.

    • If the generated SQL statement does not meet your expectations, you can 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.

NL2SQL

After you enter a comment on the SQL Console tab, 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.

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. The time required to wait for the SQL completion depends on the length of the SQL statement to be completed.

Note

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

image

Manage SQL knowledge

To prevent AI errors when you use DMS Data Copilot, DMS provides knowledge bases and supports answers to similar questions.

Manage business knowledge

  • Generate business knowledge

    DMS accumulates business knowledge based on interactive question and answer (Q&A) in Copilot. You can manually supplement business knowledge to DMS. DMS can also generate business knowledge by using a data augmentation pipeline. For more information, see the Knowledge sources section of the "Knowledge base management" topic.

    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.

  • Modify business knowledge

    If the business knowledge is incorrect, you can edit the knowledge in the section of the referred knowledge base or in the knowledge base management feature module. For more information, see Knowledge base management.

Manage similar SQL statements

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

  • Save query records

    If the generated SQL statements meet your expectations, 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 a 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.

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

Related operations

  • Use an AI agent

    After you use DMS Data Copilot to perform operations such as querying data, adding knowledge, or optimizing SQL statements converted from comments, you can use an AI agent to meet the data Q&A requirements of service 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 only to ask questions to obtain the required results. For more information, see Publish an AI agent.

  • Manage a knowledge base

    The knowledge in a knowledge base helps DMS Data Copilot better understand and answer questions and implement automated decision-making and reasoning. For more information, see Knowledge base management.

FAQ

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

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

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

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