Integration · Analytics and data
AI agents for PostHog
Query product analytics with HogQL, list recent events and persons, check which feature flags a user gets, and add annotations, in a PostHog Cloud project (US or EU) with a personal API key.
- Actions
- 5
- Read
- 4
- Write
- 1
Actions
What your agents can do in PostHog
5 actions. Each one is a tool your agents can call and a step your workflows can run.
Read 4
Look things up. Nothing changes.
Run a HogQL query
Runs a read-only HogQL (PostHog's SQL) query over the project's data, like select event, count() from events where timestamp > now() - interval 7 day group by event order by count() desc limit 20.
List recent events
Lists the project's most recent events, newest first, optionally one event name only: uuid, event, timestamp and distinct_id (and all properties when include_properties is true).
Find persons
Lists persons (identified users), optionally matching a search over email, name, person ID or distinct ID, an exact email, or one distinct ID.
Check feature flags for a user
Evaluates the project's feature flags for one distinct ID, as PostHog would for that user, and says why.
Write 1
Create, change or send.
Create an annotation
Adds an annotation, a short note pinned to a moment on the project's charts, like "Released v2.3" or "Pricing page changed".
A person can approve first
Any write action can be set to wait for a person's approval before it runs, so an agent asks before it changes anything.
Connection
How it connects
Connect it once in the console, then give it to the agents and workflows that need it.
Paste an API key from your PostHog account.
What you enter
- Personal API key
Settings
- Cloud region
- Project ID
Kept safe
- Credentials are stored encrypted with your organization's own keys.
- They are opened only by the process that makes the call, at the moment it runs, and never go into a prompt or the browser.
- Calls go only to the tool's own servers.
Ideas
Ideas to start with
Starting points made only from the actions above. Mix them with any other tool your agents can use.
- 01
Ask about your PostHog data
Ask a question in plain words. The agent can run a HogQL query, list recent events or find persons in PostHog, then answers with what it found.
- 02
Let an agent update PostHog
Have the agent create an annotation in PostHog as part of a larger task. Turn on approval and a person signs off on each change first.
- 03
Share what it finds in Slack
Give one agent PostHog and Slack: it can run a HogQL query in PostHog and post a summary to a Slack channel in the same run.
FAQ
PostHog and MyDeepAgents
Can MyDeepAgents connect to PostHog?
Yes. The PostHog connector has 5 actions: 4 read and 1 makes changes. Your agents can call them as tools, and your workflows can run them as steps.
How do I connect PostHog?
Paste an API key from your PostHog account. You'll need: Personal API key. The connection also asks for: Cloud region and Project ID. Credentials are stored encrypted with your organization's own keys and are opened only at the moment of a call.
Can an agent change data in PostHog without asking?
Only if you let it. Its one action that changes data can be set to wait for a person's approval before it runs.
Can I use PostHog in workflows as well as agents?
Yes. Every PostHog action also works as a step in a workflow, and the same connection serves your agents and your workflows.
Early access
Put PostHog to work
Connect it in a few minutes, give an agent the actions it needs, and decide which changes wait for a person.