๐Ÿ“Š

Customer Classifier

Automatically categorize customers based on purchase history or custom rules.

Excel โญโญ Intermediate โฑ๏ธ 5 minutes

๐Ÿ˜ซ The Pain Point

You have 10,000 customers and need to segment them by purchase frequency. VIP (>10 orders), Regular (3-10), New (1-2), Inactive (0 in 6 months). Doing this manually is error-prone.

๐Ÿš€ Agentic Solution

A Rule-Based Classifier that categorizes based on your business logic.

Key Features:

  • Custom Rules: Define your own thresholds.
  • Multiple Criteria: Combine amount, frequency, recency.
  • RFM Analysis: Built-in Recency-Frequency-Monetary scoring.

โš”๏ธ Phase 1: Commander (Quick Fix)

For quick classification.

Prompt:

โ€œI have an Excel customers.xlsx with columns โ€˜Customer_IDโ€™, โ€˜Order_Countโ€™, โ€˜Total_Spentโ€™, โ€˜Last_Order_Dateโ€™. Write a Python script using Pandas to:

  1. Classify:
    • VIP: Order_Count > 10 AND Total_Spent > 10M
    • Regular: Order_Count 3-10
    • New: Order_Count 1-2
    • Inactive: Last_Order > 6 months ago
  2. Add: New column โ€˜Segmentโ€™.
  3. Output: Save with segment counts summary.

Print distribution of segments.โ€

Result: Segmented customer list for marketing.

๐Ÿ—๏ธ Phase 2: Architect (Permanent Tool)

Engineering Prompt:

**Role:** Python Tool Developer
**Task:** Create a "Customer Segmentation Tool".

**Requirements:**
1.  **GUI:**
    *   Select Excel file.
    *   Rule builder: Column, Operator, Value.
    *   Multiple rules with AND/OR.
    *   Preview segment distribution.
    *   "Apply" button.

2.  **Logic:**
    *   Parse rules into Pandas queries.
    *   Handle date comparisons.
    *   Show segment statistics.

3.  **Deliverables:**
    *   `customer_classifier.py`
    *   `run.bat`, `run.sh`
    *   `requirements.txt`

๐Ÿง  Prompt Decoding

  • RFM Analysis: Recency (when), Frequency (how often), Monetary (how much) - standard marketing segmentation.

๐Ÿ› ๏ธ Instructions

  1. Copy Prompt โ†’ Adjust thresholds โ†’ Run.

Related Workflows

Explore other categories

๐Ÿ“ฌ

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

๐Ÿ“– Free eBook Guide ๐Ÿ“ฆ 7 Ready-to-use Scripts ๐Ÿ”” Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.