How to Analyze Customer Retention Using AI
Review customer and revenue retention, compare opening-period segments, and check the counts behind each rate with an AI agent connected to your Cube deployment.
- Define the opening population and period
- Separate customer, gross revenue, and net revenue retention
- Compare segments without averaging their rates
What is customer retention analysis with AI?
Customer retention analysis measures the share of customers active at the start of a defined period who meet the model's active rule at its end. It can also compare gross and net revenue retention for the same opening customer population. An AI agent can retrieve modeled metrics, show their definitions, and organize results by period or by a segment recorded at period start.
This workflow reviews historical metrics; it does not predict renewals or churn. A retention rate describes the selected population and dates, but does not explain why customers stay or leave. Keep calendar-period retention separate from signup-cohort analysis, which measures activity at equal tenure after a shared start event.
Set the retention period and denominator
Use the model's approved customer and revenue definitions. Fix the start and end dates, timezone, and segment value at period start before comparing results.
| Metric | Illustrative example |
|---|---|
| Review window | March 1–31, 2026, UTC; 500 customers active at the start and 450 of those customers active at month end. |
| Customer retention | 450 / 500 = 90.0%; customers added during March are excluded from both counts. |
| Gross revenue retention | Opening-cohort MRR: $500,000; $50,000 lost to cancellation or contraction leaves $450,000 / $500,000 = 90.0%; expansion and new customers are excluded. |
| Net revenue retention | $450,000 after cancellation or contraction + $75,000 expansion = $525,000; $525,000 / $500,000 = 105.0%; new customers are excluded. |
| Segmentation | Assign plan at March 1: Starter has 280 starting customers and Growth has 220. |
Copy. Paste. Run your retention review.
Connect to Cube via MCP or our CLI, then run the prompt below in your preferred agent.
Start with a Cube deployment connected to your data and a model containing the metrics you want to analyze.
Connect over MCP
Connect your agent to your existing Cube deployment and sign in through OAuth.
https://cubecloud.dev/mcp
Complete OAuth in your agent to connect your Cube account.
Use your default deployment or select another one available to your account.
Connect with CLI
Install the Cube CLI and sign in from a terminal-capable agent.
curl -fsSL https://raw.githubusercontent.com/cube-js/cube/master/install-cli.sh | sh
cube login --url https://TENANT.cubecloud.dev
cube spec --json
02Run this prompt in your agent
Choose your agent and copy the prompt below.
Use the Cube MCP server connected in Codex and select the intended deployment. Run read-only analytics queries. Run a historical customer and revenue retention review using my connected Cube deployment.Use read-only requests and do not return customer identifiers. DEFINITIONSInspect the semantic model and report its approved customer grain, active-statusrule, revenue metrics, timezone, and available segment fields. State thenumerator and denominator for every reported rate. If a required metric,field, or date is missing, explain the gap instead of inventing a result. Use the model's approved definition when one exists. For customer retention,the default is distinct customers active at both period start and period enddivided by distinct customers active at period start. State the exact datesand timezone. If the approved metric uses a different rule, describe it anduse that approved metric rather than silently redefining it. Gross revenue retention (GRR) is opening recurring revenue for the startingcustomer population, less cancellations and contraction, divided by openingrecurring revenue. Exclude expansion and new customers. Net revenueretention (NRR) uses that same starting population and denominator, includesexpansion, and excludes revenue from new customers. Use approved modeledGRR or NRR metrics; do not reconstruct a missing metric from raw fields. ANALYSIS1. Review the last three complete calendar months with available data. State each exact start and end date, timezone, and whether source data is complete. Exclude an incomplete current month.2. For each month, show the opening customer count, customers still active at month end, and customer retention rate. Where approved revenue metrics exist, show opening recurring revenue and the GRR and NRR numerators, denominators, and rates. Compare period changes in percentage points.3. Compare modeled segments such as plan or region using membership at the period start. Show each segment's counts or revenue and rates, flag small samples, and mark missing data as unavailable. Calculate overall rates from summed numerators and denominators; never average segment rates.4. Explain customer grain, status and reactivation rules, filters, date boundaries, and the metric definitions used. Keep calendar-period results separate from signup-cohort retention at matched tenure.5. Separate observed results from hypotheses about causes. Suggest follow-up checks, but do not claim causation or predict individual renewals. OUTPUTReturn the definitions, result tables, query context, and a conciseinterpretation. Keep customer identifiers private. State any gaps or smallsamples clearly; do not fill missing metrics with estimates.
How it works
Fix the starting population
Confirm the customer status rule, exact period boundaries, timezone, and modeled customer grain. Assign plan or region at the period start so a later change does not rewrite the segment.
Reconcile customer and revenue rates
Check each numerator against its denominator. Keep customer counts separate from recurring revenue, exclude expansion from GRR, include it in NRR, and calculate totals from the underlying counts and revenue rather than averaged segment rates.
Investigate the differences
Compare periods and modeled segments, then check the underlying activity or billing history for a pattern worth testing. A segment difference is an observation, not proof of why customers stayed or left.
Read customer and revenue retention together
The chart uses fictional March 2026 values. Each plan’s gross and net revenue retention divides retained recurring revenue by that plan’s opening MRR; customer retention is counted separately.
| Plan at March 1 | Starting customers | Active March 31 | Customer retention | Opening MRR | GRR retained MRR / rate | NRR retained MRR / rate |
|---|---|---|---|---|---|---|
| Starter | 280 | 252 | 252 / 280 = 90.0% | $180,000 | $160,000 / $180,000 = 88.9% | $182,500 / $180,000 = 101.4% |
| Growth | 220 | 198 | 198 / 220 = 90.0% | $320,000 | $290,000 / $320,000 = 90.6% | $342,500 / $320,000 = 107.0% |
| Total | 500 | 450 | 450 / 500 = 90.0% | $500,000 | $450,000 / $500,000 = 90.0% | $525,000 / $500,000 = 105.0% |
- The total customer retention rate is 450 divided by 500, or 90.0%. The two plan counts sum to the total; customers acquired during March are outside the opening population.
- GRR is $450,000 divided by $500,000, or 90.0%, after $50,000 in cancellations and contraction. NRR adds $75,000 in expansion to reach $525,000, or 105.0%; new-customer revenue is excluded from both metrics.
- Starter and Growth each retain 90.0% of their opening customers, while their revenue rates differ. These descriptive results identify where to investigate; they do not establish the cause of expansion or contraction.
This worked example and the sample image use fictional values, not executed queries, a customer result, a benchmark, or a prediction. Real results depend on the model's metric and status definitions, billing history, and complete source data; retention rates do not explain causes or forecast renewals.