Creating Context

Context is the knowledge that you add to your charter to help Supr Analyst understand your data better. This is optional but recommended step in making LLM stay grounded and more accurate. We have integrated AI at every step of adding context to help you setup as fast and easy as possible.

Types of context

  1. Data Entity Metadata (IMPORTANT): This is the metadata of the data entities (tables) you have in your database. This includes the table description, column description and foreign key descriptions for your data entities.
  2. Charter Metrics (IMPORTANT): These are any metrics that you want to track for the charter. It consists of a metric name, its abbreviation and description of the metric.
  3. Charter Metric Examples: These are any examples queries that calculate the metric. It consists of a query and its explanation.
  4. Charter Examples: These are any examples queries that contain the data entities that are included in the charter. It consists of a query and its explanation. Though not that important, it helps LLM to understand the data entities and the context of the charter in case you have not added any metrics or metric examples.

1. Adding Data Entity Metadata

    Follow these steps to add data entity metadata:

  1. Go to Data Sources from the sidebar and click on View Entities for the data source you want to add metadata for.
  2. Here you will see all the data entities (tables) in the data source. If you haven't added metadata to any of the data entities, it will show "No Description" in red color.
  3. Click on Edit button for the data entity to which you want add metadata.
  4. You can either add metadata yourself or click on Generate AI Metadata button to generate it for you. This will automatically generate and save the metadata for the data entity.
Note: Remember to verify the metadata generated by AI and make any changes if required. For columns that require additional structure information (like JSON, or STRUCT), you need to manually add these details to the column description. For example, if you have a JSON column storing user preferences, you should add the structure of the JSON to the column description.
Add data source

2. Adding Charter Metrics

    Follow these steps to add charter metrics:

  1. Go to Charters from the sidebar and click on Add Metrics button.
  2. Add the metric name, its abbreviation and explanation of the metric. You can use AI to generate the explanation by clicking on Generate AI Description button. This wil open dialog where you need to select the Data Entities that are related to the metric.
Note: Remember to verify the explanation generated by AI before saving the metric.
Sync data entities

3. Adding Charter Metric Examples

    Follow these steps to add charter metrics:

  1. Go to Charters from the sidebar and click on View Metrics button.
  2. This will open all the metrics you have added to the charter. Click on Add Example button for the metric you want to add an example for.
  3. Here you need to add the query and its explanation. You can use AI to generate the explanation for the query by clicking on Generate AI Explanation button. Remember to verify the explanation generated by AI before saving the example.
Note: If you don't have any example queries for the metric, you can use SQL Playground to generate them. In SQL Playground, select the Metric and its associated Data Entities and tell AI to generate query. Once generated, you can add the query here.
Create charter

4. Adding Charter Examples

    Follow these steps to add charter examples:

  1. Go to Charters from the sidebar and click on Add Example button.
  2. Here you need to add the query and its explanation. You can use AI to generate the explanation by clicking on Generate AI Explanation. Remember to verify the explanation generated by AI before saving the example.
Note: If you don't have any examples for the charter, you can use SQL Playground to generate them. In SQL Playground, select the associated Data Entities and tell AI to generate the query. Once generated, you can add the query here.
Create charter