Data Copilot (New)

更新时间:
复制 MD 格式

DMS Data Copilot is an AI-powered data assistant built on DMS and the Alibaba Cloud Qwen LLM. It combines DMS data management with natural language to help you query, analyze, and manage data efficiently.

Important Notes

  • Copilot is in grayscale release. Join DingTalk group 44962304 to request access from DMS technical support.

  • Copilot requires instance metadata (not actual data) to generate accurate answers. Enable security hosting for the instance.

  • Copilot supports Qwen-Plus, Qwen-Coder, Qwen-A22, and Qwen-Max model resources.

Limits

DMS Data Copilot builds prompts from metadata. Due to model limitations, Copilot samples only a portion of metadata (tables and fields) in large databases, which may reduce accuracy.

Copilot performs better on smaller databases.

Use Copilot in the SQL Window

Prerequisites

  • Enable security hosting for the instance.

  • You have query permissions on the required database. View Your Permissions.

Procedure

  1. Log in to DMS 5.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

    Copilot searches all tables in the current database.

Copilot Feature Demo

Generate SQL

Generate SQL from inline comments

Enter a comment in SQL Console and press Enter to trigger the intelligent miniapp, which generates an SQL statement.

Note
  • The comment format is: two hyphens (-), followed by a space and natural language (which can include text and symbols).

  • Press Tab to accept the generated SQL statement.

Example: Find the city where Xiao Ming bought a phone and display the phone model.

-- Find which city Xiao Ming bought a phone in, and display the phone model.
SELECT
  city,
  item_id AS phone_model
FROM
  orders_test
WHERE
  buyer_name = 'Xiao Ming'
  AND item_id LIKE '%phone%';

Generate SQL in the Copilot Dialog Box

Enter natural language queries. Copilot generates SQL based on table comments, business descriptions, and associated tables.

image

NL2SQL

NL2SQL provides thinking templates that show how Copilot generates SQL. Add or edit templates in the knowledge base to improve query accuracy and interpretability.

Example of an AI thought process:

For example, ask In which city did Xiao Hong buy a phone?. The AI identifies associated tables, analyzes the query by measure, dimension, and summary, then generates the SQL.

image

Database and table Q&A

This feature uses Meta Agent to help you explore and understand data assets in Data Copilot.

For example, enter Introduce this database. Copilot displays the database name, table count, column details, comments, common SQL templates, and predicted usage scenarios.

2025-06-20_13-41-37

SQL Repair

When an SQL statement returns an error, use SQL Repair. Copilot analyzes the error and provides a corrected SQL statement.

image

SQL Result Set Analysis

You can further filter data based on the SQL result set.

image

SQL Autocompletion

Enter partial keywords to receive SQL completion suggestions. You can also select a code template for autocompletion.

Note

Enable SQL autocompletion in the Settings area of the SQL window to view suggestions.

image

Report Recommendation

After executing a SELECT statement, click Chart on the left side of the result area to visualize the data. You can also:

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

  • Switch chart type: Click Change in the upper-right corner. Selecting a recommended chart clears the current configuration.

  • Apply the chart to a dashboard.

image.png

Related Operations

  • Use Data Q&A Agent

    After configuring Copilot with data queries, knowledge base entries, and NL2SQL tuning, use Q&A Agent to let product managers, operations staff, and other stakeholders query data through natural language without writing SQL.

  • Building ChatBI with Dify and NL2SQL

    Dify on DMS and NL2SQL provides a ChatBI solution. Ask a question in natural language, and DMS converts it to SQL, executes the query, and displays results as visualization charts.

  • Edit the knowledge base

    In the SQL window, click My SQL > Knowledge Base, then click Edit next to the target entry.

    Knowledge base entries help Copilot understand context, answer questions, and make automated decisions.

FAQ

Q: Why should I like the SQL generated by Copilot?

A: Liking saves the SQL query, which improves Copilot's accuracy for similar future questions.