Loading...
Loading...
Perform RFM (Recency, Frequency, Monetary) customer segmentation from transaction data. Use this skill when the user needs to segment customers by purchase behavior, identify high-value buyers, design retention campaigns, or prioritize marketing spend by customer value — even if they say 'who are our best customers', 'which customers are at risk of churning', or 'how do we target our marketing'.
npx skill4agent add asgard-ai-platform/skills ecom-rfm-analysisIRON LAW: RFM Uses ACTUAL Behavior, Not Demographics
RFM is behavioral segmentation — it classifies by what customers DO,
not who they ARE. A 25-year-old and a 65-year-old in the same RFM segment
should receive the same treatment. Never mix RFM with demographic
assumptions.| Dimension | What It Measures | How to Calculate |
|---|---|---|
| Recency (R) | Days since last purchase | Today - Last purchase date |
| Frequency (F) | Number of purchases in period | Count of distinct transactions |
| Monetary (M) | Total spend in period | Sum of transaction values |
| Segment | RFM Pattern | Description | Strategy |
|---|---|---|---|
| Champions | R5, F5, M5 | Best customers, recent, frequent, high-value | Reward, loyalty program, early access |
| Loyal | R4-5, F4-5, M3-5 | Consistent buyers | Upsell, cross-sell, referral program |
| Potential Loyalists | R4-5, F2-3, M2-3 | Recent, moderate frequency | Nurture to increase frequency |
| At Risk | R2-3, F3-5, M3-5 | Were frequent/high-value, not buying recently | Win-back campaign, special offers |
| Hibernating | R1-2, F1-2, M1-2 | Long dormant, low value | Low-cost reactivation or let go |
| New Customers | R5, F1, M1-2 | Just made first purchase | Onboarding, second-purchase incentive |
# RFM Analysis: {Business}
## Data Summary
- Customers analyzed: {N}
- Analysis window: {start} to {end}
- Transactions: {N}
## Segment Distribution
| Segment | Count | % | Avg R (days) | Avg F | Avg M |
|---------|-------|---|-------------|-------|-------|
| Champions | {N} | {%} | {days} | {count} | ${X} |
| At Risk | {N} | {%} | ... | ... | ... |
| ... | ... | ... | ... | ... | ... |
## Key Findings
- Top 20% customers contribute {X%} of revenue
- {N} customers at risk of churning (were high-value, now dormant)
- {N} new customers need second-purchase nurturing
## Recommended Actions
| Segment | Action | Channel | Expected Impact |
|---------|--------|---------|----------------|
| Champions | {loyalty reward} | {email/app} | Increase AOV by X% |
| At Risk | {win-back offer} | {email/SMS} | Recover X% of dormant revenue || Script | Description | Usage |
|---|---|---|
| Score customers on R/F/M and assign segment labels | |
python scripts/rfm_score.py --verifyreferences/rfm-implementation.mdreferences/clv-prediction.md