How to Connect PostHog to an AI Agent: Step-by-Step Guide
· DoubleX
Quick answer
To connect PostHog to an AI agent, add the PostHog connector on the Connectors screen of DoubleX Agentes, sign in to your PostHog account, choose which agents can use it, limit the actions each one may run, then test with a simple question about events and check the task history.
Product data usually lives in PostHog, but the people who need answers from it are often not the ones who know where to click. Connecting PostHog to an AI agent lets anyone on the team ask about events, insights, feature flags, and experiments in plain language. This guide covers only the setup. For example analyses and scheduled routines, see the PostHog example prompts and routines guide.
What can the PostHog connector let an agent do?#
The PostHog connector lets an agent query your events, insights, feature flags, and experiments. A connector is a system linked to the platform whose tools your agents can use. Once PostHog is connected, an agent can look up the data instead of you exporting it by hand.
| What the agent can consult | Typical use |
|---|---|
| Events | Check whether an event is being tracked and how it looks |
| Insights | Read the charts and metrics your team already built |
| Feature flags | See which flags exist and how they are set |
| Experiments | Review the experiments you have running or finished |
What do you need before connecting?#
You need an account on DoubleX Agentes and access to the PostHog project you want to use. Creating the account is free and does not require a card. During sign-up you tell the platform your company's industry, what you want to improve, and where your information lives.
Before you start, confirm three things:
- You can sign in to PostHog and open the project whose data the agent should read.
- You know which team or area will use the agent (for example product, growth, or support).
- You have decided whether the connection should be personal, for a team, or for the whole company.
How do you add the PostHog connector on the Connectors screen?#
Open the Connectors screen, find PostHog, and follow the connection prompts. In DoubleX Agentes the steps look like this:
- Sign in to your DoubleX Agentes account.
- Open the Connectors screen.
- Search for PostHog in the list (it is in the data category).
- Start the connection and authorize access with your PostHog account when asked.
- Choose the scope of the connection: personal, team, or company.
- Confirm that PostHog now appears as connected.
Credentials and tokens for connections are stored encrypted with AES-256-GCM, and each company has its own separate database. If you manage connectors through code instead, see the Connectors API documentation.
How do you choose which agents use PostHog and which actions they can run?#
In each agent's settings, you pick which connected systems it can use and, for each system, which actions it may run. This is how you keep a product-analytics agent focused and safe. Actions that change data can stay switched off, so the agent only reads.
A sensible setup:
- Open the Agents screen and select the agent that should use PostHog (or create a new one).
- Add the PostHog connector to that agent.
- Review the list of PostHog actions and leave on only what the job needs.
- Keep anything that changes data, such as editing feature flags, off until you trust the workflow.
- Add instructions that tell the agent which project and which events matter to your team.
Before an agent sends, deletes, or changes anything in your systems, it asks for confirmation and shows the steps it took. Owners, admins, and members have different roles, and you can share agents with a person, a team, or the company.
How do you test the connection with a first question about events?#
Ask the agent a small, concrete question that you can verify in PostHog. A good first test is read-only and has an answer you already know.
Examples you can copy:
- "List the events being tracked in our PostHog project."
- "Which feature flags do we have, and which ones are currently enabled?"
- "Show me the insights saved in PostHog related to sign-ups."
- "What experiments do we have in PostHog, and what is the status of each?"
If the answer matches what you see in PostHog, the connection works. If the agent says it cannot reach the data, go back to the Connectors screen and check that PostHog shows as connected and that the agent has the connector enabled.
How do you check the task history to see what the agent looked up?#
Open the Tasks screen and select the conversation. Every request to an agent becomes a task with a full history: the request, each tool the agent used, and the result. You can see who asked, what was done, and when.
Use the history to confirm that the agent queried PostHog and not something else, to spot a wrong event name or project in the instructions, and to review what was consulted before you widen the agent's permissions. For a broader view of how the platform works, read the Introduction.
Frequently asked questions#
Do I need to write code to connect PostHog?#
No. You add the connector on the Connectors screen and describe what you need in your own words. For developers, DoubleX Agentes also offers a REST API, a CLI, and an MCP server.
Can I make the agent read-only?#
Yes. For each agent and each connected system, you choose which actions are allowed. Actions that change data can stay off so the agent only reads.
Is my PostHog data used to train AI models?#
No. Your company's content is not used to train models, and requests go only to AI providers that do not use what they receive for training. You can also choose zero retention in the Models screen.
Can several agents use the same PostHog connection?#
Yes, as long as the connection scope allows it. A team or company connection can serve several agents, each with its own permissions.
Does it cost anything to try?#
Creating the account and running the first diagnostic are free, with no card. Using AI consumes credits, and when your plan's credits run out, usage stops with no surprise bill.
Related guides
- How to Connect Box to an AI Agent: Step-by-Step GuideLearn how to connect Box to an AI agent: set up the connector, limit it to read-only, choose who can use it, and check the history of your first request.
- How to Connect Jam to an AI Agent: Step-by-Step GuideLearn how to connect Jam bug reports to an AI agent in DoubleX Agentes: set up the connector, pick who can use it, limit permissions, and run a first test.