Skip to main content

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:

PropertyDescription
Semantic layer
Dataset's properties
Dataset's metadata Including name, label and description
relationship Relationships among data models within the dataset
context (coming soon) Currently context includes analysis configuration for view underlying data and break down
tag (coming soon) Tags assigned to the dataset, e.g. "finance", "marketing", "trusted," etc
Data model's properties
Data model's metadata Including name, label and description
tag (coming soon) Tags assigned to the data model
Field's properties
Field's metadata Including name, label, description, and type
definition e.g. @aql sum(order_items.quantity * products.price) | where(orders.status == 'delivered')
Reporting layer
Dashboard (coming soon)Including dashboard's metadata, charts, text blocks, and filters
Visualization Currently you can only explore one visualization using AI at a time. For context, Holistics takes in the visualization's metadata, settings and result data (if shared)
Others
Context and tuning pre-built by the Holistics Engineering Team Including information such as: role and scope of the AI, basic knowledge about Holistics, instructions and guidelines for the specific feature, foundational knowledge of AQL, and Holistics documentation
User's current chat Questions asked by users in one single conversation
Auto-learning context (coming soon) AI learns about user’s preference, such as: more concise responses, more suggestions, etc

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.


Let us know what you think about this document :)