Skip to main content

Semantics Settings

info

Currently, only Calendar semantics are supported.

To enhance the collaboration between the platform and large language models (e.g., Deepseek) in scenarios such as data analysis and natural language queries, XpertAI supports configuring semantic attributes for dimensions and their hierarchies. These semantic settings help the platform accurately understand field meanings, perform intelligent transformations, and hide unnecessary complexity, playing a critical role in enabling intelligent Q&A and smart reporting with large language models.

Semantic Types

Semantic types are used to annotate the business meaning of hierarchies, particularly for time-related dimensions, helping the system and large language models understand the true meaning of fields like “year,” “month,” or “day.”

✅ Common Semantic Types Include:

Hierarchy NameSemantic TypeExample Value
YearCalendar.Year2023
MonthCalendar.Month[2023].[05]
DayCalendar.Day[2023].[05].[01]

Once semantic types are set, the system can recognize the hierarchy as part of a time structure, enabling:

  • Intelligent recognition of time conditions by large language models (e.g., “last three months,” “December last year”);
  • Automated analysis such as time alignment and time rolling;
  • Automatic generation of time expressions in natural language.

📌 Configuration Tips:

  • Configure semantic types only for standard calendar dimensions;
  • Dimension/hierarchy names do not need to include the word “time,” but semantics must be correctly configured.

Format Strings

When a hierarchy type is a Calendar type, a format string must be specified for that hierarchy to convert the original Date object into the actual member value (i.e., technical ID).

🎯 Example:

DimensionHierarchyFormat PatternTechnical ID Example
order_date1yyyy2023
order_date2[yyyy].[MM][2023].[05]
order_date3[yyyy].[MM].[dd][2023].[05].[01]

This step is crucial for large language models to understand time expressions in user natural language queries. For example:

User Input: “Calculate monthly sales for this year”

The platform automatically recognizes “this year” as the current year, e.g., “2025,” and formats it into technical IDs like “[2025].[01]”, “[2025].[02]”, etc., which are passed to the model for accurate analysis results.

📌 Tips:

  • Ensure the format pattern matches the underlying field format;
  • Supported formats are similar to those in JavaScript’s date-fns;
  • Formatted fields are passed as actual query conditions to the large language model and data query engine.

Hiding from Large Language Models

In some scenarios, certain dimensions or hierarchies, while important for internal system analysis, are not suitable for exposure to large language models for natural language inference.

For example:

  • ID fields (e.g., product codes, organization codes);
  • Technically complex hierarchies (e.g., sorting auxiliary fields, system-generated identifiers);
  • Redundant or complex condition fields.

✨ After Setting as “Hidden from Large Language Models”:

  • These dimensions or hierarchies are automatically ignored during the model information retrieval process by large language models;
  • Simplifies the prompt space and reduces interference;
  • Improves the accuracy and quality of responses from large language models.

📌 Best Practices:

  • Hide hierarchies that business users do not care about but are relied upon internally by the system;
  • Hide auxiliary fields under dimensions used solely for internal calculations or filtering;
  • Minimize exposing ID-type hierarchies to large language models.