:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(replay-vision): deeplink observation evidence for mcp agents (#76980)
coryslater7bf27ecbafe6
diff --git a/products/replay_vision/mcp/tools.yaml b/products/replay_vision/mcp/tools.yamlindex 73cb598f8edd..57efa98123a9 100644--- a/products/replay_vision/mcp/tools.yaml+++ b/products/replay_vision/mcp/tools.yaml@@ -209,6 +209,7 @@ tools:readOnly: truedestructive: falseidempotent: true+ enrich_url: '{session_id}'list: truetitle: List a session's replay vision observationsdescription: >@@ -219,7 +220,14 @@ tools:it, the observation `status` (pending/running/succeeded/failed/ineligible), the `error_reason` for terminalnon-success statuses, and the `scanner_result` (LLM output) on success. To list observations for onespecific scanner over time instead, use `vision-scanners-observations-list`.+ agent_note: >+ Each observation's `_posthogUrl` opens the recording it analysed.+ `scanner_result.model_output.reasoning_segments` interleaves prose with `chip` segments, and a chip's+ `timestamp_ms` is the recording-relative offset of the moment being cited — append `?t=<seconds>`+ (`timestamp_ms` / 1000, rounded down) to that URL to seek straight to it. When you report a finding to+ someone, deep-link the one or two moments it turns on rather than only describing them.feature_flag: replay-vision+ url_prefix: /replayvision-observations-retrieve:operation: vision_observations_retrieveenabled: true@@ -230,12 +238,20 @@ tools:readOnly: truedestructive: falseidempotent: true+ enrich_url: '{session_id}'title: Get a session's replay vision observationdescription: >Get a single replay vision observation by ID, scoped to the scanners the caller can read. Returns the full`scanner_snapshot` (the scanner's configuration at run time) and `scanner_result` (the LLM output, with anyevent citations). Use `vision-observations-list` to find observation IDs for a session first.+ agent_note: >+ `_posthogUrl` opens the recording this observation analysed.+ `scanner_result.model_output.reasoning_segments` interleaves prose with `chip` segments, and a chip's+ `timestamp_ms` is the recording-relative offset of the moment being cited — append `?t=<seconds>`+ (`timestamp_ms` / 1000, rounded down) to that URL to seek straight to it. When you report a finding to+ someone, deep-link the one or two moments it turns on rather than only describing them.feature_flag: replay-vision+ url_prefix: /replayvision-observations-retry-create:operation: vision_observations_retry_createenabled: false@@ -418,6 +434,7 @@ tools:readOnly: truedestructive: falseidempotent: true+ enrich_url: '{session_id}'title: Get scanner observationdescription: >Get a single scanner observation by ID. Returns the full `scanner_snapshot` (the scanner's configuration as@@ -425,7 +442,14 @@ tools:including any event citations linking the LLM output back to specific events in the originating session.Pair with the session-recording MCP tools or the investigating-replay skill to inspect the underlyingrecording.+ agent_note: >+ `_posthogUrl` opens the recording this observation analysed.+ `scanner_result.model_output.reasoning_segments` interleaves prose with `chip` segments, and a chip's+ `timestamp_ms` is the recording-relative offset of the moment being cited — append `?t=<seconds>`+ (`timestamp_ms` / 1000, rounded down) to that URL to seek straight to it. When you report a finding to+ someone, deep-link the one or two moments it turns on rather than only describing them.feature_flag: replay-vision+ url_prefix: /replayvision-scanners-observations-label-create:operation: vision_scanners_observations_label_createenabled: false@@ -442,6 +466,7 @@ tools:readOnly: truedestructive: falseidempotent: true+ enrich_url: '{session_id}'list: truetitle: List scanner observationsdescription: >@@ -452,7 +477,14 @@ tools:`workflow_id`, the `scanner_result` (the LLM output validated against the scanner's response schema for thatscanner_type), and the `session_id` of the recording it analysed. Use this to inspect what a scanner hasfound over time; to see every scanner's observations for one session, use `vision-observations-list`.+ agent_note: >+ Each observation's `_posthogUrl` opens the recording it analysed.+ `scanner_result.model_output.reasoning_segments` interleaves prose with `chip` segments, and a chip's+ `timestamp_ms` is the recording-relative offset of the moment being cited — append `?t=<seconds>`+ (`timestamp_ms` / 1000, rounded down) to that URL to seek straight to it. When you report a finding to+ someone, deep-link the one or two moments it turns on rather than only describing them.feature_flag: replay-vision+ url_prefix: /replayvision-scanners-observations-retry-create:operation: vision_scanners_observations_retry_createenabled: falsediff --git a/products/replay_vision/skills/exploring-replay-vision-observations/SKILL.md b/products/replay_vision/skills/exploring-replay-vision-observations/SKILL.mdindex 4e067aa95a3b..edb5a6258e86 100644--- a/products/replay_vision/skills/exploring-replay-vision-observations/SKILL.md+++ b/products/replay_vision/skills/exploring-replay-vision-observations/SKILL.md@@ -78,6 +78,21 @@ To test a scanner's lens against a specific session that doesn't have an observawith `vision-scanners-scan-session` — it's async (minutes; rasterising the recording + the LLM call are slow)and, like all observations, runs at most once per `(scanner, session)`.+### Cite moments, not just sessions++`scanner_result.model_output.reasoning_segments` is the same prose as `reasoning`, pre-split into `text` segments and `chip` segments.+Each chip carries a `timestamp_ms`: the recording-relative offset of the moment the model is pointing at.+That's what makes a finding checkable — it turns "the user hit a paywall" into a link that opens on the paywall.++The observation's `_posthogUrl` is its recording; append `?t=<seconds>` (`timestamp_ms` / 1000, rounded down) to seek there.++```text+https://us.posthog.com/project/<project_id>/replay/<session_id>?t=1420+```++Link the one or two moments the finding turns on — a link per chip is noise.+Timestamps are relative to the recording the observation analysed, so never carry a `timestamp_ms` from one observation onto another session's URL.+## Step 4 — Act on the findingsMatch the action to the user's intent, and **corroborate before you create work**:diff --git a/services/mcp/src/tools/generated/replay_vision.ts b/services/mcp/src/tools/generated/replay_vision.tsindex 4cffa72b6ddd..b18eb5385db0 100644--- a/services/mcp/src/tools/generated/replay_vision.ts+++ b/services/mcp/src/tools/generated/replay_vision.ts@@ -43,7 +43,7 @@ import {VisionScannersPromptSuggestionsGenerateCreateParams,VisionScannersRetrieveParams,} from '@/generated/replay_vision/api'-import { withPostHogUrl, type WithPostHogUrl } from '@/tools/tool-utils'+import { withPostHogUrl, withAgentNote, type WithPostHogUrl, type WithAgentNote } from '@/tools/tool-utils'import type { Context, ToolBase, ZodObjectAny } from '@/tools/types'const VisionActionsCreateSchema = VisionActionsCreateBody@@ -287,7 +287,7 @@ const VisionObservationsListSchema = VisionObservationsListQueryParamsconst visionObservationsList = (): ToolBase<typeof VisionObservationsListSchema,- WithPostHogUrl<Schemas.PaginatedReplayObservationList>+ WithAgentNote<WithPostHogUrl<Schemas.PaginatedReplayObservationList>>> => ({name: 'vision-observations-list',schema: VisionObservationsListSchema,@@ -303,7 +303,21 @@ const visionObservationsList = (): ToolBase<session_id: params.session_id,},})- return await withPostHogUrl(context, result, '/replay-vision')+ return withAgentNote(+ await withPostHogUrl(+ context,+ {+ ...result,+ results: await Promise.all(+ (result.results ?? []).map((item) =>+ withPostHogUrl(context, item, `/replay/${item.session_id}`)+ )+ ),+ },+ '/replay'+ ),+ "Each observation's `_posthogUrl` opens the recording it analysed. `scanner_result.model_output.reasoning_segments` interleaves prose with `chip` segments, and a chip's `timestamp_ms` is the recording-relative offset of the moment being cited — append `?t=<seconds>` (`timestamp_ms` / 1000, rounded down) to that URL to seek straight to it. When you report a finding to someone, deep-link the one or two moments it turns on rather than only describing them.\n"+ )},})@@ -313,7 +327,7 @@ const VisionObservationsRetrieveSchema = VisionObservationsRetrieveParams.omit({const visionObservationsRetrieve = (): ToolBase<typeof VisionObservationsRetrieveSchema,- Schemas.ReplayObservation+ WithAgentNote<WithPostHogUrl<Schemas.ReplayObservation>>> => ({name: 'vision-observations-retrieve',schema: VisionObservationsRetrieveSchema,@@ -335,7 +349,10 @@ const visionObservationsRetrieve = (): ToolBase<verdict: params.verdict,},})- return result+ return withAgentNote(+ await withPostHogUrl(context, result, `/replay/${result.session_id}`),+ "`_posthogUrl` opens the recording this observation analysed. `scanner_result.model_output.reasoning_segments` interleaves prose with `chip` segments, and a chip's `timestamp_ms` is the recording-relative offset of the moment being cited — append `?t=<seconds>` (`timestamp_ms` / 1000, rounded down) to that URL to seek straight to it. When you report a finding to someone, deep-link the one or two moments it turns on rather than only describing them.\n"+ )},})@@ -564,7 +581,7 @@ const VisionScannersObservationsGetSchema = VisionScannersObservationsRetrievePaconst visionScannersObservationsGet = (): ToolBase<typeof VisionScannersObservationsGetSchema,- Schemas.ReplayObservation+ WithAgentNote<WithPostHogUrl<Schemas.ReplayObservation>>> => ({name: 'vision-scanners-observations-get',schema: VisionScannersObservationsGetSchema,@@ -586,7 +603,10 @@ const visionScannersObservationsGet = (): ToolBase<verdict: params.verdict,},})- return result+ return withAgentNote(+ await withPostHogUrl(context, result, `/replay/${result.session_id}`),+ "`_posthogUrl` opens the recording this observation analysed. `scanner_result.model_output.reasoning_segments` interleaves prose with `chip` segments, and a chip's `timestamp_ms` is the recording-relative offset of the moment being cited — append `?t=<seconds>` (`timestamp_ms` / 1000, rounded down) to that URL to seek straight to it. When you report a finding to someone, deep-link the one or two moments it turns on rather than only describing them.\n"+ )},})@@ -596,7 +616,7 @@ const VisionScannersObservationsListSchema = VisionScannersObservationsListParamconst visionScannersObservationsList = (): ToolBase<typeof VisionScannersObservationsListSchema,- WithPostHogUrl<Schemas.PaginatedReplayObservationList>+ WithAgentNote<WithPostHogUrl<Schemas.PaginatedReplayObservationList>>> => ({name: 'vision-scanners-observations-list',schema: VisionScannersObservationsListSchema,@@ -620,7 +640,21 @@ const visionScannersObservationsList = (): ToolBase<verdict: params.verdict,},})- return await withPostHogUrl(context, result, '/replay-vision')+ return withAgentNote(+ await withPostHogUrl(+ context,+ {+ ...result,+ results: await Promise.all(+ (result.results ?? []).map((item) =>+ withPostHogUrl(context, item, `/replay/${item.session_id}`)+ )+ ),+ },+ '/replay'+ ),+ "Each observation's `_posthogUrl` opens the recording it analysed. `scanner_result.model_output.reasoning_segments` interleaves prose with `chip` segments, and a chip's `timestamp_ms` is the recording-relative offset of the moment being cited — append `?t=<seconds>` (`timestamp_ms` / 1000, rounded down) to that URL to seek straight to it. When you report a finding to someone, deep-link the one or two moments it turns on rather than only describing them.\n"+ )},})