> For the complete documentation index, see [llms.txt](https://help.gleantap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.gleantap.com/audience/ai-segmentation.md).

# AI Segmentation

**AI Segmentation lets you build segments by describing them in plain English.** Instead of assembling filters manually (find attribute → pick operator → set value → repeat), you type a sentence like "members who booked a class in the last 30 days but haven't visited yet" and Gleantap generates the segment for you.

This is a helper on top of the regular segment builder — the segments it produces are normal dynamic segments you can edit further, use in campaigns and flows, and combine with other segments.

For manual segment building, see Creating Segments and [Filter Options](/audience/creating-segments/filter-options.md).

***

## When to use AI Segmentation

**Good fit:**

* You know exactly who you want to reach but don't remember which filters get you there.
* The segment involves 3+ criteria and the manual assembly is tedious.
* You're new to Gleantap and haven't learned the filter builder yet.
* You want a fast first draft that you'll refine manually.

**Not the right tool:**

* The segment is a single simple filter (`Is Member = True`). Manual is faster.
* You need very precise operator control (e.g., specific null-handling behavior) — build it manually and use [Filter Options](/audience/creating-segments/filter-options.md) as a reference.
* You're building a segment used in a critical automation. AI drafts benefit from human review, especially for anything driving customer-facing sends.

***

## How to use it

1. Go to **Audience → Segments**.
2. Look for the AI Segmentation option (typically a distinct button or entry point on the segment creation flow).
3. Type a natural-language description of the audience you want. Be specific — see [Prompt patterns](#prompt-patterns-that-work) below.
4. Gleantap analyzes your description, maps it to available attributes and operators, and generates a segment with the appropriate filters.
5. Review the generated filters before saving.
6. Adjust manually if needed — the result is a normal dynamic segment; every filter is editable.

**Always review the output.** AI Segmentation is a productivity accelerator, not a replacement for your judgment. Confirm the filters match what you meant.

***

## Prompt patterns that work

Like other AI features (see [Creative Playground (AI)](/campaigns/creative-playground-ai.md)), the quality of the output depends on the specificity of your input.

**Weak prompt:** `dormant members`

**Better prompt:** `Members who haven't visited in 30 days but had at least 5 visits in the previous month`

**Even better:** add specifics for edge cases.

`Members with an active membership status who haven't visited in the last 30 days but had at least 5 visits in the 30 days prior — exclude anyone who has already been enrolled in the reactivation flow`

### Patterns to include

* **The status of the person** — member, lead, prospect, past-member
* **A time window** — "in the last N days", "since Jan 1", "over 60 days ago"
* **A behavior** — visited, purchased, booked, filled out a form, opened an email
* **Exclusions** — "except those who...", "not tagged X", "haven't received Y campaign"
* **Location** (for multi-location accounts) — "at Location A"

### Patterns to avoid

* **Very abstract goals** — "people who might churn" won't produce a good segment. Instead: "members with no visits in 21 days and no purchases in 30 days" — the specific behaviors that mean "might churn" for your business.
* **Ambiguous references** — "our best customers" is subjective. Define the criteria: "members with lifetime purchases over $500 AND at least 20 visits in the last year".

***

## What Gleantap actually does under the hood

When you describe a segment in natural language, Gleantap:

1. Parses the description to identify entities (attributes) and constraints (operators + values).
2. Matches those to the actual filter categories and attribute names available in your account.
3. Generates a segment configuration using the segment builder's normal filter format.
4. Presents the result for you to review.

The generated segment is stored the same way as one you built by hand. No special "AI segment" type exists — once saved, it's a regular segment.

***

## Refining AI-generated segments

After the initial generation, expect to make manual tweaks:

* **Swap operators.** The AI might pick `Is Greater Than 5` when you meant `Is Greater Than or Equal To 5`. Change it.
* **Adjust date windows.** "Recently" might be interpreted as 7 days when you meant 30. Refine.
* **Add exclusions.** The AI usually captures the positive criteria well; exclusions ("but not...") are trickier. Add them manually in the segment builder.
* **Change segment type.** AI-generated segments are typically **dynamic** (auto-updating). If you want a **static** snapshot, change the type before saving.

See [Filter Options → How missing data is handled](/audience/creating-segments/filter-options.md#how-missing-data-null-is-handled) for the null-handling behavior of operators — this catches most "the count is off" surprises.

***

## Common scenarios

### "The AI generated a segment with 0 results but I know there are matching contacts"

Two likely causes:

1. **The AI picked the wrong attribute.** Open the segment and inspect the filters — does the attribute name match the field you actually use? Some businesses have multiple similarly-named attributes (e.g., "Membership Type" vs a custom attribute called "Plan Type"); the AI may have picked the wrong one.
2. **Null handling is filtering everything out.** If the criteria involves a numeric or date field, contacts with no value for that field are excluded. See [Filter Options → How missing data is handled](/audience/creating-segments/filter-options.md#how-missing-data-null-is-handled).

### "The AI segment is close but I want to add an OR condition"

AI Segmentation typically produces AND-combined filters (all conditions must match). To add OR logic, open the segment in the manual builder and group filters — see the group logic in [Filter Options](/audience/creating-segments/filter-options.md).

### "How do I combine two AI-generated segments?"

Save both as regular segments, then create a third segment with `Is In Segment A OR Is In Segment B` using the manual builder. AI Segmentation is good for individual segment generation; composition is manual.

### "Can I regenerate if I don't like the first output?"

Yes — refine your description and generate again. The generated segment overwrites the previous attempt (until you save, at which point it becomes a saved segment).

### "The AI didn't use an attribute I know exists"

The AI works from the attributes visible in your workroom. If the attribute is custom and was only recently added, the AI may not have picked it up. Add it manually to the segment.

***

## Related pages

* Creating Segments — manual segment building
* [Filter Options](/audience/creating-segments/filter-options.md) — the full operator reference
* [Custom Attributes](/audience/creating-segments/custom-attributes.md) — segmenting on custom fields
* [Creative Playground (AI)](/campaigns/creative-playground-ai.md) — AI-assisted content generation (same "AI as a starting point" pattern)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.gleantap.com/audience/ai-segmentation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
