PostHog for data analysis
For data analysis, PostHog's official server is the top pick of four, and the reason is the kind of question it answers: behavioral ones, against the platform that already holds your product events. An agent can pull a funnel, check a retention cohort, or read an event trend and reason over the result, without anyone opening the dashboard.
It leads here because so much real data analysis is product analysis, and PostHog is purpose-built for that. The server exposes insights and dashboards as objects it can read and create, so an analysis is a sequence of tool calls rather than a manual session.
How PostHog fits
The tools that do the analytical work are insight-query, which runs an existing insight and returns its data, and insight-create-from-query, which saves a query as a new insight the agent can then run. insight-get, insights-get-all, insight-update, and insight-delete manage the set, while dashboards-get-all, dashboard-get, dashboard-create, dashboard-update, dashboard-delete, and add-insight-to-dashboard let the agent organize findings into a board.
The honest framing: PostHog answers behavioral questions well but is not a general SQL surface for arbitrary tables. ClickHouse fits when you want fast aggregation over billions of rows via raw analytical SQL. DBHub (Postgres) is the pick when the numbers live in an operational Postgres database you query directly with SQL and schema introspection. Neon suits analysis on a serverless Postgres branch you can spin up and discard. Lead with PostHog when the analysis is about user behavior and events; switch to a SQL-first server when the data lives in a relational store or a warehouse instead.
Tools you would use
| Tool | What it does |
|---|---|
| dashboards-get-all | Get all dashboards in the project with optional filtering. |
| dashboard-get | Get a specific dashboard by ID, including the insights on it. |
| dashboard-create | Create a new dashboard in the project. |
| dashboard-update | Update an existing dashboard by ID. |
| dashboard-delete | Delete a dashboard by ID. |
| add-insight-to-dashboard | Add an existing insight to a dashboard. |
| insights-get-all | Get all insights in the project with optional filtering. |
| insight-get | Get a specific insight by ID. |
| insight-create-from-query | Save a query as an insight. |
| insight-update | Update an existing insight by ID. |
FAQ
- What kind of analysis is PostHog's server best at?
- Behavioral, event-based analysis: funnels, retention, and trends. insight-query runs the analysis and insight-create-from-query saves new ones. For arbitrary SQL over relational tables, DBHub (Postgres) or a warehouse like ClickHouse fits better.
- Can the PostHog server run raw SQL over my tables?
- Its tools work through insights and dashboards rather than arbitrary table queries. If your analysis needs direct SQL against operational data, pair or replace it with DBHub (Postgres); for large-scale columnar aggregation, ClickHouse is the stronger pick.