Skip to content

Commit 5583203

Browse files
edwinyjlimPostHogannikaschmid
authored
PostHog AI docs (#13614)
* scaffolding * scaffold two * posthog ai ascii diagram * start here * allow access * allow access and add memory * content update * Fix typos * typos * conflict * tweak * suggestions * memory details * remove deep research and session summaries * create_experiment tool * pricing * pricing * shorten * Annika pricing update Co-authored-by: Annika 🦔 <[email protected]> * Update contents/docs/posthog-ai/pricing.mdx Co-authored-by: Annika 🦔 <[email protected]> --------- Co-authored-by: PostHog <[email protected]> Co-authored-by: Annika 🦔 <[email protected]>
1 parent 5a1b31b commit 5583203

File tree

17 files changed

+2685
-19
lines changed

17 files changed

+2685
-19
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Allow PostHog AI access
3+
---
4+
5+
You can pop PostHog AI open wherever you are in PostHog. Click on the [PostHog AI](https://app.posthog.com/#panel=max) icon in the right-hand sidebar of the app to open the chat.
6+
7+
<ProductScreenshot
8+
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/posthog_ai_light_99336d67b6.png"
9+
imageDark="https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/posthog_ai_dark_b4abc2083a.png"
10+
alt="Open PostHog AI in the right-hand sidebar"
11+
classes="rounded max-h-[480px]"
12+
/>
13+
14+
<Caption>
15+
PostHog AI chat is always available in the sidebar
16+
</Caption>
17+
18+
## Allow access
19+
20+
In order to use PostHog AI, you need to grant access to your project. This action requires [admin permissions](/docs/settings/access-control) for your organization.
21+
22+
Because PostHog AI features use third-party LLM providers, we require organizations to opt in with admin approval. In most cases, this is just a formality, but we've made it explicit as we take data governance seriously.
23+
24+
There are two ways to grant PostHog AI access to your project as an organization admin.
25+
26+
### Option 1: PostHog AI chat
27+
28+
The very first time you enter a prompt in the chat, PostHog AI will ask you to grant it access to your project. As an admin, you can enable it directly within the chat.
29+
30+
<ProductVideo
31+
videoLight= "https://res.cloudinary.com/dmukukwp6/video/upload/allow_posthog_ai_a148e2f744.mp4"
32+
alt="Allow PostHog AI access"
33+
classes="rounded"
34+
autoPlay={true}
35+
/>
36+
37+
### Option 2: Organization settings
38+
39+
Alternatively, you can enable PostHog AI in your [organization settings](https://app.posthog.com/settings/organization-details#organization-ai-consent).
40+
41+
1. Go to **Settings** > **Organization** > **General**
42+
2. Find the **PostHog AI data analysis** section
43+
3. Toggle the switch to "on"
44+
45+
<ProductScreenshot
46+
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/SCR_20251107_nmhv_aafc81cdbb.png"
47+
imageDark="https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/SCR_20251107_nmkd_ad9d7dbe15.png"
48+
alt="PostHog AI settings"
49+
classes="rounded"
50+
/>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: PostHog AI context and commands
3+
---
4+
5+
## Adding context
6+
7+
PostHog AI automatically detects the active tab or page you're on to infer context. But you can also manually add other data points from your project for PostHog AI to reference as context.
8+
9+
Click the **@ Add context** button in the chat to include:
10+
11+
- Insights like trends, funnels, retention, etc.
12+
- Events and actions from your data model
13+
- Dashboards with insights
14+
15+
<ProductVideo
16+
videoLight= "https://res.cloudinary.com/dmukukwp6/video/upload/add_context_81218e0b5d.mp4"
17+
alt="Add context"
18+
classes="rounded"
19+
autoPlay={true}
20+
/>
21+
22+
<Caption>
23+
Select data points to include as context
24+
</Caption>
25+
26+
When you add context, PostHog AI can reference the specific queries, filters, or data from those items when answering your questions.
27+
28+
## Chat commands
29+
30+
PostHog AI supports the following slash `/` commands in the chat.
31+
32+
| Command | Description |
33+
| --- | ---- |
34+
| `/init` | PostHog AI collects information about your product and company to save to memory. |
35+
| `/remember` | Saves your text input to memory. |
36+
| `/usage` | Displays a breakdown of your [AI credit](/docs/posthog-ai/pricing) usage. |
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Edit and save memory to PostHog AI
3+
---
4+
5+
import {IconGear} from '@posthog/icons'
6+
7+
You can use PostHog AI memory to save context or instructions that persist between conversations. This helps PostHog AI to remember important details about your product, company, or preferred ways of working.
8+
9+
PostHog AI uses this memory to deliver results that better match your preferences.
10+
11+
<ProductScreenshot
12+
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/SCR_20251107_ngbw_8c59ce9ef9.png"
13+
imageDark="https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/SCR_20251107_ngeu_1f6af494ee.png"
14+
alt="PostHog AI memory"
15+
classes="rounded"
16+
/>
17+
18+
## Run /init command
19+
20+
To get started, we recommend running the [`/init`](https://app.posthog.com/#panel=max:/init) command in the PostHog AI chat.
21+
22+
1. If you have a client or mobile SDK installed, PostHog AI will retrieve the URL or app bundle and search the web for more information about your product and then save it to memory.
23+
2. If little or no data is available, PostHog AI will ask you a few baseline questions to learn more and then save it to memory.
24+
25+
## Edit memory
26+
27+
You can also access PostHog AI's memory to make direct changes. You can access and edit its memory in three ways:
28+
29+
1. Click the **gear icon** <span className="inline-block"><IconGear className="w-4 h-4" /></span> in the chat
30+
2. Navigate to project **Settings** > **AI**
31+
3. Run the `/remember` command in the chat to add new information to memory
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: PostHog AI example prompts
3+
---
4+
5+
import {IconGraph, IconPieChart,IconRewindPlay, IconDatabase, IconToggle, IconFlask, IconWarning, IconMessage, IconPlug, IconLogomark, IconBook, IconPiggyBank, IconLlmAnalytics} from '@posthog/icons'
6+
import { CalloutBox } from 'components/Docs/CalloutBox'
7+
8+
PostHog AI can be used in many ways. Because it works directly with your project's data, its responses and actions are unique to your setup. There is no single "correct" way of using PostHog AI.
9+
10+
As a starting point, here are some example chat prompts you can use to explore what's possible with PostHog AI.
11+
12+
<CalloutBox icon="IconInfo" title="LLMs" type="fyi">
13+
PostHog AI's responses and findings highly depend on the product data, context, and prompts you provide it. As with all LLM-based systems, its non-deterministic nature means the same prompt can potentially produce different outputs.
14+
</CalloutBox>
15+
16+
## <span className="inline-block"><IconGraph className="w-6 h-6 -mb-1 text-blue" /></span> Product analytics
17+
18+
- [`Create an insight showing daily active users for the past week`](https://app.posthog.com/#panel=max:!Create%20an%20insight%20showing%20daily%20active%20users%20for%20the%20past%20week)
19+
- [`Build a dashboard for onboarding retention`](https://app.posthog.com/#panel=max:!Build%20a%20dashboard%20for%20onboarding%20retention)
20+
- [`What changed across my product this week?`](https://app.posthog.com/#panel=max:!What%20changed%20across%20my%20product%20this%20week?)
21+
22+
## <span className="inline-block"><IconPieChart className="w-6 h-6 -mb-1 text-green-2" /></span> Web analytics
23+
24+
- [`Create a dashboard showing web traffic by source and campaign`](https://app.posthog.com/#panel=max:!Create%20a%20dashboard%20showing%20web%20traffic%20by%20source%20and%20campaign)
25+
- [`Which landing pages have the highest bounce rate this week?`](https://app.posthog.com/#panel=max:!Which%20landing%20pages%20have%20the%20highest%20bounce%20rate%20this%20week?)
26+
- [`Find the most common paths users take after visiting the blog`](https://app.posthog.com/#panel=max:!Find%20the%20most%20common%20paths%20users%20take%20after%20visiting%20the%20blog)
27+
28+
## <span className="inline-block"><IconRewindPlay className="w-6 h-6 -mb-1 text-yellow" /></span> Session replay
29+
30+
- [`Find sessions where users dropped off during checkout`](https://app.posthog.com/#panel=max:!Find%20sessions%20where%20users%20dropped%20off%20during%20checkout)
31+
- [`Summarize session replays where users got stuck`](https://app.posthog.com/#panel=max:!Summarize%20session%20replays%20where%20users%20got%20stuck)
32+
- [`Show recordings for users who triggered the rage click event`](https://app.posthog.com/#panel=max:!Show%20recordings%20for%20users%20who%20triggered%20the%20rage%20click%20event)
33+
34+
## <span className="inline-block"><IconDatabase className="w-6 h-6 -mb-1 text-lilac" /></span> Data warehouse
35+
36+
- [`List all available tables and their columns`](https://app.posthog.com/#panel=max:!List%20all%20available%20tables%20and%20their%20columns)
37+
- [`Write a query to join event data with user properties`](https://app.posthog.com/#panel=max:!Write%20a%20query%20to%20join%20event%20data%20with%20user%20properties)
38+
- [`Fix the syntax for the query I have open in the SQL editor`](https://app.posthog.com/#panel=max:!Fix%20the%20syntax%20for%20the%20query%20I%20have%20open%20in%20the%20SQL%20editor)
39+
40+
## <span className="inline-block"><IconToggle className="w-6 h-6 -mb-1 text-seagreen" /></span> Feature flags
41+
42+
- [`Create a new multivariate feature flag for dark mode`](https://app.posthog.com/#panel=max:!Create%20a%20new%20multivariate%20feature%20flag%20for%20dark%20mode)
43+
- [`Show me which flags are currently active in production`](https://app.posthog.com/#panel=max:!Show%20me%20which%20flags%20are%20currently%20active%20in%20production)
44+
45+
## <span className="inline-block"><IconFlask className="w-6 h-6 -mb-1 text-purple" /></span> Experiments
46+
47+
- [`Set up an A/B test with a 70/30 split for a new red button on the homepage`](https://app.posthog.com/#panel=max:!Set%20up%20an%20A/B%20test%20with%20a%2070/30%20split%20for%20a%20new%20red%20button%20on%20the%20homepage)
48+
- [`Summarize experiment results for my latest feature rollout`](https://app.posthog.com/#panel=max:!Summarize%20experiment%20results%20for%20my%20latest%20feature%20rollout)
49+
50+
## <span className="inline-block"><IconWarning className="w-6 h-6 -mb-1 text-yellow" /></span> Error tracking
51+
52+
- [`Find the most common frontend errors this week`](https://app.posthog.com/#panel=max:!Find%20the%20most%20common%20frontend%20errors%20this%20week)
53+
- [`Which errors impact user sign-ups the most?`](https://app.posthog.com/#panel=max:!Which%20errors%20impact%20user%20sign-ups%20the%20most?)
54+
- [`Summarize new issues introduced after the latest release`](https://app.posthog.com/#panel=max:!Summarize%20new%20issues%20introduced%20after%20the%20latest%20release)
55+
56+
## <span className="inline-block"><IconPlug className="w-6 h-6 -mb-1 text-seagreen" /></span> Data pipelines
57+
58+
- [`Create a Hog function that filters out internal traffic`](https://app.posthog.com/#panel=max:!Create%20a%20Hog%20function%20that%20filters%20out%20internal%20traffic)
59+
- [`Parse event timestamps into day, week, and month properties`](https://app.posthog.com/#panel=max:!Parse%20event%20timestamps%20into%20day,%20week,%20and%20month%20properties)
60+
- [`Drop events where test_mode = true or the environment is staging`](https://app.posthog.com/#panel=max:!Drop%20events%20where%20test_mode%20=%20true%20or%20the%20environment%20is%20staging)
61+
62+
## <span className="inline-block"><IconLlmAnalytics className="w-6 h-6 -mb-1 text-fuchsia-dark" /></span> LLM analytics
63+
64+
- [`Analyze LLM token usage over the past 7 days`](https://app.posthog.com/#panel=max:!Analyze%20LLM%20token%20usage%20over%20the%20past%207%20days)
65+
- [`Summarize traces for the latest model deployment`](https://app.posthog.com/#panel=max:!Summarize%20traces%20for%20the%20latest%20model%20deployment)
66+
67+
## <span className="inline-block"><IconPiggyBank className="w-6 h-6 -mb-1 text-green-2" /></span> Revenue analytics
68+
69+
- [`Show my revenue for the past year`](https://app.posthog.com/#panel=max:!Show%20my%20revenue%20for%20the%20past%20year)
70+
- [`Create a dashboard that breaks down revenue by product or feature`](https://app.posthog.com/#panel=max:!Create%20a%20dashboard%20that%20breaks%20down%20revenue%20by%20product%20or%20feature)
71+
72+
## <span className="inline-block"><IconMessage className="w-6 h-6 -mb-1 text-red" /></span> Surveys
73+
74+
- [`Create a new survey to collect feedback on pricing`](https://app.posthog.com/#panel=max:!Create%20a%20new%20survey%20to%20collect%20feedback%20on%20pricing)
75+
- [`Analyze responses from the latest NPS survey`](https://app.posthog.com/#panel=max:!Analyze%20responses%20from%20the%20latest%20NPS%20survey)
76+
77+
## <span className="inline-block"><IconBook className="w-6 h-6 -mb-1 text-blue" /></span> Docs
78+
79+
- [`Explain how feature flags work in PostHog`](https://app.posthog.com/#panel=max:!Explain%20how%20feature%20flags%20work%20in%20PostHog)
80+
- [`Find setup instructions for Next.js SDK`](https://app.posthog.com/#panel=max:!Find%20setup%20instructions%20for%20Next.js%20SDK)
81+
- [`Summarize the differences between trends and funnels`](https://app.posthog.com/#panel=max:!Summarize%20the%20differences%20between%20trends%20and%20funnels)

contents/docs/posthog-ai/faq.mdx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: PostHog AI FAQ
3+
---
4+
5+
## What access does PostHog AI have to my data?
6+
7+
While working with PostHog AI, you will certainly share some information with it. Data analysis is a core feature. When doing research, PostHog AI can read the following data in your project:
8+
9+
- Events, persons, sessions, groups
10+
- Actions and cohorts
11+
- Event and property definitions
12+
- Data warehouse schema
13+
14+
Based on that context, PostHog AI comes up with queries, runs them, and summarizes the results. Those results can be as high-level as a single number, or as detailed as a list of users with all their properties.
15+
16+
## Is my data shared with third parties?
17+
18+
We use third-party providers to power PostHog AI, so messages and all data accessed by PostHog AI (see list above) are passed through them.
19+
20+
Our list of data subprocessors includes:
21+
22+
- OpenAI and Anthropic – responsible for the core of PostHog AI's functionality, have access to user messages and all data types.
23+
- Azure – responsible for semantic search across PostHog, has access to actions and cohorts (including their filters)
24+
25+
Other providers that are not data subprocessors:
26+
27+
- Perplexity – responsible for providing context about your product and/or company, has access to domain name (for websites) or application bundle ID (for mobile applications). We do not send any of your data.
28+
29+
## How can I disable PostHog AI?
30+
31+
With [admin permissions](/docs/settings/access-control) for your organization, you can disable PostHog AI and all AI data analysis in your [organization settings](https://app.posthog.com/settings/organization-details#organization-ai-consent).
32+
33+
1. Go to **Settings** > **Organization** > **General**
34+
2. Find the **PostHog AI data analysis** section
35+
3. Toggle the switch to "off"
36+
37+
When disabled, PostHog AI won't be available and no data will be shared with AI providers. This can be reversed at any time.
38+
39+
## Can I hide PostHog AI?
40+
41+
There currently isn't a toggle to _hide_ AI features altogether. However, in any case, only org admins can approve AI features in the organization – so there's no risk of data being sent to any AI provider without explicit consent.
42+
43+
## Is my chat history retained if I disable and re-enable PostHog AI?
44+
45+
Yes, PostHog AI retains your chat history.
46+
47+
## Can I self-host PostHog AI and use my own models?
48+
49+
No, PostHog AI is only available in the cloud-hosted [PostHog app](https://app.posthog.com), which uses third-party LLM providers. PostHog automatically selects the most efficient model for each AI feature.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Investigate web traffic with PostHog AI
3+
---
4+
5+
import WistiaEmbed from 'components/WistiaEmbed'
6+
7+
This guide shows you how the PostHog team uses PostHog AI to investigate web traffic. It includes a video demo and the prompts used to create insights, build dashboards, and analyze data from [web analytics](/docs/web-analytics) and [session replays](/docs/session-replay).
8+
9+
This demo example uses our own internal PostHog project. The results will differ based on your project's specific setup and the data that's available to PostHog AI.
10+
11+
## Video demo
12+
13+
<WistiaEmbed mediaId="tgws1dixc0" className="mb-5" />
14+
15+
<Caption>
16+
How PostHog uses PostHog AI to investigate web traffic
17+
</Caption>
18+
19+
## Conversation with PostHog AI
20+
21+
Here's the full conversation with PostHog AI.
22+
23+
**Prompt #1**
24+
25+
> Add a graph series for unique users.
26+
27+
**Prompt #2**
28+
29+
> There’s an odd traffic spike happening around September 29th. Create a dashboard of insights with traffic breakdowns by referral, country, user agent, and operating system to further investigate what the root cause is.
30+
31+
**Prompt #3**
32+
33+
> Create a new insight with traffic breakdown by IP address. Any suspicious traffic behavior here?
34+
35+
**Prompt #4**
36+
37+
> Find the session replays for that specific IP address over the last 60 days.
38+
39+
**Prompt #5**
40+
41+
> Summarize these session recordings in a report for me and provide key findings.

contents/docs/posthog-ai/index.mdx renamed to contents/docs/posthog-ai/overview.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: PostHog AI
2+
title: PostHog AI overview
33
sidebar: Docs
44
showTitle: true
55
---
@@ -10,7 +10,7 @@ import { CalloutBox } from 'components/Docs/CalloutBox'
1010

1111
- **Research answers** to product questions by querying the data.
1212
- **Get things done** quickly in the PostHog UI for you like update filters, create insights, write SQL, find session replays, make surveys, and more.
13-
- **Explain PostHog** features and how to use them (based on our docs).
13+
- **Explain PostHog** features and how to use them based on our docs.
1414
- **Chit-chat** about anything PostHog-related really.
1515

1616
## How do I access PostHog AI?
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: 'PostHog AI: platform and chat UI'
3+
---
4+
5+
import { IconSparkles } from '@posthog/icons'
6+
7+
PostHog AI powers all AI features within the [PostHog app](https://app.posthog.com). It is an AI agent that sits on top of the PostHog platform. As a result, there are multiple ways of working with PostHog AI.
8+
9+
Here's an overview of the different UIs for interacting with PostHog AI.
10+
11+
## In-app chat
12+
13+
The primary dedicated interface is an in-app <a href="https://app.posthog.com/#panel=max">AI chat</a> for conventional prompting and conversation-based flows.
14+
15+
When logged in, the PostHog AI chat is always available in the right-hand sidebar of the PostHog app. You can open it at any time by clicking the PostHog AI icon.
16+
17+
<ProductVideo
18+
videoLight="https://res.cloudinary.com/dmukukwp6/video/upload/posthog_ai_sidebar_4k_compressed_75af4f4370.mp4"
19+
alt="PostHog AI chat"
20+
classes="rounded"
21+
autoPlay={true}
22+
/>
23+
24+
<Caption>
25+
The PostHog AI chat is always available in the sidebar
26+
</Caption>
27+
28+
The in-app chat supports conversation history and features like [context, commands, and memory](/docs/posthog-ai/context-and-commands).
29+
30+
## Platform UI
31+
32+
PostHog AI shows up throughout the PostHog platform as inline or ambient UI elements, typically labelled with the <span className="inline-block"><IconSparkles className="h-4 w-4" /> </span> icon, and embedded within other features.
33+
34+
These entrypoints or shortcuts enable you to trigger PostHog AI directly from the PostHog UI.
35+
36+
<ProductVideo
37+
videoLight="https://res.cloudinary.com/dmukukwp6/video/upload/posthog_ai_platform_compressed_a7d9048b08.mp4"
38+
alt="PostHog AI platform UI"
39+
classes="rounded"
40+
autoPlay={true}
41+
/>
42+
43+
<Caption>
44+
PostHog AI can be accessed throughout the platform UI
45+
</Caption>
46+
47+
## Website chat
48+
49+
PostHog AI is also accessible when logged out of the app and on the website, [posthog.com](/). However, in this mode, it's limited to searching and answering questions about PostHog's documentation.
50+
51+
<ProductVideo
52+
videoLight="https://res.cloudinary.com/dmukukwp6/video/upload/website_posthog_ai_compressed_78452d5325.mp4"
53+
alt="PostHog AI website chat"
54+
classes="rounded"
55+
autoPlay={true}
56+
/>
57+
58+
<Caption>
59+
You can chat with PostHog AI about documentation when logged out
60+
</Caption>
61+
62+
## Future interfaces
63+
64+
We are working on adding more form factors to expand PostHog AI's capabilities. These may include:
65+
66+
- Notebooks for deep research and reports
67+
- Background tasks and workflows
68+
- API calls
69+
- MCP tool calls
70+
71+
If you have any feedback or ideas, feel free to reach out to us on [GitHub](https://github.com/posthog/posthog/issues) and open a feature request.

0 commit comments

Comments
 (0)