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:
Entities:
from_
can be either a base table name or a CTE/SQL
Dimensions:
These are the only columns included. Whatever is not mentioned here are hidden to the model.
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).
Metrics:
These are custom metrics (aggregations) that are relevant to the business. The model has access to simple metrics like
COUNT
orSUM
.By definition, they are not materialized.
Examples [optional]: These are named example queries.
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.