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
- 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.
- 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.
- Charter Metric Examples: These are any examples queries that calculate the metric. It consists of a query and its explanation.
- 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
- Go to Data Sources from the sidebar and click on View Entities for the data source you want to add metadata for.
- 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.
- Click on Edit button for the data entity to which you want add metadata.
- 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.
Follow these steps to add data entity metadata:
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.
2. Adding Charter Metrics
- Go to Charters from the sidebar and click on Add Metrics button.
- 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.
Follow these steps to add charter metrics:
Note: Remember to verify the explanation generated by AI before saving the metric.
3. Adding Charter Metric Examples
- Go to Charters from the sidebar and click on View Metrics button.
- 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.
- 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.
Follow these steps to add charter metrics:
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.
4. Adding Charter Examples
- Go to Charters from the sidebar and click on Add Example button.
- 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.
Follow these steps to add charter examples:
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.