All Products
Search
Document Center

Data Management:DMS Data Copilot Intelligent Assistant

Last Updated:Nov 01, 2024

DMS Data Copilot is a data intelligent assistant built on Alibaba Cloud's large model by DMS. It combines DMS's proficient data management and usage capabilities to help developers, operations, product, operations staff, analysts, and database administrators use and manage data more efficiently and systematically. This topic describes how to use DMS Data Copilot.

Public Preview

Currently, the Data Copilot feature is in public preview and is free to use during this period.

Limits

  • DMS Data Copilot builds prompts based on metadata. Due to model limitations, when there is too much database data, Copilot will only sample a portion of the metadata (tables, fields), which may overlook some information.

    Therefore, Copilot works better in small databases than in large databases.

  • Data Copilot understands databases based on the names and comments of tables and columns. Therefore, standardized names of tables and columns and complete comments can improve the accuracy of returned results.

Supported DMS Features with Copilot

Use Copilot on the SQL Console Tab

Prerequisites

  • The database instance is managed in Security Collaboration mode.

  • The query permissions on the required database are obtained. For more information, see View My Permissions.

Operation Entry

  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 at the top of the page to start using Copilot. For a demonstration of Copilot features, see Copilot Feature Demonstration.

    Copilot traverses all tables in the current database.

Use Copilot in Notebook

  1. Log on to the DMS console V5.0.
  2. Click the 2023-01-28_15-57-17.png icon in the upper-left corner of the console, and select All Features > Integration And Development (DTS) > Notebook.

    Note

    If you are using a non-simplified mode console, select Integration And Development (DTS) > Notebook from the top menu bar.

  3. In the Project Workspace list area, click Enter Workspace on the right side of the target project workspace.

    For operations to create a new project workspace, see Create a Project Workspace and Introduce Resources.

  4. Under the image tab of the workspace, you can click image at the top of the SQLConsole or Notebook page to start using Copilot. For more Copilot features, see Copilot Feature Demonstration.

Copilot Feature Demonstration

Generate SQL

  1. Enter natural language for query and analysis.

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

    2. If the tables selected by Copilot have high credibility, Copilot automatically starts to generate an SQL statement.

      Note

      If Copilot cannot confirm which table data meets your needs, or the filtered tables do not meet your needs, you need to manually Adjust Tables, select and add appropriate tables.

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

    In the associated table area found by Copilot, click View to view the relevant information of the table, including table data, the database where the table is located, the number of data rows, existing database permissions, field information of the table, index information, etc.

  3. Copilot generates SQL.

    • If you are satisfied with the generated SQL statement, you can copy it to the SQL Console tab or a notebook for execution.

    • If you are not satisfied with the generated SQL statement, you can Supplement Feedback, and Copilot will modify the SQL based on the feedback and automatically extract the implicit business knowledge from 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. The following figure shows:

Manage Business Knowledge

  • Generate business knowledge

    DMS supports the following sources of knowledge:

    • Knowledge that is proactively mined and accumulated by DMS based on the metadata of databases, tables, and columns and historical user queries.

    • Feedbacks provided by users during interactions with Copilot. DMS supplements the feedbacks to the knowledge base.

    After business knowledge is generated, Copilot references the related business knowledge when it generates SQL statements and marks the reference.

  • Verify business knowledge

    Under the Product Page tab of Business Knowledge, you can review whether the generated business knowledge is correct. If correct, you can change the Pending Review or Pending Verification Knowledge Level to Verified.

    Note

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

  • Edit business knowledge

    If the business knowledge is incorrect, you can click Edit in the knowledge base area referenced by SQL.

Manage Similar SQL Statements

Copilot can generate SQL statements by using historical questions as a reference. An AI agent generates SQL statements based on only verified knowledge.

  • Save query records

    If you are satisfied with the SQL statement generated by Copilot, you can click the Like icon in the lower-right corner to save the query record as a similar question. Later, Copilot can generate SQL statements based on this saved query for questions that are similar.

    image

  • Delete saved query records

    Double-click the table name to enter the Table Details page, and delete the question under the historical questions tab.

NL2SQL (Convert Natural Language to Standard SQL Statements)

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 format is: two half-width hyphens (-) + space + text.

  • 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

Report Recommendation

After successfully executing a SELECT statement, click Chart on the left side of the execution result area to display data in a visual chart. You can also perform the following operations:

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

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

image.png

Knowledge Base Management

The knowledge in the knowledge base can help the Copilot intelligent assistant better understand and answer questions, and achieve automated decision-making and reasoning. For more information, see Knowledge Base Management.

What to do next

After using Copilot for data query, adding knowledge, or optimizing SQL statements converted from comments, data developers can quickly publish a data fetching assistant using the AI Agent feature 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 specific operations, see Publish AI Agent.

FAQ

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

    A: The like operation can trigger Copilot to save the SQL statement. This can greatly improve the accuracy of answers to similar questions.

  • Q: Why do I need to provide feedback if the SQL statement generated by Copilot does not match my question?

    A: Your feedback can improve the accuracy of replies generated by Copilot. Based on your feedback, Copilot can generate accurate replies for similar questions that are submitted later.