PostHog Handbook Library / Engineering

1,567 words. Estimated reading time: 7 min.

AI platform

Auto TL;DR

At a Glance

This long page covers these main areas. The list is generated from the article headings, so it updates with every handbook rebuild.

  1. What is the AI platform?
  2. Why we built it
  3. Vision: Product autonomy
  4. Architecture at a glance
  5. 1. User facing products
  6. 2. Core infrastructure
  7. 3. Integration points
  8. Products overview

What is the AI platform?

The PostHog AI platform is our infrastructure for building and delivering AI-powered features across all PostHog products. Instead of each team building isolated AI capabilities, we provide shared architecture, reusable components, and a consistent framework that lets everyone contribute toward our AI capabilities while maintaining quality and consistency.

Think of it like HogQL: rather than having every team write their own query engines, we built one shared system that everyone can use and extend. The AI platform follows the same philosophy — avoid reinventing AI infrastructure and prevent "death by random AI widgets."

Why we built it

Almost every team at PostHog either is building or needs to build AI features. Without a platform approach, we'd face:

The AI platform solves these problems by providing:

  1. Shared architecture: A single-loop agent system that any product can extend with domain-specific tools and expertise
  2. Reusable components: Common tools (search, data access, taxonomy reading) that work across all AI features
  3. Consistent UX: Standard patterns for AI interactions, loading states, error handling, and result presentation
  4. Platform-level improvements: When we improve the core agent (better reasoning, faster responses, cheaper inference), all products benefit automatically

Vision: Product autonomy

The overarching goal of PostHog's AI direction is product autonomy — a closed loop where PostHog data automatically drives product improvements with minimal human intervention.

Here's how the loop works:

  1. Signals: PostHog collects signals from all products and external sources — error patterns, frustration in session recordings, experiment results, survey responses, insight thresholds, support tickets, Slack threads, and more. These signals represent real problems or opportunities.
  1. Enrichment: PostHog processes and enriches these signals, deduplicating across data sources and adding context. A vague signal like "users seem frustrated during checkout" becomes a concrete, contextualized finding.
  1. Plans: The enriched signals are transformed into structured plans — similar to how Claude Code works, but driven by data rather than human prompts. Each plan describes what needs to happen, why, and what evidence supports it.
  1. Execution: A sandboxed coding agent takes these plans and acts on them. Today, we're focused on automatically creating pull requests. The agent also handles instrumentation automatically — adding tracking events, feature flags, and experiments as part of the code it ships. Better instrumentation produces better signals, making the entire loop smarter over time. In the future, other artifact types will be supported — decks, growth reviews, and more.
  1. Review: Product engineers review, iterate on, and merge (or decline) the proposed changes.
  1. Feedback: Once a change ships, a new signal is created so the system can evaluate what happened after the PR was merged. Did the metric improve? Did new errors appear? This feeds back into step 1.
  1. Loop: The cycle continues until the agent finds an exit condition — low actionability, non-important signals, noisy signals, de-prioritized work, etc.
graph LR
    Signals[Signals<br/>Internal: errors, recordings, experiments<br/>External: support tickets, Slack] --> Enrichment[Enrichment<br/>ML & agentic pipelines<br/>deduplicate, contextualize, prioritize]
    Enrichment --> Plans[Plans<br/>Structured, data-driven<br/>action items]
    Plans --> Execution[Execution<br/>Coding agent creates<br/>PRs and artifacts]
    Execution --> Review[Review<br/>Human oversight,<br/>iterate or merge]
    Review --> Feedback[Feedback<br/>New signal created<br/>from shipped changes]
    Feedback --> Signals

This vision connects all the individual AI products. PostHog products and external sources (support tickets, Slack) generate signals, ML and agentic pipelines enrich them into structured plans, background and local coding agents execute on those plans, and product engineers review and collaborate on the changes. The loop closes when shipped changes generate new signals that feed back into the cycle.

For how product teams can contribute to this vision, see Integration vectors for product teams.

Architecture at a glance

The AI platform has three main layers:

1. User-facing products

These are the AI features users interact with directly:

2. Core infrastructure

The shared components that power all products:

3. Integration points

How everything connects together:

For a detailed technical overview, see AI platform architecture.

Products overview

PostHog AI [General availability]

Your primary interface for working with PostHog. Instead of clicking through forms and menus, describe what you want in natural language. PostHog AI can create dashboards, write SQL queries, set up surveys, and answer questions about your data — all through conversation.

Best for: Quick answers, creating resources, learning PostHog, iterative exploration Status: Beta | Pricing: Paid with free tier

Learn more →

Deep research [Beta]

When you need to investigate complex, open-ended problems, Deep research digs deep. It systematically explores your data — session recordings, analytics, error logs — and produces comprehensive research reports that would take a human analyst hours to create.

Best for: Understanding why metrics changed, investigating user behavior patterns, root cause analysis Status: Under development | Pricing: Paid with free tier

Learn more →

Session summaries [Alpha]

Analyze hundreds of session recordings in minutes instead of hours. Session summaries finds patterns, clusters similar issues, and shows you what's actually happening across your user sessions — not just what you caught in the first few recordings you watched.

Best for: Understanding UX issues, debugging problems affecting multiple users, finding edge cases Status: Alpha | Pricing: Paid with free tier

Learn more →

PostHog Code [Under development]

An agent development environment that solves the messy workflow problem of engineering with coding agents. Each task gets its own isolated workspace where an agent works — you can guide the agent, review changes, and switch between workspaces, with everything related to a task in one place instead of across your terminal, editor, and GitHub.

Best for: Product engineers who work on multiple tasks simultaneously and already use agents heavily Status: Under development | Pricing: TBD

Learn more →

Wizard [General availability]

Get PostHog set up in minutes instead of hours. The Wizard detects your tech stack, generates integration code, verifies the installation, and gets you collecting data with minimal manual work.

Best for: New PostHog users, setting up new projects, quick integration Status: General availability | Pricing: Free

Learn more →

MCP server [General availability]

Bring PostHog into your development environment. The MCP server makes PostHog AI's features available to Claude Code, VS Code, and other MCP-compatible tools, so you never have to leave your editor to check analytics or create insights.

Best for: Engineers who prefer editor-based workflows, combining PostHog with other data sources Status: General availability | Pricing: Free

Learn more →

Key concepts

For a list of key concepts definitions, see the Glossary.

Getting started

For users

For engineers building AI features

For product managers

What's next?

The AI platform is actively evolving. Major initiatives include:

For details on upcoming work, see Future directions.

Documentation navigation

Contact

For questions about working with the AI platform:

Canonical URL: https://posthog.com/handbook/engineering/ai/ai-platform

GitHub source: contents/handbook/engineering/ai/ai-platform.md

Content hash: 686d61551c43d536

Static reader notes
  • MDX_COMPONENT_STATIC_ADAPTER: Adapted interactive MDX components for static reading: SmallTeam.