PostHog Handbook Library / Engineering

1,601 words. Estimated reading time: 8 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: Self driving product
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:

- Fragmented user experience: Different AI interactions across products with inconsistent quality and UX patterns
- Duplicated effort: Multiple teams solving the same problems (authentication, error handling, rate limiting, tool calling)
- Maintenance burden: Each team maintaining their own AI infrastructure, models, and prompt engineering
- Limited capabilities: Teams constrained to simple AI features because building advanced functionality (like multi-step reasoning or agentic workflows) from scratch is too expensive

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: Self driving product

The overarching goal of PostHog's AI direction is self driving product. A self-driving product can prompt itself. It understands your codebase, your data, and your users. It proposes and ships work on its own, inside of guardrails you set.

The self in self-driving isn't autonomy from the engineer. It's autonomy from user instruction as the starting point.

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:

- PostHog AI: In-app conversational agent for interacting with PostHog
- Deep research: Automated investigative research for complex, open-ended problems
- Session summaries: Batch analysis of session recordings to find patterns
- PostHog Code: Agent development environment that gives each task its own isolated workspace
- Wizard: CLI tool for automated PostHog installation and setup
- MCP Server: Protocol integration for third-party AI tools like Claude Code

#### 2. Core infrastructure

The shared components that power all products:

- Single-loop agent: An agent architecture that maintains full context and can dynamically load domain expertise
- Agent modes: Pluggable modules that give the agent specialized knowledge and tools (SQL, Analytics, CDP, etc.)
- Core tools: Universal features like search, data reading, and task tracking
- MCP integration: Exposes agent features to external tools via Model Context Protocol

#### 3. Integration points

How everything connects together:

- Products share the same agent features through the MCP server
- Task generation systems (from Deep Research, Session Summaries, PostHog signals) feed PostHog Code
- The Wizard and PostHog Code consume MCP tools to interact with PostHog

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 [Beta]

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: Beta | 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

- Want to try PostHog AI? Open the chat interface in PostHog and start asking questions. See user documentation.
- Prefer working in your editor or coding agent? Set up the MCP server in Claude Code or VS Code.
- Need deep investigation? Toggle to Deep research feature in PostHog AI.

#### For engineers building AI features

- Not sure where to start? See Integration vectors for product teams for the different ways your team can contribute — MCP tools, skills, signals, and more.
- Adding AI to your product? Start with Team structure and collaboration to understand the process.
- Want to add a new agent mode? See Architecture for technical details.
- Need implementation guidance? Check Implementation guide for best practices and patterns.

#### For product managers

- Planning an AI feature? Read Pricing and product positioning to understand our approach.
- Want to understand capabilities? See Products for detailed breakdowns of each product.

### What's next?

The AI platform is actively evolving. Major initiatives include:

- Third-party context integration: Connect PostHog AI to Slack, Zendesk, and other tools for richer context
- PostHog Code expansion: Moving from alpha dogfooding to broader availability
- Deep research refinement: Improving research strategies and denoising algorithms
- Mode expansion: Adding more specialized agent modes as product teams identify needs

For details on upcoming work, see Future directions.

### Documentation navigation

- Products: Detailed information about each user-facing product
- Architecture: Technical deep dive on agent systems and infrastructure
- Team Structure: How teams collaborate on AI features
- Implementation Guide: Best practices, pricing, and implementation patterns

### Contact

For questions about working with the AI platform:

- Slack: #team-posthog-ai
- Team page:
- Objectives: Current goals and initiatives

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

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

Content hash: `ee221b55c4c24c31`

Static reader notes

- `MDX_COMPONENT_STATIC_ADAPTER`: Adapted interactive MDX components for static reading: SmallTeam.