Enrich Context Using AI
Introduction
When AI doesn't understand your business context, it can't provide accurate answers. Consider a scenario where a business executive asks an AI: “How’s our sales doing?” The AI might not know if they mean: gross sales or net sales, or whether to compare it to last month or last year.
Context is information that educates AI about your specific business and analytic needs - for example business rules, goals, terms, possible data values, and common analysis patterns.
What does Holistics AI use for context?
Holistics AI uses the following properties for context:
Where can you enrich context for AI?
You can enhance the context for AI by adding additional details for any property within the semantic layer.
Teach AI about your business
What’s good for users is also good for AI
Using meaningful names, labels, and descriptions benefits both your human users and AI.
In descriptions of datasets, data models, and fields, include information such as business rules, synonyms, and guides for analysis. This helps users and AI understand what they can do with a given object.
Example of “Sales” metric with enriched context:
metric sales {
label: "Sales"
description: '''
Definition: Total value from completed orders only, no cancellations or returns, and before any discounts.
Synonyms: GMV, Revenue, Gross Sales.
Common Breakdown and Filters: user's demographics, user's locations, product name
Related Metrics: Net Sales, Discounts, Refunds, Total Order Count, AOV (Average Order Value)
'''
definition: @aql sum(order_items.quantity * products.price) | where(orders.status == 'delivered')
}
Encapsulate context within metrics and dimensions
To ensure accuracy and consistency, you should encapsulate definitions within metric and dimension formulas, especially for easily confused terms or complex business logic.
Example of “Active User” with both text definition and formula:
metric active_user_count {
label: 'Active user count'
description: '''
Active users are those who placed at least one order in the previous month
'''
definition: @aql
ecommerce_orders
| where(ecommerce_orders.created_at is @(last month))
| count_distinct(ecommerce_orders.user_id)
}
Use AI tools to build context faster
Holistics provides built-in AI features to help data team easily enrich the context of their data.
AI field description
Holistics helps automatically generating clear, contextual descriptions for your data fields. This helps business users to understand data fields better, as well as improve the quality of AI-powered queries by providing better semantic context about your data.
AI tag description
Holistics automatically generates meaningful, contextual descriptions for your tags based on the tag name, user-provided keywords, or conventions from existing tags in your workspace. This helps teams maintain consistent tag documentation and ensures that tags provide clear context for content categorization.
Create metrics and dimensions with AI
As mentioned earlier, the best way to encapsulate context is to translate text-based business rules into actual metrics or dimensions. Our AI Explore Data helps you quickly create these. You can always review its analysis and AQL formula before adding the field back to the dataset.