|
|
Customer Churn Prediction Agent
Author: Venkata Sudhakar
Customer churn costs ShopMax India revenue and acquisition budget. An ADK churn prediction agent scores customers on purchase recency, frequency, and spend (RFM), identifies those at high churn risk, and generates personalised retention offers - all in one automated workflow. Running this daily on the active customer base lets the retention team focus their outreach on the highest-risk customers.
The agent uses three tools: one to fetch RFM scores from BigQuery, one to compute the churn risk label, and one to generate a personalised retention offer. The model decides what offer to make based on the customer segment and their purchase history.
It gives the following output,
[C001] Priya Sharma (Mumbai) - HIGH churn risk (score: 5)
Last order: 75 days ago, 0 orders in last 90 days, lifetime spend Rs 1,45,000.
Action: Personal call from account manager with Rs 500 cashback offer
and free express delivery in Mumbai.
[C002] Amit Verma (Delhi) - LOW churn risk (score: 1)
Last order: 12 days ago, 4 orders in last 90 days, lifetime spend Rs 62,000.
Action: No intervention needed - customer is active.
[C003] Kavya Reddy (Hyderabad) - HIGH churn risk (score: 6)
Last order: 120 days ago, 0 orders in last 90 days, lifetime spend Rs 28,000.
Action: SMS + Email with 10% off next order code COMEBACK10.
The agent correctly identified Priya as a high-value churning customer deserving a premium retention approach (personal call + cashback), while Kavya gets a standard discount code. Amit is active and needs no intervention. This three-tier approach maximises retention ROI by reserving expensive interventions for high-value customers.
For ShopMax India production, run this agent as a daily Cloud Run job that reads all customers with RFM data from BigQuery, processes them in batches of 100, and writes the recommended actions to a retention_actions Firestore collection. The CRM system reads this collection to schedule SMS, email, and call centre tasks. Track which offers were redeemed using coupon code analytics in BigQuery to measure the agent's retention effectiveness over time.
|
|