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
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”)