Knowledge base

Updated at:

The DMS knowledge base helps you manage knowledge used by Data Copilot. It allows you to view knowledge automatically generated by Meta Agent and to manually add or modify it. An enriched knowledge base improves Data Copilot's ability to understand questions, make automated decisions, and provide reasoned answers. This topic describes how to add, edit, and manage knowledge.

Knowledge sources

Business knowledge is crucial for the effectiveness of NL2SQL. DMS builds business knowledge in three ways: through interactive Q&A in the Copilot interface, manual user additions, and the DMS data augmentation pipeline. The following figure illustrates how knowledge enhances Copilot.

image

The data augmentation pipeline builds knowledge by extracting SQL templates from your historical SQL queries in DMS. The system then translates these queries into natural language questions and stores them as SQL records in the knowledge base.

image

Notes

  • The knowledge management page displays all business knowledge for the current DMS tenant, including both auto-generated and manually added knowledge.

  • Copilot automatically creates SQL records in the knowledge base from your feedback (likes).

  • The system automatically generates knowledge snippets in the knowledge base from SQL execution history and table structure.

Add knowledge

Add a single knowledge entry

Manually add knowledge

  1. Log in to DMS 5.0.

  2. In the upper-left corner of the console, click the 2023-01-28_15-57-17.png icon and choose All Features > Data Assets > Knowledge Base.

    Note

    If you are using the classic console, choose Data Assets > Knowledge Base from the top menu bar.

  3. On the Knowledge Granularity tab, click Add.

  4. In the Add Knowledge panel, enter the Description and Content, and provide a chain of thought. Select a knowledge type, knowledge level, and associated database.

    The chain of thought parameter appears only when you set knowledge type to SQL record. For optimal performance, follow the template that DMS provides.

    The following example shows a chain of thought (thought template):

    Metric: The user asked about the academic performance of schools in California and wants to know which school is the best. Based on the context, the total average score for each school needs to be calculated.
    Dimension (Filter Condition): The user's question does not mention any specific filter conditions. The core dimension is the school name.
    In summary, this requires using the satscores table and the sname column. sname will be used as the projection. Calculate the total average score for sorting. No grouping is involved.
  5. Click OK.

Automatically generate knowledge

  • Copilot creates knowledge when you like or provide feedback on the information it generates. For more information, see Data Copilot (New).

    • The system automatically adds liked SQL queries and their corresponding questions to the knowledge base as SQL records with a knowledge level of pending review.

    • Your feedback and modified SQL are automatically added to the knowledge base as knowledge snippets, with the knowledge level set to pending review.

  • Build knowledge through the data augmentation pipeline.

Batch import knowledge

Only CSV files can be imported.

  1. On the Knowledge Granularity tab, click Batch Import.

  2. Download and review the template. Complete the template with your knowledge data, and then upload the CSV file.

  3. Click OK.

Manage knowledge

On the knowledge list page, you can edit or delete knowledge entries.

Add tags

You can use tags to quickly find target knowledge entries.

  1. At the top of the knowledge list page, click Tag Management.

  2. Add a tag.

    Click Add, enter a tag name, and then click OK.

    Note

    You can also modify or delete tags.

  3. Bind tags to knowledge.

    1. In the row of the target knowledge entry, click the tag image icon, and then click Bind.

    2. In the Tag dialog box, click Add.

    3. Select one or more target tags, and then click OK.

      Note

      You can bind up to 20 tags to each knowledge entry.

Search knowledge

You can filter for knowledge entries by keyword, tag, knowledge level, knowledge type, and associated database.

The filtered results are displayed in a table that includes columns such as Knowledge ID, Knowledge type, Description, Tag, Knowledge level, Associated database, Associated table, Associated field, and Popularity. The Actions column provides options to Edit and Delete entries.

SQL knowledge

In the SQL window, you can edit knowledge from the knowledge base, save SQL statements to your favorites, and view the execution history.

  • Save SQL to Favorites

    Click My SQL. On the Favorites tab, enter the SQL statement you want to save, and then click Add.

  • Edit knowledge

    Click My SQL. On the Knowledge Base tab, find the entry that you want to modify, and then click Edit.

    Note

    DMS adds favorited SQL statements to the knowledge base by default.

  • View execution history

    Click My SQL. On the Knowledge Base tab, view the executed SQL statements.

Business knowledge

If you have queried information about the current table in Copilot, DMS automatically adds business descriptions for the table and its fields.

In the SQL window, click the table list image icon in the upper-right corner. In the Actions column, choose More > View Table Details to see the added business descriptions.

You can double-click the Business description for a table or field to edit it.