A Gleap custom agent can query PostHog through Composio: persons, events, session recordings, feature flags and insights. It helps engineering and support teams connect a customer’s report to what PostHog recorded.
What a Gleap agent can do in PostHog
- Find the recordings: List project session recordings returns a project’s recordings, so the agent can point the engineer to sessions from the person who reported the bug.
- Check a rollout: Retrieve feature flag details shows a flag’s release conditions, which explains why one customer sees a feature and another does not.
- Count affected users: Create query in project by id runs a query, for example how many people hit the same error event this week.
- Annotate a release: The annotation actions add a note to your charts once your team confirms a fix is live.
Example: A feature that one account cannot see
A customer reports in Gleap that the new billing page still shows the old layout. The engineer asks the agent to check. The agent reads the rollout conditions of the billing flag in PostHog, finds the customer’s company outside the rollout and lists recordings from the customer’s recent sessions. The engineer decides whether to change the flag.
How to connect PostHog
- In Gleap, open AI & Automation > Agents and select a custom agent, or create one.
- In its Tools section, click Add tool and search for “PostHog”.
- Pick PostHog under More integrations and click Connect PostHog.
- Paste a PostHog personal API key into the form Gleap shows and connect.
- Open the new PostHog tool and switch off every action the agent does not need, such as Bulk delete feature flags or Delete session recording by uuid.
- Tell the agent in its instructions when to use PostHog, then test it in chat.
Custom agents are included in the Team, Pro and Enterprise plans. Kai Support can use connected apps as tools on Team, Pro and Enterprise. Kai Code, also on those plans, can use PostHog in coding sessions once you add it under Settings > MCP in Kai Code.
FAQ
Does Gleap integrate with PostHog?
Yes, through Composio. The PostHog toolkit covers persons, cohorts, events, insights, session recordings, feature flags, annotations and more. A Gleap custom agent reads or changes PostHog only when it runs and uses an action you allowed.
Does Gleap connect to PostHog through MCP?
Yes. Gleap connects to Composio’s MCP server for PostHog with the PostHog account you connect, and the agent calls only the actions you leave switched on. To use a different remote MCP server, add it by URL: as a Custom MCP tool for Kai Support or a custom agent, or as a custom HTTP server in Kai Code.
What can a Gleap AI agent do in PostHog?
It connects a customer report to PostHog data: the person’s recordings and events, the feature flags that apply to them and the number of users affected. Kai Code can use the same data in a coding session.
Which Gleap plan includes the PostHog integration?
Kai Support and Kai Code can use the PostHog toolkit on Team, Pro and Enterprise; custom agents that use it are on Team, Pro and Enterprise. Kai Support answers customers, so switch on only actions that are safe in a customer conversation. Create a personal API key with only the scopes the agent needs. AI usage is billed separately; see pricing.
Can the agent change feature flags?
The toolkit includes actions that create, update and delete feature flags. Leave them off unless an agent should change a rollout, and keep flag changes with an engineer.