AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

querying-posthog-data

Explains how to query PostHog data, defaulting to typed runners for supported product analytics. Read it before you write HogQL/SQL. Also read it before you call execute-sql against PostHog. Use it to find or aggregate PostHog entities. These entities include insights, dashboards, cohorts, feature flags, experiments, surveys, hog flows, warehouse data, and persons. Use it for trends, funnels, retention, lifecycle, paths, stickiness, web analytics, error tracking, logs, sessions, and LLM traces. Before you calculate a governed business or telemetry measure, check system.information_schema.metrics for an approved definition. Examples include MRR, activation, billable usage, active organizations, and failure rates. Use the approved definition before you derive a measure from raw events or use a typed domain tool. It also covers HogQL differences, system table schemas, functions, query examples, and schema discovery.

Original source
posthog
License
MIT
Pinned revision
cac7c80a9e5b73484d18eda1bffb47297c938e0c

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read posthog--querying-posthog-data at revision cac7c80a9e5b73484d18eda1bffb47297c938e0c, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 65

references/models-alerts.md

Alerts

AlertConfiguration (system.alerts)

Alerts monitor insight values and notify subscribed users when thresholds are breached.

Columns

Column | Type | Nullable | Description --- | --- | --- | --- id | String | NOT NULL | Alert UUID. team_id | Integer | NOT NULL | name | String | NOT NULL | User-given name of the alert. insight_id | Integer | NOT NULL | Insight the alert watches; joins to insights.id. enabled | Boolean | NOT NULL | Whether the alert is active. state | String | NOT NULL | Current alert state: 'Firing', 'Not firing', 'Errored', or 'Snoozed'. calculation_interval | String | NOT NULL | How often the alert is evaluated, e.g. 'daily'. condition | JSON | NOT NULL | JSON definition of the threshold/condition to check. config | JSON | NOT NULL | JSON alert configuration (series, comparison settings, etc.). created_at | DateTime | NOT NULL | When the alert was created. last_notified_at | DateTime | NOT NULL | When a notification was last sent. last_checked_at | DateTime | NOT NULL | When the alert was last evaluated. next_check_at | DateTime | NOT NULL | When the alert is next scheduled to be evaluated. snoozed_until | DateTime | NOT NULL | Alert is snoozed (no notifications) until this time. skip_weekend | Boolean | NOT NULL | Whether evaluation is skipped on weekends. schedule_restriction | JSON | NOT NULL | JSON restricting which days/hours the alert may fire.

Key Relationships

  • Each alert monitors exactly one Insight (insight_id → system.insights.id)
  • Alerts belong to a Team (team_id)
  • Subscribers are managed via AlertSubscription (not exposed as a system table)

Important Notes

  • The condition.type determines evaluation mode:
    • absolute_value — fires when the value crosses the threshold bounds
    • relative_increase — fires when the value increases beyond the threshold
    • relative_decrease — fires when the value decreases beyond the threshold
  • The config.series_index selects which series in a multi-series insight to monitor
  • real_time requires a Scale or Enterprise plan
  • every_15_minutes requires a Boost, Scale, or Enterprise add-on
  • Creating or updating alerts through MCP requires the alert:write scope. Reconnect the MCP connection if these tools are unavailable
  • Alerts have a per-team limit (2 on the free tier, higher on paid plans)