Back to PostHog
PostHog logo
PostHog · PostHog Verified

AI agent workflow: Create a PostHog product analytics investigation agent

Build a product analytics assistant that helps teams understand behavior changes and prioritize follow-up.

Workflow outcome

Convert PostHog analytics context into an investigation brief with evidence, hypotheses, and recommended next actions.

How an AI agent can convert PostHog analytics context into an investigation brief with evidence, hypotheses, and recommended next actions

This workflow gives an AI agent a defined job, a bounded set of records, and a result a person can review. The agent reads the relevant PostHog context, applies the rules in the prompt, and keeps the source behind every recommendation. It returns a proposed handoff rather than taking consequential actions on its own.

Can an AI agent convert PostHog analytics context into an investigation brief with evidence, hypotheses, and recommended next actions?

Yes. Start with the scope, date range, decision rules, and fields that identify the right records. The agent can collect the evidence, compare states or sources, mark conflicts and missing data, and organize the result around the outcome above. A reviewer then checks the matches and judgment calls before approving messages, record updates, bookings, purchases, publishing, or other write actions. The guide below shows the records, boundaries, prompt, and handoff needed for this specific workflow.

What this agent helps you do

A PostHog product analytics investigation agent helps teams answer product questions with evidence. It can review metrics, events, feature usage, replays, experiments, or flags depending on available context.

When to use this workflow

Use it when a metric changes, a launch needs validation, an experiment needs review, or a customer issue may reflect broader product behavior.

How PostHog gives the agent context

Connect the plugin and define the project, metric, cohort, feature, event, or timeframe. Ask the agent to distinguish measured data from hypotheses and to note instrumentation gaps.

Example starter prompt

Investigate why this activation metric changed in PostHog. Summarize the evidence, affected cohorts, related events or replays, likely hypotheses, and recommended next actions for product and engineering.

Suggested workflow steps

Define the question, gather relevant analytics context, segment the data, compare with recent launches or flags, and rank hypotheses by evidence strength.

Questions this workflow answers

Why did activation change this week, and is the movement real or a tracking problem?

An agent can investigate the metric without starting from a favored explanation. It records the exact event or formula, filters, aggregation, unit, timezone, project, date range, and comparison window. It then checks volume and uniqueness around the change point, looking for renamed events, missing properties, identity shifts, duplicate capture, bot traffic, deployment timing, or changed eligibility. A chart moving after a release is a clue, not proof that the feature caused it.

Segmentation helps locate the break. The agent can compare platform, app version, geography, acquisition source, account type, or another approved property, while showing sample sizes and denominators. It should avoid slicing until a small cohort produces a dramatic but unstable story. For funnels, it checks each step and conversion window. For retention, it confirms the cohort entry event and return behavior before interpreting the curve.

Session replays, surveys, and errors can add context when their privacy settings and sample boundaries are appropriate. The agent uses them to illustrate a measured pattern, not to substitute three memorable sessions for population evidence. It records which evidence supports each hypothesis and what contradicts it.

The investigation ends with ranked explanations and tests. One next step may be repairing an event and recomputing the metric; another may be comparing a feature-flag cohort; a third may require a customer interview. The handoff includes reproducible query links, definitions, affected cohorts, release context, missing data, and owners. Product and engineering decide whether to change instrumentation, roll back a feature, or create follow-up work after reviewing the evidence.

Expected handoff

The output should include findings, charts or query references when available, hypotheses, missing instrumentation, and recommended follow-up. It can become a Linear issue or product decision brief.

An activation investigation should begin by reproducing the metric definition: qualifying event, actor, conversion window, exclusions, timezone, and release or cohort boundary. The agent can compare raw event volume, unique users, property coverage, and ingestion timing before interpreting behavior. If the change exists only on one client version or an event property became empty, tracking is a stronger lead than user intent. When the movement survives those checks, segment it by acquisition source, platform, geography, plan, or first-use path and retain denominators. The result explains which observation is real, which hypothesis it supports, and what additional event or experiment could distinguish the remaining causes.

Get Started

Build as fast as you can think.

LatchLoop works where you do to build with you.