Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(ai): document that lifecycle insights exclude anonymous users (#71883)

Ben Lea483215581363
diff --git a/ee/hogai/context/insight/prompts.py b/ee/hogai/context/insight/prompts.py
index 58ff95a4983d..f475007b8296 100644
--- a/ee/hogai/context/insight/prompts.py
+++ b/ee/hogai/context/insight/prompts.py
@@ -117,6 +117,8 @@ Date|$pageview -> sign up conversion|$pageview -> sign up drop-off
LIFECYCLE_EXAMPLE_PROMPT = """
You are given a table with the results of a lifecycle query. Values are separated by the pipe character "|" and rows are separated by newlines. The first row is the header row. The first column is the date, and the remaining columns show the count of users in each lifecycle status for that period: New (first-time users), Returning (active in the previous period), Resurrecting (returning after inactivity), and Dormant (previously active but inactive, shown as negative values). If the query has multiple event series, each series is shown in a separate section with an "Event:" header.
+Important: for event and action series, lifecycle queries only include users with person profiles. Events with `$process_person_profile: false` are excluded entirely; these come from anonymous users on SDKs configured with `person_profiles: 'identified_only'`, the default in posthog-js. Data warehouse series are not affected by this exclusion.
+
Example:
```
Date|New|Returning|Resurrecting|Dormant
@@ -320,17 +322,6 @@ Interval|$pageview|signup
```
""".strip()
-LIFECYCLE_EXAMPLE_PROMPT = """
-You are given a table with the results of a lifecycle query. Values are separated by the pipe character "|" and rows are separated by newlines. The first row is the header row. The first column is the date, and the remaining columns are the user counts for each lifecycle status: new, returning, resurrecting, and dormant. Dormant values are negative, representing users who stopped performing the event.
-
-Example:
-```
-Date|new|returning|resurrecting|dormant
-2025-01-20|46|120|15|-30
-2025-01-21|38|105|22|-45
-```
-""".strip()
-
BOX_PLOT_EXAMPLE_PROMPT = """
You are given a table with the results of a box plot query showing statistical distributions of a numeric property over time. Values are separated by the pipe character "|" and rows are separated by newlines. The first row is the header row. Each row shows the distribution statistics for a date period: minimum, 25th percentile (P25), median, 75th percentile (P75), maximum, and mean.
diff --git a/posthog/hogql_queries/insights/lifecycle/lifecycle_query_runner.py b/posthog/hogql_queries/insights/lifecycle/lifecycle_query_runner.py
index 8c5aebacfb0f..22d960d19ce0 100644
--- a/posthog/hogql_queries/insights/lifecycle/lifecycle_query_runner.py
+++ b/posthog/hogql_queries/insights/lifecycle/lifecycle_query_runner.py
@@ -325,6 +325,9 @@ class LifecycleQueryRunner(AnalyticsQueryRunner[LifecycleQueryResponse]):
def event_filter(self) -> ast.Expr:
event_filters: list[ast.Expr] = []
if not self.is_data_warehouse_series:
+ # Personless (anonymous) events are excluded: lifecycle classifies a user's activity
+ # across periods, which requires a person profile. This makes lifecycle counts lower
+ # than unique-user trends for projects with anonymous traffic.
event_filters.append(
ast.CompareOperation(
left=ast.Field(chain=["properties", "$process_person_profile"]),
diff --git a/services/mcp/definitions/prompts/query-lifecycle-actors.md b/services/mcp/definitions/prompts/query-lifecycle-actors.md
index 0cc630de129f..d9b671fd2bd4 100644
--- a/services/mcp/definitions/prompts/query-lifecycle-actors.md
+++ b/services/mcp/definitions/prompts/query-lifecycle-actors.md
@@ -6,7 +6,7 @@ Selectors:
- `day` **(required)**: the bucket date as an ISO date string (YYYY-MM-DD), e.g. `"2024-01-15"`. Must align with the source's interval (a day boundary for `interval=day`, the start of the week for `interval=week`, etc.).
- `status` **(required)**: which lifecycle bucket to drill into. One of `new`, `returning`, `resurrecting`, `dormant`.
- - `new` — users performing the event for the first time during the period.
+ - `new` — users seen for the first time (person profile created) during the period.
- `returning` — users active in the previous period and active in this one.
- `resurrecting` — users inactive for one or more periods and active again now.
- `dormant` — users active in the previous period but inactive now.
@@ -17,6 +17,7 @@ Each returned row contains `distinct_id`, `email`, and `name`. Results are limit
Guidance:
+- Lifecycle excludes anonymous users (events with `$process_person_profile: false`), so actor lists only contain identified users — anonymous visitors never appear in any bucket.
- Lifecycle insights only support a single series and do not expose `compareFilter`, so there is no `series` or `compare` selector here.
- Keep the `source` lifecycle query minimal — only include the filters needed to define the same lifecycle population the user is asking about.
- For large buckets, tighten the source query (filters, date range) rather than expecting more rows.
diff --git a/services/mcp/definitions/prompts/query-lifecycle.md b/services/mcp/definitions/prompts/query-lifecycle.md
index 2b29a2bb440a..2f3f909ad5fa 100644
--- a/services/mcp/definitions/prompts/query-lifecycle.md
+++ b/services/mcp/definitions/prompts/query-lifecycle.md
@@ -81,11 +81,15 @@ Lifecycle insights analyze a **single event or action** over time. The `series`
Each user is categorized into one of four statuses for each time period:
-- **New** – the user performed the event for the first time ever during this period.
+- **New** – the user was seen for the first time (their person profile was created) during this period.
- **Returning** – the user was active in the previous period and is active again in the current period.
- **Resurrecting** – the user was inactive for one or more periods and became active again.
- **Dormant** – the user was active in the previous period but did not perform the event in the current period. Dormant counts are shown as negative values.
+## Anonymous users are excluded
+
+Lifecycle only counts users with person profiles. Events with `$process_person_profile: false` are excluded entirely; these come from anonymous users on SDKs configured with `person_profiles: 'identified_only'`, the default in posthog-js. In projects with anonymous traffic, lifecycle totals are therefore expected to be far lower than a trends unique-user count of the same event. To confirm a gap is this expected exclusion rather than a data problem, add a filter to the trends query excluding events where `$process_person_profile` is `false`. If the gap persists after that, investigate further.
+
## Time interval
Specify the time interval using the `interval` field. Available intervals are: `hour`, `day`, `week`, `month`. The default is `day`.
@@ -160,6 +164,7 @@ Lifecycle insights do **not** support math aggregation types. Do not set `math`
# Reminders
- Lifecycle insights support only **one** series — do not add multiple events or actions.
+- Lifecycle excludes anonymous users (events with `$process_person_profile: false`), so totals are expected to be lower than unique-user trends of the same event.
- Do not set `math` on the series node — lifecycle does not support math aggregation.
- Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details.
- Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution.
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 84fc6a761981..98e7244188a8 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -6507,7 +6507,7 @@
"system_prompt_hint": "List persons who converted through or dropped off at a given funnel step"
},
"query-lifecycle": {
- "description": "Run a lifecycle query to categorize users into lifecycle stages based on their activity pattern relative to a single event or action. Lifecycle insights break users into four mutually exclusive groups for each time period: new, returning, resurrecting, and dormant. They're useful for understanding the composition of your active users and diagnosing growth or churn patterns.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters.\n\nExamples of use cases include:\n\n- What is the composition of my active users over time?\n- Are we gaining new users faster than we're losing dormant ones?\n- How many users resurrected (came back after being inactive) last week?\n- Is the returning user base growing or shrinking?\n- How does user engagement change after a product launch?\n\nCRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization.\n\n# Data narrowing\n\n## Property filters\n\nUse property filters to narrow results. Only include property filters when they are essential to directly answer the user's question. Avoid adding them if the question can be addressed without additional segmentation and always use the minimum set of property filters needed.\n\nIMPORTANT: Do not check if a property is set unless the user explicitly asks for it.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the context or objective of the user's query.** Avoid using properties for identification like IDs. Instead, prioritize filtering based on general properties like `paidCustomer` or `icp_score`.\n- **Ensure that you find both the property group and name.** Property groups should be one of the following: event, person, session, group.\n- After selecting a property, **validate that the property value accurately reflects the intended criteria**.\n- **Find the suitable operator for type** (e.g., `contains`, `is set`).\n- If the operator requires a value, use the `read-data-schema` tool to find the property values.\n- You set logical operators to combine multiple properties of a single series: AND or OR.\n\nInfer the property groups from the user's request. If your first guess doesn't yield any results, try to adjust the property group.\n\nSupported operators for the String type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- contains (icontains)\n- doesn't contain (not_icontains)\n- matches regex (regex)\n- doesn't match regex (not_regex)\n- is set\n- is not set\n\nSupported operators for the Numeric type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- greater than (gt)\n- less than (lt)\n- is set\n- is not set\n\nSupported operators for the DateTime type are:\n\n- equals (is_date_exact)\n- doesn't equal (is_not for existence check)\n- before (is_date_before)\n- after (is_date_after)\n- is set\n- is not set\n\nSupported operators for the Boolean type are:\n\n- equals\n- doesn't equal\n- is set\n- is not set\n\nAll operators take a single value except for `equals` and `doesn't equal` which can take one or more values (as an array).\n\n## Time period\n\nYou should not filter events by time using property filters. Instead, use the `dateRange` field. If the question doesn't mention time, use last 30 days as a default time period.\n\n# Lifecycle guidelines\n\nLifecycle insights analyze a **single event or action** over time. The `series` array must contain exactly one item. If the user mentions multiple events, pick the most relevant one or clarify.\n\n## Lifecycle statuses\n\nEach user is categorized into one of four statuses for each time period:\n\n- **New** – the user performed the event for the first time ever during this period.\n- **Returning** – the user was active in the previous period and is active again in the current period.\n- **Resurrecting** – the user was inactive for one or more periods and became active again.\n- **Dormant** – the user was active in the previous period but did not perform the event in the current period. Dormant counts are shown as negative values.\n\n## Time interval\n\nSpecify the time interval using the `interval` field. Available intervals are: `hour`, `day`, `week`, `month`. The default is `day`.\n\nUnless the user has specified otherwise, use the following default interval:\n\n- If the time period is less than two days, use the `hour` interval.\n- If the time period is less than a month, use the `day` interval.\n- If the time period is less than three months, use the `week` interval.\n- Otherwise, use the `month` interval.\n\n## Toggled lifecycles\n\nUse `toggledLifecycles` in `lifecycleFilter` to control which lifecycle statuses are displayed. By default, all four statuses are shown. Only set this when the user wants to focus on specific statuses (e.g., only new and dormant users).\n\n## Math aggregation\n\nLifecycle insights do **not** support math aggregation types. Do not set `math` on the series node.\n\n# Examples\n\n## Daily lifecycle of pageviews over the last 30 days\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"$pageview\" }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"interval\": \"day\"\n}\n```\n\n## Weekly lifecycle of sign ups, excluding test accounts\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"user signed up\" }],\n \"dateRange\": { \"date_from\": \"-90d\" },\n \"interval\": \"week\",\n \"filterTestAccounts\": true\n}\n```\n\n## Monthly lifecycle of \"insight created\" showing only new and dormant users\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"insight created\" }],\n \"dateRange\": { \"date_from\": \"-12m\" },\n \"interval\": \"month\",\n \"lifecycleFilter\": {\n \"toggledLifecycles\": [\"new\", \"dormant\"]\n },\n \"filterTestAccounts\": true\n}\n```\n\n## Lifecycle of purchases by mobile users\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"purchase completed\" }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"interval\": \"day\",\n \"properties\": [{ \"key\": \"$os\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"iOS\", \"Android\"] }]\n}\n```\n\n# Reminders\n\n- Lifecycle insights support only **one** series — do not add multiple events or actions.\n- Do not set `math` on the series node — lifecycle does not support math aggregation.\n- Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details.\n- Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution.",
+ "description": "Run a lifecycle query to categorize users into lifecycle stages based on their activity pattern relative to a single event or action. Lifecycle insights break users into four mutually exclusive groups for each time period: new, returning, resurrecting, and dormant. They're useful for understanding the composition of your active users and diagnosing growth or churn patterns.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters.\n\nExamples of use cases include:\n\n- What is the composition of my active users over time?\n- Are we gaining new users faster than we're losing dormant ones?\n- How many users resurrected (came back after being inactive) last week?\n- Is the returning user base growing or shrinking?\n- How does user engagement change after a product launch?\n\nCRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization.\n\n# Data narrowing\n\n## Property filters\n\nUse property filters to narrow results. Only include property filters when they are essential to directly answer the user's question. Avoid adding them if the question can be addressed without additional segmentation and always use the minimum set of property filters needed.\n\nIMPORTANT: Do not check if a property is set unless the user explicitly asks for it.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the context or objective of the user's query.** Avoid using properties for identification like IDs. Instead, prioritize filtering based on general properties like `paidCustomer` or `icp_score`.\n- **Ensure that you find both the property group and name.** Property groups should be one of the following: event, person, session, group.\n- After selecting a property, **validate that the property value accurately reflects the intended criteria**.\n- **Find the suitable operator for type** (e.g., `contains`, `is set`).\n- If the operator requires a value, use the `read-data-schema` tool to find the property values.\n- You set logical operators to combine multiple properties of a single series: AND or OR.\n\nInfer the property groups from the user's request. If your first guess doesn't yield any results, try to adjust the property group.\n\nSupported operators for the String type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- contains (icontains)\n- doesn't contain (not_icontains)\n- matches regex (regex)\n- doesn't match regex (not_regex)\n- is set\n- is not set\n\nSupported operators for the Numeric type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- greater than (gt)\n- less than (lt)\n- is set\n- is not set\n\nSupported operators for the DateTime type are:\n\n- equals (is_date_exact)\n- doesn't equal (is_not for existence check)\n- before (is_date_before)\n- after (is_date_after)\n- is set\n- is not set\n\nSupported operators for the Boolean type are:\n\n- equals\n- doesn't equal\n- is set\n- is not set\n\nAll operators take a single value except for `equals` and `doesn't equal` which can take one or more values (as an array).\n\n## Time period\n\nYou should not filter events by time using property filters. Instead, use the `dateRange` field. If the question doesn't mention time, use last 30 days as a default time period.\n\n# Lifecycle guidelines\n\nLifecycle insights analyze a **single event or action** over time. The `series` array must contain exactly one item. If the user mentions multiple events, pick the most relevant one or clarify.\n\n## Lifecycle statuses\n\nEach user is categorized into one of four statuses for each time period:\n\n- **New** – the user was seen for the first time (their person profile was created) during this period.\n- **Returning** – the user was active in the previous period and is active again in the current period.\n- **Resurrecting** – the user was inactive for one or more periods and became active again.\n- **Dormant** – the user was active in the previous period but did not perform the event in the current period. Dormant counts are shown as negative values.\n\n## Anonymous users are excluded\n\nLifecycle only counts users with person profiles. Events with `$process_person_profile: false` are excluded entirely; these come from anonymous users on SDKs configured with `person_profiles: 'identified_only'`, the default in posthog-js. In projects with anonymous traffic, lifecycle totals are therefore expected to be far lower than a trends unique-user count of the same event. To confirm a gap is this expected exclusion rather than a data problem, add a filter to the trends query excluding events where `$process_person_profile` is `false`. If the gap persists after that, investigate further.\n\n## Time interval\n\nSpecify the time interval using the `interval` field. Available intervals are: `hour`, `day`, `week`, `month`. The default is `day`.\n\nUnless the user has specified otherwise, use the following default interval:\n\n- If the time period is less than two days, use the `hour` interval.\n- If the time period is less than a month, use the `day` interval.\n- If the time period is less than three months, use the `week` interval.\n- Otherwise, use the `month` interval.\n\n## Toggled lifecycles\n\nUse `toggledLifecycles` in `lifecycleFilter` to control which lifecycle statuses are displayed. By default, all four statuses are shown. Only set this when the user wants to focus on specific statuses (e.g., only new and dormant users).\n\n## Math aggregation\n\nLifecycle insights do **not** support math aggregation types. Do not set `math` on the series node.\n\n# Examples\n\n## Daily lifecycle of pageviews over the last 30 days\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"$pageview\" }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"interval\": \"day\"\n}\n```\n\n## Weekly lifecycle of sign ups, excluding test accounts\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"user signed up\" }],\n \"dateRange\": { \"date_from\": \"-90d\" },\n \"interval\": \"week\",\n \"filterTestAccounts\": true\n}\n```\n\n## Monthly lifecycle of \"insight created\" showing only new and dormant users\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"insight created\" }],\n \"dateRange\": { \"date_from\": \"-12m\" },\n \"interval\": \"month\",\n \"lifecycleFilter\": {\n \"toggledLifecycles\": [\"new\", \"dormant\"]\n },\n \"filterTestAccounts\": true\n}\n```\n\n## Lifecycle of purchases by mobile users\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"purchase completed\" }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"interval\": \"day\",\n \"properties\": [{ \"key\": \"$os\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"iOS\", \"Android\"] }]\n}\n```\n\n# Reminders\n\n- Lifecycle insights support only **one** series — do not add multiple events or actions.\n- Lifecycle excludes anonymous users (events with `$process_person_profile: false`), so totals are expected to be lower than unique-user trends of the same event.\n- Do not set `math` on the series node — lifecycle does not support math aggregation.\n- Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details.\n- Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution.",
"category": "Query wrappers",
"feature": "insights",
"summary": "Run a lifecycle query",
@@ -6522,7 +6522,7 @@
"system_prompt_hint": "New, returning, resurrecting, dormant user composition"
},
"query-lifecycle-actors": {
- "description": "List the persons in a specific bucket of a lifecycle insight. Use this to answer \"who are the new / returning / resurrecting / dormant users on day Y?\".\n\n`source` is the lifecycle query that defines the population (event, date range, filters). Build it directly when the user's request already names a bucket-day, or reuse one you previously ran via `query-lifecycle` when drilling in from a chart.\n\nSelectors:\n\n- `day` **(required)**: the bucket date as an ISO date string (YYYY-MM-DD), e.g. `\"2024-01-15\"`. Must align with the source's interval (a day boundary for `interval=day`, the start of the week for `interval=week`, etc.).\n- `status` **(required)**: which lifecycle bucket to drill into. One of `new`, `returning`, `resurrecting`, `dormant`.\n - `new` — users performing the event for the first time during the period.\n - `returning` — users active in the previous period and active in this one.\n - `resurrecting` — users inactive for one or more periods and active again now.\n - `dormant` — users active in the previous period but inactive now.\n\nResponse:\n\nEach returned row contains `distinct_id`, `email`, and `name`. Results are limited to the top 100 actors. Matched session recordings are not returned — the lifecycle runner does not project per-actor matching events.\n\nGuidance:\n\n- Lifecycle insights only support a single series and do not expose `compareFilter`, so there is no `series` or `compare` selector here.\n- Keep the `source` lifecycle query minimal — only include the filters needed to define the same lifecycle population the user is asking about.\n- For large buckets, tighten the source query (filters, date range) rather than expecting more rows.",
+ "description": "List the persons in a specific bucket of a lifecycle insight. Use this to answer \"who are the new / returning / resurrecting / dormant users on day Y?\".\n\n`source` is the lifecycle query that defines the population (event, date range, filters). Build it directly when the user's request already names a bucket-day, or reuse one you previously ran via `query-lifecycle` when drilling in from a chart.\n\nSelectors:\n\n- `day` **(required)**: the bucket date as an ISO date string (YYYY-MM-DD), e.g. `\"2024-01-15\"`. Must align with the source's interval (a day boundary for `interval=day`, the start of the week for `interval=week`, etc.).\n- `status` **(required)**: which lifecycle bucket to drill into. One of `new`, `returning`, `resurrecting`, `dormant`.\n - `new` — users seen for the first time (person profile created) during the period.\n - `returning` — users active in the previous period and active in this one.\n - `resurrecting` — users inactive for one or more periods and active again now.\n - `dormant` — users active in the previous period but inactive now.\n\nResponse:\n\nEach returned row contains `distinct_id`, `email`, and `name`. Results are limited to the top 100 actors. Matched session recordings are not returned — the lifecycle runner does not project per-actor matching events.\n\nGuidance:\n\n- Lifecycle excludes anonymous users (events with `$process_person_profile: false`), so actor lists only contain identified users — anonymous visitors never appear in any bucket.\n- Lifecycle insights only support a single series and do not expose `compareFilter`, so there is no `series` or `compare` selector here.\n- Keep the `source` lifecycle query minimal — only include the filters needed to define the same lifecycle population the user is asking about.\n- For large buckets, tighten the source query (filters, date range) rather than expecting more rows.",
"category": "Query wrappers",
"feature": "insights",
"summary": "List persons in a lifecycle bucket",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index ed2e762c84d3..c8b8316f6e33 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -6985,7 +6985,7 @@
"system_prompt_hint": "List persons who converted through or dropped off at a given funnel step"
},
"query-lifecycle": {
- "description": "Run a lifecycle query to categorize users into lifecycle stages based on their activity pattern relative to a single event or action. Lifecycle insights break users into four mutually exclusive groups for each time period: new, returning, resurrecting, and dormant. They're useful for understanding the composition of your active users and diagnosing growth or churn patterns.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters.\n\nExamples of use cases include:\n\n- What is the composition of my active users over time?\n- Are we gaining new users faster than we're losing dormant ones?\n- How many users resurrected (came back after being inactive) last week?\n- Is the returning user base growing or shrinking?\n- How does user engagement change after a product launch?\n\nCRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization.\n\n# Data narrowing\n\n## Property filters\n\nUse property filters to narrow results. Only include property filters when they are essential to directly answer the user's question. Avoid adding them if the question can be addressed without additional segmentation and always use the minimum set of property filters needed.\n\nIMPORTANT: Do not check if a property is set unless the user explicitly asks for it.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the context or objective of the user's query.** Avoid using properties for identification like IDs. Instead, prioritize filtering based on general properties like `paidCustomer` or `icp_score`.\n- **Ensure that you find both the property group and name.** Property groups should be one of the following: event, person, session, group.\n- After selecting a property, **validate that the property value accurately reflects the intended criteria**.\n- **Find the suitable operator for type** (e.g., `contains`, `is set`).\n- If the operator requires a value, use the `read-data-schema` tool to find the property values.\n- You set logical operators to combine multiple properties of a single series: AND or OR.\n\nInfer the property groups from the user's request. If your first guess doesn't yield any results, try to adjust the property group.\n\nSupported operators for the String type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- contains (icontains)\n- doesn't contain (not_icontains)\n- matches regex (regex)\n- doesn't match regex (not_regex)\n- is set\n- is not set\n\nSupported operators for the Numeric type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- greater than (gt)\n- less than (lt)\n- is set\n- is not set\n\nSupported operators for the DateTime type are:\n\n- equals (is_date_exact)\n- doesn't equal (is_not for existence check)\n- before (is_date_before)\n- after (is_date_after)\n- is set\n- is not set\n\nSupported operators for the Boolean type are:\n\n- equals\n- doesn't equal\n- is set\n- is not set\n\nAll operators take a single value except for `equals` and `doesn't equal` which can take one or more values (as an array).\n\n## Time period\n\nYou should not filter events by time using property filters. Instead, use the `dateRange` field. If the question doesn't mention time, use last 30 days as a default time period.\n\n# Lifecycle guidelines\n\nLifecycle insights analyze a **single event or action** over time. The `series` array must contain exactly one item. If the user mentions multiple events, pick the most relevant one or clarify.\n\n## Lifecycle statuses\n\nEach user is categorized into one of four statuses for each time period:\n\n- **New** – the user performed the event for the first time ever during this period.\n- **Returning** – the user was active in the previous period and is active again in the current period.\n- **Resurrecting** – the user was inactive for one or more periods and became active again.\n- **Dormant** – the user was active in the previous period but did not perform the event in the current period. Dormant counts are shown as negative values.\n\n## Time interval\n\nSpecify the time interval using the `interval` field. Available intervals are: `hour`, `day`, `week`, `month`. The default is `day`.\n\nUnless the user has specified otherwise, use the following default interval:\n\n- If the time period is less than two days, use the `hour` interval.\n- If the time period is less than a month, use the `day` interval.\n- If the time period is less than three months, use the `week` interval.\n- Otherwise, use the `month` interval.\n\n## Toggled lifecycles\n\nUse `toggledLifecycles` in `lifecycleFilter` to control which lifecycle statuses are displayed. By default, all four statuses are shown. Only set this when the user wants to focus on specific statuses (e.g., only new and dormant users).\n\n## Math aggregation\n\nLifecycle insights do **not** support math aggregation types. Do not set `math` on the series node.\n\n# Examples\n\n## Daily lifecycle of pageviews over the last 30 days\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"$pageview\" }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"interval\": \"day\"\n}\n```\n\n## Weekly lifecycle of sign ups, excluding test accounts\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"user signed up\" }],\n \"dateRange\": { \"date_from\": \"-90d\" },\n \"interval\": \"week\",\n \"filterTestAccounts\": true\n}\n```\n\n## Monthly lifecycle of \"insight created\" showing only new and dormant users\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"insight created\" }],\n \"dateRange\": { \"date_from\": \"-12m\" },\n \"interval\": \"month\",\n \"lifecycleFilter\": {\n \"toggledLifecycles\": [\"new\", \"dormant\"]\n },\n \"filterTestAccounts\": true\n}\n```\n\n## Lifecycle of purchases by mobile users\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"purchase completed\" }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"interval\": \"day\",\n \"properties\": [{ \"key\": \"$os\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"iOS\", \"Android\"] }]\n}\n```\n\n# Reminders\n\n- Lifecycle insights support only **one** series — do not add multiple events or actions.\n- Do not set `math` on the series node — lifecycle does not support math aggregation.\n- Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details.\n- Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution.",
+ "description": "Run a lifecycle query to categorize users into lifecycle stages based on their activity pattern relative to a single event or action. Lifecycle insights break users into four mutually exclusive groups for each time period: new, returning, resurrecting, and dormant. They're useful for understanding the composition of your active users and diagnosing growth or churn patterns.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters.\n\nExamples of use cases include:\n\n- What is the composition of my active users over time?\n- Are we gaining new users faster than we're losing dormant ones?\n- How many users resurrected (came back after being inactive) last week?\n- Is the returning user base growing or shrinking?\n- How does user engagement change after a product launch?\n\nCRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization.\n\n# Data narrowing\n\n## Property filters\n\nUse property filters to narrow results. Only include property filters when they are essential to directly answer the user's question. Avoid adding them if the question can be addressed without additional segmentation and always use the minimum set of property filters needed.\n\nIMPORTANT: Do not check if a property is set unless the user explicitly asks for it.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the context or objective of the user's query.** Avoid using properties for identification like IDs. Instead, prioritize filtering based on general properties like `paidCustomer` or `icp_score`.\n- **Ensure that you find both the property group and name.** Property groups should be one of the following: event, person, session, group.\n- After selecting a property, **validate that the property value accurately reflects the intended criteria**.\n- **Find the suitable operator for type** (e.g., `contains`, `is set`).\n- If the operator requires a value, use the `read-data-schema` tool to find the property values.\n- You set logical operators to combine multiple properties of a single series: AND or OR.\n\nInfer the property groups from the user's request. If your first guess doesn't yield any results, try to adjust the property group.\n\nSupported operators for the String type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- contains (icontains)\n- doesn't contain (not_icontains)\n- matches regex (regex)\n- doesn't match regex (not_regex)\n- is set\n- is not set\n\nSupported operators for the Numeric type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- greater than (gt)\n- less than (lt)\n- is set\n- is not set\n\nSupported operators for the DateTime type are:\n\n- equals (is_date_exact)\n- doesn't equal (is_not for existence check)\n- before (is_date_before)\n- after (is_date_after)\n- is set\n- is not set\n\nSupported operators for the Boolean type are:\n\n- equals\n- doesn't equal\n- is set\n- is not set\n\nAll operators take a single value except for `equals` and `doesn't equal` which can take one or more values (as an array).\n\n## Time period\n\nYou should not filter events by time using property filters. Instead, use the `dateRange` field. If the question doesn't mention time, use last 30 days as a default time period.\n\n# Lifecycle guidelines\n\nLifecycle insights analyze a **single event or action** over time. The `series` array must contain exactly one item. If the user mentions multiple events, pick the most relevant one or clarify.\n\n## Lifecycle statuses\n\nEach user is categorized into one of four statuses for each time period:\n\n- **New** – the user was seen for the first time (their person profile was created) during this period.\n- **Returning** – the user was active in the previous period and is active again in the current period.\n- **Resurrecting** – the user was inactive for one or more periods and became active again.\n- **Dormant** – the user was active in the previous period but did not perform the event in the current period. Dormant counts are shown as negative values.\n\n## Anonymous users are excluded\n\nLifecycle only counts users with person profiles. Events with `$process_person_profile: false` are excluded entirely; these come from anonymous users on SDKs configured with `person_profiles: 'identified_only'`, the default in posthog-js. In projects with anonymous traffic, lifecycle totals are therefore expected to be far lower than a trends unique-user count of the same event. To confirm a gap is this expected exclusion rather than a data problem, add a filter to the trends query excluding events where `$process_person_profile` is `false`. If the gap persists after that, investigate further.\n\n## Time interval\n\nSpecify the time interval using the `interval` field. Available intervals are: `hour`, `day`, `week`, `month`. The default is `day`.\n\nUnless the user has specified otherwise, use the following default interval:\n\n- If the time period is less than two days, use the `hour` interval.\n- If the time period is less than a month, use the `day` interval.\n- If the time period is less than three months, use the `week` interval.\n- Otherwise, use the `month` interval.\n\n## Toggled lifecycles\n\nUse `toggledLifecycles` in `lifecycleFilter` to control which lifecycle statuses are displayed. By default, all four statuses are shown. Only set this when the user wants to focus on specific statuses (e.g., only new and dormant users).\n\n## Math aggregation\n\nLifecycle insights do **not** support math aggregation types. Do not set `math` on the series node.\n\n# Examples\n\n## Daily lifecycle of pageviews over the last 30 days\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"$pageview\" }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"interval\": \"day\"\n}\n```\n\n## Weekly lifecycle of sign ups, excluding test accounts\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"user signed up\" }],\n \"dateRange\": { \"date_from\": \"-90d\" },\n \"interval\": \"week\",\n \"filterTestAccounts\": true\n}\n```\n\n## Monthly lifecycle of \"insight created\" showing only new and dormant users\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"insight created\" }],\n \"dateRange\": { \"date_from\": \"-12m\" },\n \"interval\": \"month\",\n \"lifecycleFilter\": {\n \"toggledLifecycles\": [\"new\", \"dormant\"]\n },\n \"filterTestAccounts\": true\n}\n```\n\n## Lifecycle of purchases by mobile users\n\n```json\n{\n \"kind\": \"LifecycleQuery\",\n \"series\": [{ \"kind\": \"EventsNode\", \"event\": \"purchase completed\" }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"interval\": \"day\",\n \"properties\": [{ \"key\": \"$os\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"iOS\", \"Android\"] }]\n}\n```\n\n# Reminders\n\n- Lifecycle insights support only **one** series — do not add multiple events or actions.\n- Lifecycle excludes anonymous users (events with `$process_person_profile: false`), so totals are expected to be lower than unique-user trends of the same event.\n- Do not set `math` on the series node — lifecycle does not support math aggregation.\n- Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details.\n- Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution.",
"category": "Query wrappers",
"feature": "insights",
"summary": "Run a lifecycle query",
@@ -7000,7 +7000,7 @@
"system_prompt_hint": "New, returning, resurrecting, dormant user composition"
},
"query-lifecycle-actors": {
- "description": "List the persons in a specific bucket of a lifecycle insight. Use this to answer \"who are the new / returning / resurrecting / dormant users on day Y?\".\n\n`source` is the lifecycle query that defines the population (event, date range, filters). Build it directly when the user's request already names a bucket-day, or reuse one you previously ran via `query-lifecycle` when drilling in from a chart.\n\nSelectors:\n\n- `day` **(required)**: the bucket date as an ISO date string (YYYY-MM-DD), e.g. `\"2024-01-15\"`. Must align with the source's interval (a day boundary for `interval=day`, the start of the week for `interval=week`, etc.).\n- `status` **(required)**: which lifecycle bucket to drill into. One of `new`, `returning`, `resurrecting`, `dormant`.\n - `new` — users performing the event for the first time during the period.\n - `returning` — users active in the previous period and active in this one.\n - `resurrecting` — users inactive for one or more periods and active again now.\n - `dormant` — users active in the previous period but inactive now.\n\nResponse:\n\nEach returned row contains `distinct_id`, `email`, and `name`. Results are limited to the top 100 actors. Matched session recordings are not returned — the lifecycle runner does not project per-actor matching events.\n\nGuidance:\n\n- Lifecycle insights only support a single series and do not expose `compareFilter`, so there is no `series` or `compare` selector here.\n- Keep the `source` lifecycle query minimal — only include the filters needed to define the same lifecycle population the user is asking about.\n- For large buckets, tighten the source query (filters, date range) rather than expecting more rows.",
+ "description": "List the persons in a specific bucket of a lifecycle insight. Use this to answer \"who are the new / returning / resurrecting / dormant users on day Y?\".\n\n`source` is the lifecycle query that defines the population (event, date range, filters). Build it directly when the user's request already names a bucket-day, or reuse one you previously ran via `query-lifecycle` when drilling in from a chart.\n\nSelectors:\n\n- `day` **(required)**: the bucket date as an ISO date string (YYYY-MM-DD), e.g. `\"2024-01-15\"`. Must align with the source's interval (a day boundary for `interval=day`, the start of the week for `interval=week`, etc.).\n- `status` **(required)**: which lifecycle bucket to drill into. One of `new`, `returning`, `resurrecting`, `dormant`.\n - `new` — users seen for the first time (person profile created) during the period.\n - `returning` — users active in the previous period and active in this one.\n - `resurrecting` — users inactive for one or more periods and active again now.\n - `dormant` — users active in the previous period but inactive now.\n\nResponse:\n\nEach returned row contains `distinct_id`, `email`, and `name`. Results are limited to the top 100 actors. Matched session recordings are not returned — the lifecycle runner does not project per-actor matching events.\n\nGuidance:\n\n- Lifecycle excludes anonymous users (events with `$process_person_profile: false`), so actor lists only contain identified users — anonymous visitors never appear in any bucket.\n- Lifecycle insights only support a single series and do not expose `compareFilter`, so there is no `series` or `compare` selector here.\n- Keep the `source` lifecycle query minimal — only include the filters needed to define the same lifecycle population the user is asking about.\n- For large buckets, tighten the source query (filters, date range) rather than expecting more rows.",
"category": "Query wrappers",
"feature": "insights",
"summary": "List persons in a lifecycle bucket",