What a Metric Contains
Each metric has:- Name — A
snake_caseidentifier (e.g.,revenue,dau,conversion_rate) - Description — What the metric measures in business terms (e.g., “Total processed cashout amount in dollars over the date window.”)
- SQL — A complete, executable query that returns exactly one row with one numeric column
- Rules — Optional instructions the agent must follow whenever it uses this metric, such as what the number leaves out (see Rules)
Time Behavior
Every metric is parameterized for time in one of three ways:- Window metric — Aggregates over a date range selected by the user (e.g., revenue this month, signups in the last 7 days). This is the most common type.
- Point metric — Calculated for a single date or moment (e.g., DAU on Tuesday, active accounts as of March 1).
- Timeless metric — Independent of time entirely (rare — only for genuinely timeless values like total accounts ever created).
How the Agent Uses Metrics
When someone asks a question that involves a metric, the agent:- Finds the metric by searching the Semantic Catalog
- Runs the metric’s SQL with the appropriate date parameters
- Combines it with dimensions if the user asked for a breakdown (e.g., “revenue by country”)
- Applies segment filters if requested (e.g., “revenue for premium users”)
Rules on Metrics
A metric can carry Rules — named instructions the agent must follow whenever it uses that metric. For example, on arevenue metric:
Revenue is gross — “This metric does not subtract refunds. When a question asks about net revenue, say so rather than presenting this number as net.”
Rules are the place for the caveats you’d otherwise repeat in every question: what the number does and doesn’t include, a currency assumption, or a date before which the data is incomplete.
Rules are managed from the Rules section on the metric’s page. See Rules for how adding and editing works.