Back to cookbook

AI Prompt to Segment Customer Data Into Meaningful Groups

0 views Published

Make this prompt yours

Share

This AI prompt for customer segmentation takes a description of your customer dataset and asks the model to propose meaningful groups based on behavior, value, or lifecycle stage, along with the specific criteria that define each segment. It's built for analysts, marketers, and founders who have customer data in a spreadsheet or export but don't yet have a clear, actionable way to split it into groups worth treating differently.

Rather than asking for a vague list of "customer types," the prompt forces the model to name exact fields and thresholds for each segment, such as purchase frequency above a certain count or days since last order beyond a certain window, so the output can actually be turned into a filter or a query instead of staying a loose idea. It also asks for a short note on what action each segment suggests, since a segmentation that doesn't change what you do with a group isn't useful.

Once you have raw segmentation criteria back, pulling the relevant customer records together before running deeper analysis is often the next step; for large exports or multiple source files, Context Extractor can help pull only the relevant rows and fields out of bigger datasets before you build a full report.

Prompt template

Make this prompt yours

prompt-template
283 tokens
ROLE You are a data analyst helping design a customer segmentation scheme. CONTEXT Business type: [BUSINESS_TYPE, e.g. subscription SaaS, e-commerce retailer] Available fields: [LIST_OF_FIELDS, e.g. signup_date, last_order_date, total_orders, total_spend, plan_tier] Approximate data ranges: [FIELD_RANGES, e.g. total_orders typically 1-40, last_order_date spans the past 2 years] Business goal for this segmentation: [GOAL, e.g. identify customers to target for a win-back campaign] TASK Propose 4-6 customer segments that serve the stated goal. For each segment, provide: 1. A clear, specific name. 2. The exact rule or threshold on the available fields that defines membership. 3. A one-sentence description of what distinguishes this group. 4. One recommended action specific to this segment. CONSTRAINTS - Only use the fields listed above; do not assume data that wasn't mentioned. - Make segment rules mutually exclusive where possible, and note any customers who might not fit cleanly into any segment. - Keep each segment's rule specific enough to implement as a filter or query. OUTPUT FORMAT A numbered list of segments, each with Name, Rule, Description, and Recommended Action as labeled sub-points, followed by one line noting any edge cases not covered.

Want it sharper? Optimize this prompt with Prompt Optimizer, check it with the Prompt Debugger or shorten it with the Token Optimizer.

Example input

example-input
89 tokens
Business type: subscription SaaS Available fields: signup_date, last_login_date, monthly_spend, plan_tier, support_tickets_last_90_days Approximate data ranges: monthly_spend from $9 to $299, last_login_date spans the past 18 months, most accounts have 0-3 support tickets Business goal for this segmentation: identify accounts at risk of churning so the success team can reach out proactively

When to use it

  • You have a customer export with fields like order history, signup date, or plan tier, but no defined way to group them yet.
  • You're planning a marketing campaign and need distinct segments with different messaging rather than one message for everyone.
  • You want to identify your highest-value customers and your at-risk or lapsing customers as separate, actionable groups.
  • You need segment definitions specific enough to hand to someone else to turn into a database query or dashboard filter.

Best practices

  • List the actual columns available in your dataset so the model proposes segments based on data you really have, not fields you'd need to collect.
  • Ask for a specific threshold or rule for each segment, not just a label, so the definition can be turned into a filter later.
  • Request a short recommended action per segment so the output connects to a decision, not just a description.
  • Share rough counts or ranges for key fields (like typical order frequency) so segment thresholds are realistic for your actual customer base.

Common mistakes

  • Asking for segments without listing available fields, which produces generic marketing personas instead of criteria you can actually apply.
  • Accepting vague segment names like 'loyal customers' without a concrete rule for who qualifies.
  • Creating too many overlapping segments that don't lead to different actions, making the segmentation harder to use than no segmentation at all.
  • Forgetting to ask the model to flag edge cases, like customers who don't clearly fit any proposed segment.

FAQs

How many customer segments should I create?

Most useful segmentations land between 3 and 6 groups; more than that usually means segments stop mapping to genuinely different actions, which defeats the purpose of segmenting in the first place.

What fields are most useful for segmenting customers?

Recency, frequency, and monetary value (how recently they bought, how often, and how much) are the most common starting point, supplemented by lifecycle fields like signup date or plan tier when available.

Can this prompt work with a small customer base?

Yes, but with very few customers some proposed segments may end up with only one or two members; it helps to tell the model your approximate customer count so it can size segment rules appropriately.

How is this different from RFM analysis?

RFM (recency, frequency, monetary) is one common input to segmentation, but this prompt is broader and can incorporate any fields you have, including lifecycle stage, support history, or plan tier, not just the three RFM dimensions.

How can I check this prompt's clarity before running it on a large export?

Prompt Debugger — it's useful for catching vague constraints in the segment rules before you run the prompt against a full customer dataset and get back criteria that are too loose to apply.

Found this prompt useful? Share it.

Share

More in Data Analysis

Data Analysis

AI Prompt to Perform Root Cause Analysis on a Sudden Metric Drop

This root cause analysis prompt helps analysts, product managers, and founders figure out why a key metric — signups, conversion rate, reven…

ROLE: You are a data analyst helping investigate a sudden change in a business metric.

CONTEXT:
- Metric: [METRIC NAME, e.g. "trial-to-paid conversion rate"]
- Normal value: [BASELINE VALUE OR RANGE]
- New value: [CURRENT VALUE]
- Time window of the drop: [START DATE] to [END DATE]
- Relevant data available: [PASTE NUMBERS, A TABLE, OR DESCRIBE THE CHARTS YOU HAVE]
- Known changes around this time: [LIST ANY DEPLOYS, CAMPAIGNS, PRICING CHANGES, OR "none known"]
- Audience for this analysis: [e.g. "engineering team", "founder", "board update"]

TASK:
1. List the most plausible causes for this drop, ordered from most to least likely given the data provided.
2. For each cause, state what evidence in the data supports or weakens it.
3. For each cause, specify the exact additional data or check that would confirm or rule it out.
4. Flag if the drop could simply be normal variance, and explain what would show that.
5. End with a short, plain-language summary suitable for the stated audience.

CONSTRAINTS:
- Do not state a cause as confirmed unless the provided data directly supports it — use "likely," "possible," or "unconfirmed" language for anything else.
- Do not invent data points that were not provided.
- Keep the hypothesis list to a maximum of 5 items.

OUTPUT FORMAT:
A numbered list of hypotheses (most to least likely), each with: supporting/weakening evidence, and the next check to run. Followed by a short summary paragraph.

Make this prompt yours

Data Analysis

AI Prompt to Build a Data Dictionary From a Spreadsheet or Database Table

This data dictionary prompt asks ChatGPT, Claude, or Gemini to turn a raw spreadsheet or database table into a clear reference document: eve…

You are a data analyst creating a data dictionary for a dataset so other people can understand and use it correctly.

Context:
- Source: [e.g., spreadsheet export, PostgreSQL table, CSV file]
- Table or sheet name: [NAME]
- Audience: [e.g., BI analysts, a new engineer, external partner]

Data sample (paste column headers plus 10-20 real rows below):
[PASTE SAMPLE DATA HERE]

Task:
For each column in the sample, produce:
1. Column name as it appears in the source.
2. Inferred data type (string, integer, decimal, date, boolean, categorical, etc.).
3. A one-sentence description of what the column represents, based only on the sample data.
4. Notes on anything unusual: nulls, mixed formats, inconsistent units, likely key or foreign key, or values that look like placeholders.
5. A confidence level (High, Medium, Low) for how certain you are about the description.

Constraints:
- Do not state a description as certain if the sample doesn't clearly support it; use Medium or Low confidence instead.
- Call out any columns that look like duplicates of each other or likely primary/foreign keys in a separate summary section.
- Keep descriptions to one sentence each.

Output format:
A single Markdown table with columns: Column Name | Data Type | Description | Notes | Confidence, followed by a short 'Keys and Relationships' summary section.

Make this prompt yours

Data Analysis

AI Prompt to Query and Analyze Supabase Data via Supabase's MCP Server

This prompt is for teams running Claude or ChatGPT with Supabase's MCP server connected, so the model can read a live Postgres database dire…

You are a data analyst with read-only access to a Postgres database through an MCP database connection. Follow these rules for every request:

ROLE
- Act as a careful analyst who verifies before concluding.

CONTEXT
- Database: [DATABASE NAME]
- Relevant tables: [TABLE NAMES, e.g. users, subscriptions, events]
- Business question: [QUESTION, e.g. how many trial users converted to paid in the last 30 days]

CONSTRAINTS
- Only run read-only SELECT queries. Never run INSERT, UPDATE, DELETE, or DDL statements.
- Before answering, list the exact query or queries you plan to run and wait for confirmation if any query touches more than [ROW LIMIT] rows.
- If a referenced table or column does not exist, say so explicitly instead of guessing a substitute.
- Show a sample of up to 5 returned rows alongside any aggregate numbers.

OUTPUT FORMAT
1. Queries run (as SQL)
2. Row counts and sample data
3. Plain-language answer to the business question
4. Any caveats about data quality or missing values

Task: [SPECIFIC ANALYSIS REQUEST]

Make this prompt yours