PostHog with an AI Agent: Example Prompts and Routines
· DoubleX
Quick answer
An AI agent connected to PostHog can look up events, insights, feature flags, and experiments in plain language, summarize what changed, and run on a schedule. In DoubleX IA OS, you ask a question, the agent queries PostHog, and it can post the answer to Slack or log it in a sheet.
Product and data teams spend a lot of time answering the same questions: did signups drop, how is the experiment doing, which flag is still on? An AI agent can answer these from PostHog without anyone opening a dashboard. This guide focuses on what to ask and what to schedule. For the connection itself, see How to Connect PostHog to an AI Agent.
What can an AI agent query in PostHog?#
Through the PostHog connector, an agent can query events, insights, feature flags, and experiments. An agent is an AI assistant with instructions, connectors, and permissions that does work in your systems. The connector is about reading and analyzing, so the agent is best at questions and summaries.
| Area in PostHog | What the agent can do | Typical question |
|---|---|---|
| Events | Look up event activity and volumes | "How many checkout_started events did we get this week?" |
| Insights | Read existing charts, funnels, and trends | "What does the onboarding funnel insight show now?" |
| Feature flags | List flags and their status | "Which flags are still enabled for everyone?" |
| Experiments | Read experiment setup and results | "How is the pricing page experiment going?" |
Which prompts help you understand user behavior and events?#
The best prompts name the event or insight, the time window, and the comparison you want. Vague questions like "how are we doing?" produce vague answers, so be specific about what to compare.
Prompts you can copy:
- "Compare the number of signup_completed events this week with last week and tell me what changed."
- "Open our onboarding funnel insight and tell me which step has the biggest drop-off."
- "List the 10 most frequent events from the last 7 days and flag any that look new."
- "Summarize retention from the retention insight in three bullet points for a non-technical reader."
How do you track experiments and feature flags with an agent?#
Ask the agent to read the experiment or flag and report status in the format your team uses in reviews. This turns a manual check into a one-line request, and a scheduled one if you want it regularly.
Prompts you can copy:
- "List all running experiments, their goal metric, and the current result in a table."
- "Which feature flags have been fully rolled out for a long time and may be ready for cleanup?"
- "Explain the pricing page experiment results in plain language and say whether the data looks conclusive or too early to call."
Treat the agent's read as a first pass. The decision to ship or stop an experiment stays with your team.
Which scheduled routines are worth setting up?#
A weekly product metrics summary is the most useful routine, followed by a daily check on key events and a monthly flag review. A routine is a trigger that makes the agent work on its own, for example every Monday at 8 a.m. It runs with the permissions of the person who created it.
| Routine | Schedule | What the agent does |
|---|---|---|
| Weekly product summary | Mondays, 8 a.m. | Compares key events and insights with the previous week |
| Daily signal check | Every weekday morning | Looks at critical events and flags unusual changes |
| Experiment status | Every Friday | Lists running experiments and current results |
| Flag cleanup review | Monthly | Lists flags that may be ready to remove |
To set one up in DoubleX IA OS:
- Create or open the agent that will own the routine, and attach the PostHog connector.
- Set its permissions so it only uses the PostHog actions it needs.
- Write the request exactly as you want the output, for example the weekly summary prompt below.
- Add a schedule trigger with the day and time. See Triggers for how triggers work.
- Run it once manually, check the answer against PostHog, and adjust the wording.
Example routine prompt: "Every Monday, summarize last week's signups, activation funnel, and active experiments versus the week before. Start with the three most important changes."
How do you combine PostHog with Slack, Linear, and Google Sheets?#
PostHog gives the agent the data, and the other connectors decide where the result goes. Each extra connector is a separate permission you can switch on or off for that agent.
- Slack: post the weekly summary to a product channel, or send an alert when a key event moves a lot.
- Linear: turn a finding into an issue, for example a funnel step that dropped, with the numbers in the description.
- Google Sheets: append a row each week with the main metrics so you build a history outside PostHog.
Prompts you can copy:
- "Summarize this week's product metrics from PostHog and show me the Slack message before posting it to the product channel."
- "If the checkout funnel dropped versus last week, draft a Linear issue with the numbers and ask me to confirm before creating it."
- "Add one row to the Weekly metrics sheet with signups, activation, and the number of running experiments."
What should you watch for with permissions and review?#
Give the agent only the connectors and actions it needs, and review results before acting on them. In DoubleX IA OS you choose which systems each agent uses and which actions it can run in each one. Before it sends a message or changes something, it asks for confirmation, and every task keeps a history of what it did.
A few habits help: keep Slack and Linear actions on confirmation at first, use a dedicated agent for analytics rather than a general one, and share the routine with the team so the output has a clear owner. For ways to feed context to the agent, see Brain and Skills.
Frequently asked questions#
Can the agent change my PostHog setup?#
The PostHog connector is described for querying events, insights, feature flags, and experiments. You also control which actions each agent may run, so you can keep it to reading and summarizing.
Do I need to know HogQL or write queries?#
No. You describe the question in plain language and the agent does the lookup. If you want a result to follow a specific format, describe the format in your request.
Can the agent run without me asking?#
Yes. You can schedule a routine, such as every Monday morning, and it runs with the permissions of the person who created it.
Will my analytics data be used to train AI models?#
No. Company content is not used to train models, and requests go only to AI providers that do not use what they receive for training.
Can I send the results to a team channel?#
Yes, if the Slack connector is on for that agent. You can ask it to show the message first and wait for your confirmation before posting.
Related guides
- How to Connect PostHog to an AI Agent: Step-by-Step GuideLearn how to connect PostHog to an AI agent: add the connector, pick which agents use it, limit actions, and test it with a first question about your events.
- How to Connect Gmail to an AI Agent, Step by StepLearn how to connect Gmail to an AI agent: add the connector, choose personal, team or company access, and set what the agent can read, draft or send.
- How to Automate Gmail Email Replies with AI DraftsLearn how to automate Gmail replies with AI: an agent reads incoming email, checks your company info, and writes drafts you review before anything is sent.