> ## Documentation Index
> Fetch the complete documentation index at: https://learn.kubit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cohorts

> Define reusable Kubit cohorts from events, measures, queries, funnels or retention, combine them, and apply them as report filters or breakdowns.

A cohort is a reusable segment of users, traces, sessions or spans, defined by behavior or metric conditions. Once saved, a cohort works as a filter or a breakdown segment in any report type. This page covers the five cohort types, time windows, compound cohorts, managing cohorts and using them in reports.

## When to use

| Use case | Example |
| - | - |
| Segment analysis | A "Power Users" cohort (users with more than 50 events), applied as a filter to any report |
| Behavioral targeting | Users who triggered a specific error span, with their retention tracked separately |
| Funnel-based segments | Users who dropped off at step 2 of the onboarding funnel |
| A/B comparison | Two cohorts side by side in one report, to compare a metric between them |
| Retention-based segments | Users retained on Day 7, compared with users who churned |
| Complex conditions | Several cohort conditions combined with AND or OR |

## How cohorts work

A cohort is evaluated every time it's used. It isn't a static list of members. Kubit recalculates which subjects match the conditions each time a report applies the cohort, using current data and that report's date range.

Saved cohorts are named entries in the **Cohort Dictionary**, so you can reuse them across reports without rebuilding the conditions.

## Cohort types

A simple cohort has one of five types. Each type decides membership from a different source. You pick the type in the dropdown after **who** in the cohort builder.

| Type | Label in the cohort builder | Membership comes from |
| - | - | - |
| Performed | **Performed Event(s)** | Whether, and how many times, a subject performed specific events |
| Measure | **Are part of Measure** | Whether a measure value meets a condition |
| Expression | **Are part of Query** | A measure from a saved Query report |
| Funnel | **Are part of Funnel** | Behavior in a saved Funnel report |
| Retention | **Are part of Retention** | Behavior in a saved Retention report |

The dropdown also has **Are part of Cohort**, which builds a cohort from another saved cohort.

![New Cohort builder with the type dropdown after All Unique Users who open, listing Performed Event(s), Are part of Cohort, Are part of Measure, Are part of Query, Are part of Funnel and Are part of Retention.](https://mintcdn.com/kubit/9i8QHxqek50tMBGy/images/reports/cohorts/cohort-types.png?fit=max\&auto=format\&n=9i8QHxqek50tMBGy\&q=85\&s=cfb05b3d28ec7a5d08c5ecbaeb0bc65a)

### Performed

A Performed cohort selects subjects by whether, and how many times, they performed specific events.

| Setting | What it sets |
| - | - |
| **Event conditions** | The events to check. Several events are joined with OR. |
| **Operator** | How the occurrence count is evaluated |
| **Operator values** | The threshold values |

Operators: is true (performed at all), is false (never performed), equals, not equals, less than, greater than, less or equal, greater or equal and between.

**Example:** users who performed `tool call` more than 5 times.

### Measure

A Measure cohort selects subjects by whether a measure value meets a condition.

| Setting | What it sets |
| - | - |
| **Measure** | The measure to evaluate, such as Count Distinct spans |
| **Operator** | The comparison operator |
| **Operator values** | The threshold values |
| **Percentile filter** | Optional. Filters by percentile rank instead of absolute value. |

Operators: equals, not equals, less than, greater than, less or equal, greater or equal and between.

**Example:** users whose total token count is greater than 10,000.

### Expression

An Expression cohort selects subjects by a measure from a saved [Query report](https://learn.kubit.ai/product-analytics/reports/query.md).

| Setting | What it sets |
| - | - |
| **Analysis** | The saved Query report |
| **Measure** | The measure from that report to evaluate |
| **Operator** | The comparison operator |
| **Operator values** | The threshold values |
| **Percentile filter** | Optional |

**Example:** users whose average latency, from the "Performance Overview" report, is above the 95th percentile.

### Funnel

A Funnel cohort selects subjects by their behavior in a saved [Funnel report](https://learn.kubit.ai/product-analytics/reports/funnel.md).

| Setting | What it sets |
| - | - |
| **Analysis** | The saved Funnel report |
| **Operator** | The funnel condition |
| **Operator values** | The step |
| **Look-forward window** | Days added to the conversion search window |

Operators: converted on (step N), dropped off before (step N) and dropped off since (step N).

**Example:** users who dropped off before step 3 of the checkout funnel.

### Retention

A Retention cohort selects subjects by their behavior in a saved [Retention report](https://learn.kubit.ai/product-analytics/reports/retention.md).

| Setting | What it sets |
| - | - |
| **Analysis** | The saved Retention report |
| **Operator** | The retention condition |
| **Operator values** | The time period values |
| **Look-forward window** | Days added to the retention search window |

Operators: retained, retained on (period N), retained since (period N), retained between (N and M), not retained, not retained on, not retained since and returned.

**Example:** users retained on Day 7 of the onboarding retention report.

## Time windows

A cohort's time window sets when a subject has to meet the cohort's conditions to count. Pick it in the dropdown next to the condition.

![Performed Event(s) condition for execute\_tool Add to Cart at least 10 times, with the time window dropdown open listing Overall, Current, In each, Rolling backward, Rolling backward between, Rolling forward and Rolling forward between.](https://mintcdn.com/kubit/9i8QHxqek50tMBGy/images/reports/cohorts/time-windows.png?fit=max\&auto=format\&n=9i8QHxqek50tMBGy\&q=85\&s=993fd4d26a7b80845cd8bf6d0388c402)

| Time window | A subject is in the cohort when it met the conditions |
| - | - |
| **Overall** | At least once during the report's whole date range, or the cohort's own date range |
| **Current** | On the same date as the report's own events |
| **In each** | In every time interval of the report. **Performed** and **Expression** cohorts only. |
| **Rolling backward** | Within the X days before any date in the report's range |
| **Rolling backward between** | Between X and Y days before the report's date range |
| **Rolling forward** | Within the X days after any date in the report's range |
| **Rolling forward between** | Between X and Y days after any date in the report's range |

### Current and In each

Take a Query report that counts `Enable Notifications` events over the last 7 days, filtered to a cohort of users who performed `Started a Stream`.

| Cohort time window | A user counts when |
| - | - |
| **Current** | They performed both events on the same day |
| **In each** | They performed both events in every time bucket of the report (every day, or every week) |

**Current** doesn't check when the subject performed the report's own events. **In each** does: both events have to happen in each interval.

### Rolling backward

A **Rolling backward** window of 7 days on a "Power User" cohort works like this:

| Report date range | Days Kubit checks | Result |
| - | - | - |
| A single day, Oct 15 | Oct 9 to Oct 15 | A user who performed the action on Oct 10 is in the cohort for Oct 15. |
| Oct 7 to Oct 14 | The 7 days before each date in the range: Oct 1 to Oct 7 for Oct 7, through Oct 8 to Oct 14 for Oct 14 | A user is in the cohort if they qualify for any date in the range. |

### Rolling backward between

A report for Jan 15 counts how many people used your app, filtered to users who renewed their subscription in the last 7 days but not today. The cohort is `Renewed Subscription` with a **Rolling backward between** window of 1 and 7 days. Kubit checks Jan 8 (7 days before) to Jan 14 (1 day before). A user who renewed in that window is in the Jan 15 result.

## Compound cohorts

A compound cohort combines simple cohorts with AND or OR. In the cohort builder, click **Add Cohort** to add another condition, then pick **AND** or **OR** between them.

| Constraint | Value |
| - | - |
| Max simple cohorts per compound cohort | **3** |
| Logic operators | AND, OR |

**Example:** users who performed `tool call` more than 5 times AND whose average latency is below 500 ms. This combines a Performed cohort and a Measure cohort with AND.

![Compound cohort in the New Cohort builder: a Performed Event(s) condition and an Are part of Measure condition on average Latency, joined by an AND dropdown, with the Add Cohort button highlighted.](https://mintcdn.com/kubit/9i8QHxqek50tMBGy/images/reports/cohorts/compound-cohort.png?fit=max\&auto=format\&n=9i8QHxqek50tMBGy\&q=85\&s=ade106cb8bcc3a4adcaedbef9fd01943)

## Manage cohorts

Saved cohorts live in the Cohort Dictionary, which opens from **Cohorts** in the left nav.

### Cohort Dictionary

| Feature | What it does |
| - | - |
| **Search** | Filters cohorts by name |
| **Filter** | Shows **Your Cohorts** or **All Cohorts** |
| **Sort** | Sorts by name, creator or last editor |
| **Edit** | Changes a cohort's name, description or conditions |
| **Delete** | Removes a cohort (soft delete) |
| **Categories** | Tags cohorts with categories |

### Create a cohort

1. Open **Cohorts** and click **New Cohort**.
2. Pick a cohort type and set its conditions.
3. Click **Inspect** to preview the result.
4. Click **Save**, then enter a name and an optional description.

![Empty Cohorts page reading No cohorts yet, with the New Cohort button highlighted in the top right next to History.](https://mintcdn.com/kubit/9i8QHxqek50tMBGy/images/reports/cohorts/new-cohort.png?fit=max\&auto=format\&n=9i8QHxqek50tMBGy\&q=85\&s=8bb0db184b6df5bd555e2d33165f21d4)

### Preview a cohort

Before you save, click **Inspect** to run the cohort and see how many subjects match. The preview shows the total, for example `62 Users in Total`, and a table of subjects with their last seen time and how many times they performed the event. **Export to CSV** downloads the list.

![Cohort preview after clicking Inspect: 62 Users in Total, with Export to CSV and Search, above a table with User, Last Seen and Performed columns.](https://mintcdn.com/kubit/9i8QHxqek50tMBGy/images/reports/cohorts/inspect-preview.png?fit=max\&auto=format\&n=9i8QHxqek50tMBGy\&q=85\&s=78be535cca13830f9b2643bc50ab3a81)

## Use cohorts in reports

Every report type can use a saved cohort in two ways: as a filter or as a breakdown segment.

### As a filter

A cohort filter limits the report to subjects in the cohort. The report runs as if the whole dataset were filtered to cohort members. To add one, click **+** next to **Report Filter** and pick **Cohort Filter**.

| Constraint | Value |
| - | - |
| Max cohorts as filters at once | **1** |

![Report builder with the Report Filter menu open, listing Global Filter, Cohort Filter and Measure Filter, with Cohort Filter highlighted.](https://mintcdn.com/kubit/9i8QHxqek50tMBGy/images/reports/cohorts/cohort-filter.png?fit=max\&auto=format\&n=9i8QHxqek50tMBGy\&q=85\&s=7df542d1d68f173f200a5c805a48edb7)

### As a breakdown segment

A cohort breakdown splits the report's results by cohort membership, next to any other Group By dimensions. To add one, click **+** next to **Group By** and pick **Add cohort**.

| Constraint | Value |
| - | - |
| Max cohort segments in a breakdown | **5** |

![Report builder with the Group By menu open, listing Add breakdown and Add cohort, with Add cohort highlighted.](https://mintcdn.com/kubit/9i8QHxqek50tMBGy/images/reports/cohorts/cohort-breakdown.png?fit=max\&auto=format\&n=9i8QHxqek50tMBGy\&q=85\&s=e81eaa79f9513400c9ff56001ec00f5a)

## MCP prompt examples

> "Create a cohort of users who triggered more than 10 tool calls in the last 30 days"

> "Build a cohort of users who dropped off before step 2 of the onboarding funnel"

> "Define a compound cohort: users who had more than 5 sessions AND whose average cost is above \$1.00"

> "Show me daily event count filtered to the 'Power Users' cohort over the last 30 days"

> "Compare average latency between the 'Free Tier' and 'Premium' cohorts in a bar chart"

> "Create a retention report for the 'New Users' cohort, starting event sign up, returning on any event"

## Related

* [Significance report](https://learn.kubit.ai/product-analytics/reports/significance.md): test whether a metric differs significantly between two cohorts.
* [Group By and binning](https://learn.kubit.ai/product-analytics/reports/common/group-by-and-binning.md): the other dimensions a cohort breakdown sits next to.
* [Filters](https://learn.kubit.ai/product-analytics/reports/common/filters.md): global and measure filters, next to cohort filters.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.