Analysis Primitives
OnlyMetrix includes 22 built-in analysis primitives. Each runs deterministically in Rust — the AI agent selects and orchestrates them, but the computation is exact.
Quick Reference
| Primitive | What it answers | Endpoint |
|---|---|---|
| health | Is this metric behaving normally? | Agent only |
| trends | How has this metric changed over time? | Agent only |
| drivers | What dimensions are driving changes? | Agent only |
| segment_performance | How do segments compare? | Agent only |
| contribution | What's each segment's share of the total? | Agent only |
| compare | How do two cohorts or periods differ? | Agent only |
| anomalies | Are there outliers in the data? | Agent only |
| correlate | Do two metrics move together? | /v1/analysis/correlate |
| root_cause | Why did a metric change? | Agent only |
| sensitivity | How much does the total change if one segment shifts? | Agent only |
| forecast | Where is this metric heading? | Agent only |
| causal_impact | Did a specific event change the metric? | /v1/analysis/causal-impact |
| scenario | What if we change a segment by X%? | /v1/analysis/scenario |
| benchmark | How does this metric compare to its own history? | /v1/analysis/benchmark |
| cohort | How do user cohorts retain over time? | /v1/analysis/cohort |
| funnel | Where do users drop off in a multi-step process? | /v1/analysis/funnel |
| metric_impact | If metric A changes, how does metric B respond? | /v1/analysis/metric-impact |
| counterfactual | What would the total be without a specific segment? | /v1/analysis/counterfactual |
| monitor | Set a threshold condition and check if it's triggered | /v1/analysis/monitor |
| data_quality | Check nulls, duplicates, freshness, schema | /v1/analysis/data-quality |
| pareto | Which segments account for 80% of the total? | Agent only |
| threshold | Find natural breakpoints in the data | Agent only |
Tier availability
| Plan | Primitives included |
|---|---|
| Free | health, trends, drivers, segment_performance, contribution, compare, anomalies |
| Team ($299/mo) | All 22 primitives |
| Enterprise | All 22 + custom primitives |
Using via the AI agent
Ask natural language questions and the agent selects the right primitive:
| You ask | Agent uses |
|---|---|
| "Why did revenue drop last month?" | root_cause |
| "What would revenue be without France?" | counterfactual |
| "Did the price change in March affect orders?" | causal_impact |
| "How are customers retaining?" | cohort |
| "What if we grow UK revenue by 10%?" | scenario |
| "Which countries drive 80% of revenue?" | pareto |
| "Is this metric trustworthy?" | data_quality |
Using via API
Analysis endpoints accept a JSON body with metric and primitive-specific parameters:
bash
curl -X POST https://api.onlymetrix.com/v1/analysis/causal-impact \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"metric": "total_revenue", "event_date": "2026-03-15"}'See individual primitive pages for detailed parameter documentation.