Use case

How to Analyze Churn Using AI

Review customer churn, compare segments, and explain changes with AI using the metrics in your Cube deployment.

  • Define the churn metric
  • Compare customer segments
  • Review supporting results

What is customer churn analysis with AI?

Customer churn analysis measures how many customers stop using a product during a defined period and examines where those losses occur. An AI agent can help query the available metrics, compare plans or cohorts, and summarize the results. The customer population, churn event, and time window still need an explicit definition.

This workflow reviews historical churn using an existing Cube deployment and its modeled metrics. It does not train a churn prediction model. A segment with a high observed churn rate is a starting point for investigation; it does not establish why a customer left or predict which customer will leave next.

Start with a clear churn definition

Choose the churn event, customer population, and time period before comparing results. For plan comparisons, use the plan each customer had at the start of the period.

Examples for a June customer churn review
MetricIllustrative example
Customer churn rate46 of 1,000 customers active on June 1 left by June 30: 4.6%.
Churn by planStarter: 36 of 600 customers (6.0%); Growth: 9 of 300 (3.0%).
Gross revenue churnReport recurring revenue lost to cancellations and downgrades separately from customer churn.
Signup cohort retentionCompare customers who started in the same month at the same tenure.
The Prompt

Copy. Paste. Run your churn 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.

01Connect over MCP

Connect over MCP

Connect your agent to your existing Cube deployment and sign in through OAuth.

MCP endpoint
https://cubecloud.dev/mcp
Sign in to Cube

Complete OAuth in your agent to connect your Cube account.

Choose a deployment

Use your default deployment or select another one available to your account.

Read the MCP setup docs
01Connect with CLI

Connect with CLI

Install the Cube CLI and sign in from a terminal-capable agent.

Install the CLI
curl -fsSL https://raw.githubusercontent.com/cube-js/cube/master/install-cli.sh | sh
Log in (replace TENANT with your account name)
cube login --url https://TENANT.cubecloud.dev
Inspect API operations
cube spec --json
Read the CLI docs

02Run this prompt in your agent

Choose your agent and copy the prompt below.

Prompt for Codex
Use the Cube MCP server connected in Codex and select the intended deployment. Run read-only analytics queries. Run a customer churn review using my connected Cube deployment.Use read-only requests and keep credentials and customer identifiers private. DEFINITIONSInspect the model and report the available churn metric, its numerator,denominator, customer grain, time zone, and effective churn event.Use the approved business definition. If a required metric or input ismissing, explain the gap instead of inventing a measure or a result. ANALYSIS1. Review the last three complete calendar months. State their exact dates.2. For each month, show customers active at the start, customers from that   population who churned, and churn rate. Compare changes in percentage   points. Do not average segment rates to obtain the overall rate.3. Compare available segments such as plan or region. Show the opening   population, losses, rate, and share of total losses for each segment.   Flag small samples and use segment membership at the period start.4. If recurring revenue metrics exist, report gross revenue churn   separately. Explain whether contraction and expansion are included.5. If cohort data exists, compare retention at equal tenure. Keep calendar   month churn and signup-cohort retention separate. OUTPUTReturn the metric definitions, result tables, query context, and a conciseinterpretation. Separate observed patterns from hypotheses about causes.Recommend follow-up checks that can test those hypotheses. Do not inventchurn-risk scores or claim causal drivers without supporting evidence.

How it works

1

Confirm the churn definition

Check the effective churn event, opening customer population, time zone, and reporting period. Scheduled cancellations and subscription end dates can describe different events.

2

Compare rates and losses

Review monthly churn alongside customer counts. Compare plans or cohorts consistently so that a high percentage in a small segment does not hide a larger source of losses.

3

Investigate the pattern

Use the returned results to decide which segment needs a closer look. Check cancellation reasons, product activity, or support history before attributing churn to a specific cause.

What a churn review can reveal

Compare the monthly trend with churn by plan. The image uses fictional values; the worked example below shows how the June rate is calculated.

Worked example: fictional June customer churn by plan
Plan at period startOpening customersCustomers lostChurn rate
Starter600366.0%
Growth30093.0%
Enterprise10011.0%
Total1,000464.6%
  • The overall rate is 46 divided by 1,000, or 4.6%. Each lost customer belongs to the opening population. New customers acquired during June are excluded from both sides of this calculation.
  • Starter accounts contribute 36 of the 46 losses, or 78.3%. Their churn rate is also 3 percentage points higher than Growth, making Starter a useful place to begin a follow-up investigation.
  • The data does not explain why Starter customers left. Review cancellation reasons and changes in product usage before proposing an intervention, and measure its effect separately.

This hand-calculated example and the image use fictional values, not a prediction, benchmark, or customer result. Your output depends on the metrics and data available in your deployment.

Frequently Asked Questions

Divide customers from the opening population who churned during a period by customers active at the start, then multiply by 100. Use your agreed churn event and handle reactivations consistently. For example, 46 losses from 1,000 opening customers gives 4.6% churn.

Try Cube for free