Skip to main content

Advanced Catalogs

Data Models + Enshrining business concepts

Vivek Aithal avatar
Written by Vivek Aithal
Updated over a week ago

An Advanced Catalog is a way to have total control over the business concepts, custom metrics, and any custom instructions you want the MinusX agent to have in context. Analysts, with the help of MinusX AE agent write the catalog. Business users can ask questions against any Catalog.

Understanding the Catalog

A catalog is a YAML representation of the data model. It contains the following:

entities:
- name: <EntityName>
description: <EntityDescription>
from_: <TableName> or <SQL/CTE>
dimensions:
- name: <DimensionName>
type: <DimensionType>
description: <DimensionDescription>
sql: <SQL>
metrics:
- name: <MetricName>
description: <MetricDescription>
sql: <SQL>
examples:
- name: <ExampleName>
description: <ExampleDescription>
sql: <SQL>
ai_instructions: <Instructions>

Notes:

  1. Entities:

    1. from_ can be either a base table name or a CTE/SQL

  2. Dimensions:

    1. These are the only columns included. Whatever is not mentioned here are hidden to the model.

    2. If sql is not specified, it is assumed to be the base column. If it is present, it is a derived column (and not materialized).

  3. Metrics:

    1. These are custom metrics (aggregations) that are relevant to the business. The model has access to simple metrics like COUNT or SUM.

    2. By definition, they are not materialized.

  4. Examples [optional]: These are named example queries.

  5. AI_instructions [optional]: These are special instruction to the LLM.

Add a new Catalog

Here's how you can add a new catalog:

Technical Details

Technically, the LLM does not even see the entire catalog. We send a minified catalog in context, and then the MinusX SQL compiler converts the generated SQL into the actual SQL that is executed.

Did this answer your question?