PostHog is a query-based integration. Modem does not sync or store PostHog data. Instead, the agent queries your PostHog instance on demand when you ask a question.
Prerequisites
- Admin or Owner role in your Modem organization
- A PostHog account with a Personal API key
Setup
Generate a PostHog API key
In PostHog, go to Settings → Personal API Keys and create a new key. The key should start with
phx_.Connect in Modem
Go to Settings → Integrations → PostHog in your Modem dashboard.
- Select your Region (US Cloud or EU Cloud) to match your PostHog instance
- Paste your Personal API key
- Click Connect
Start asking questions
The agent can now query your PostHog data. Try it from the dashboard or Slack.
What the Agent Can Access
| Category | Examples |
|---|---|
| Product analytics | Event counts, funnels, retention, trends via HogQL queries |
| Feature flags | Flag states, rollout percentages, targeting filters |
| Experiments | A/B test results with statistical significance |
| Error tracking | Error rates, types, and affected users |
What the Agent Can Do
With PostHog connected, you can ask the agent to:- Query product usage metrics (signups, active users, conversion rates)
- Check feature flag rollout states and targeting rules
- Analyze A/B experiment results
- Search error tracking data for patterns
- Generate HogQL queries from natural language questions
- Cross-reference PostHog analytics with feedback from your other data sources
Example Prompts
These work from the dashboard, Slack DMs, or by mentioning@modem in a channel.
Simple:
Advanced:
Troubleshooting
Connection test fails
Connection test fails
- Verify your API key starts with
phx_and hasn’t been revoked in PostHog - Confirm you selected the correct region (US or EU) matching your PostHog instance
- The connection timeout is 15 seconds. If your PostHog instance is behind a slow network, the test may time out.
Agent says PostHog tools aren't available
Agent says PostHog tools aren't available
- Check that PostHog is connected in Settings → Integrations → PostHog
- Try running Test Connection to verify the connection is still valid
- If your API key was rotated in PostHog, disconnect and reconnect with the new key
Queries return empty results
Queries return empty results
- Start with a broad query and a recent time range to confirm data exists
- Check that the events or properties you’re asking about match what’s in your PostHog project
- PostHog Personal API keys can be scoped to a single project. If yours is, the agent can only access data within that project.
Queries are slow
Queries are slow
PostHog queries over large date ranges or without filters can take time. Ask the agent to narrow the time range or add filters. Starting with the last 7 days is a good default.
Disconnecting
To disconnect PostHog:- Go to Settings → Integrations → PostHog
- Click Disconnect and confirm
Related
The Modem Agent
See what else the agent can do with your connected tools.
Integrations Overview
All available integrations and how they fit together.