Agent Skills: Querying data in PostHog

HogQL query examples and reference material for PostHog data. Read when writing SQL queries to find patterns for analytics (trends, funnels, retention, lifecycle, paths, stickiness, web analytics, error tracking, logs, sessions, LLM traces) and system data (insights, dashboards, cohorts, feature flags, experiments, surveys, hog flows, data warehouse). Includes HogQL syntax differences, system model schemas, and available functions.

UncategorizedID: posthog/posthog/query-examples

Repository

PostHogLicense: NOASSERTION
32,3202,451

Install this agent skill to your local

pnpm dlx add-skill https://github.com/PostHog/posthog/tree/HEAD/products/posthog_ai/skills/query-examples

Skill Files

Browse the full folder contents for query-examples.

Download Skill

Loading file tree…

products/posthog_ai/skills/query-examples/SKILL.md

Skill Metadata

Name
query-examples
Description
'HogQL query examples and reference material for PostHog data. Read when writing SQL queries to find patterns for analytics (trends, funnels, retention, lifecycle, paths, stickiness, web analytics, error tracking, logs, sessions, LLM traces) and system data (insights, dashboards, cohorts, feature flags, experiments, surveys, hog flows, data warehouse). Includes HogQL syntax differences, system model schemas, and available functions.'

Querying data in PostHog

If the MCP server haven't provided instructions on querying data in PostHog, read the guidelines.

Data Schema

Schema reference for PostHog's core system models, organized by domain:

HogQL References

Analytics Query Examples

Use the examples below to create optimized analytical queries.