Pilot is an AI assistant that automates the entire A/B testing workflow with PostHog. Simply describe your experiment idea in natural language, and Pilot will create the experiment in PostHog and optionally integrate the feature flag directly into your codebase.
Watch Pilot in action!
Pilot uses AI tool calling to automate three key operations:
- Project Detection: Automatically finds your PostHog project
- Experiment Creation: Creates A/B tests with feature flags and metrics (currently uses
page leavereduction) - Code Integration: Clones your GitHub repository, detects your framework, adds the feature flag code, and commits the changes
You say: "Test a new checkout button design that reduces cart abandonment"
Pilot will:
- Retrieve your PostHog project
- Create an experiment with a unique feature flag key
- Add the feature flag code to your repository (if you provide a GitHub URL)
- Handle framework-specific implementation (React, Next.js, Python, etc.)
You'll need three API keys to use Pilot:
Get from Anthropic Console
This powers Pilot's AI capabilities using Claude Sonnet 4.
Get from PostHog Settings
Important: Your PostHog API key must have these permissions, otherwise we won't be able to create experiments:
project:readfeature_flag:writeexperiment:write
Get from MorphLLM
This is used for intelligent code editing and merging feature flags into your codebase.
- Clone and install dependencies:
git clone <your-repo-url>
cd pilot
pnpm install- Set up environment variables:
cp .env.example .env.localEdit .env.local and add your API keys:
ANTHROPIC_API_KEY=your_anthropic_key_here
POSTHOG_PERSONAL_API_KEY=your_posthog_key_here
MORPH_LLM_API_KEY=your_morphllm_key_here
Start the development server:
pnpm devOpen http://localhost:3000 in your browser and start chatting with Pilot!
Simply describe your experiment hypothesis in the chat interface. Examples:
- "Create an experiment to test a new hero section on the homepage"
- "Test a new pricing page layout. Here's my repo: https://github.com/username/project"
- "I want to test a green vs blue CTA button"
Pilot will handle the rest!
React, Next.js, Node.js, Python, Django, Flask, and more.
MIT
