creating-replay-vision-scanners
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreating Replay Vision scanners
创建Replay Vision扫描器
A scanner is a standing LLM probe over session recordings. Once created and enabled, it runs on a
Temporal schedule that sweeps every 5 minutes, applying its prompt to each new matching recording and
recording the result as an observation (a queryable event). Each observation counts
against a monthly org quota (a fixed number of observations per calendar month).
$recording_observedThat schedule is exactly why creation needs a gut-check: a scanner with a permissive query and full sampling
starts consuming quota automatically and can drain the whole month's budget within its first few sweeps.
Creation itself does not check quota — that protection only kicks in at observation time, by which point
the budget may already be gone.
扫描器是针对会话录制的常驻LLM探针。创建并启用后,它会按照每5分钟执行一次的Temporal调度运行,将其提示应用于每个新匹配的录制内容,并将结果记录为观测数据(可查询的事件)。每个观测数据都会消耗组织月度配额(每个日历月的固定观测数量)。
$recording_observed正是这种调度机制要求在创建前进行审慎检查:如果扫描器的查询条件过于宽松且采用全采样率,会自动开始消耗配额,甚至可能在几次扫描后就耗尽整个月的预算。创建操作本身不会检查配额——这种保护仅在生成观测数据时生效,届时预算可能已被耗尽。
Core principle: size before you ship
核心原则:先规划规模再创建
Never create an enabled scanner blind. Estimate its volume, check remaining quota, and — when the projected
volume is a meaningful fraction of what's left — show the user the numbers and get confirmation before
creating. This is the heart of the skill; the rest is supporting detail.
切勿盲目创建已启用的扫描器。先估算其观测规模,检查剩余配额,当预估规模占剩余配额的比例较高时,需向用户展示具体数值并获得确认后再创建。这是本技能的核心,其余内容均为辅助细节。
The flow
操作流程
Step 1: What should the scanner do?
步骤1:扫描器的功能定位
Pick a and write its . Every type needs a ; the rest is type-specific:
scanner_typescanner_configprompt| Type | What it produces | |
|---|---|---|
| Open-ended observation against a prompt (e.g. "flag rage clicks") | |
| Assigns tags from a fixed label set | |
| Numeric score on a rubric | |
| Free-text summary; optional facet embeddings for search | |
scanner_typescanner_configIf the user's intent makes the type and prompt obvious, just proceed — don't interrogate them.
选择并编写其。每种类型都需要;其余参数则因类型而异:
scanner_typescanner_configprompt| 类型 | 产出内容 | |
|---|---|---|
| 基于提示的开放式观测结果(例如“标记狂点行为”) | |
| 从固定标签集中分配标签 | |
| 基于评分标准的数值评分 | |
| 自由文本摘要;可选用于搜索的分面嵌入向量 | |
scanner_typescanner_config如果用户的意图已明确类型和提示内容,可直接推进流程,无需反复询问。
Step 2: Which sessions?
步骤2:选择目标会话
The is a shape that selects which recordings the scanner watches. and
are ignored (the schedule controls time), so don't bother setting them. Narrow the query to the
sessions that actually matter — by event, URL, person property, duration, etc. A narrow query is the single
biggest lever on cost.
queryRecordingsQuerydate_fromdate_tosampling_ratequeryRecordingsQuerydate_fromdate_tosampling_rateStep 3: Size it — the gut-check (do not skip)
步骤3:规模规划——审慎检查(不可跳过)
Before creating, run both checks and reason about them together:
- Estimate volume — call with the proposed
vision-scanners-estimate-create+query. It returnssampling_rate, thematched_sessions_in_windowmeasured, andwindow_days.estimated_observations_per_month - Check budget — call for
vision-quota-retrieveandremainingagainst the org's monthlyexhausted.monthly_quota
Then decide:
- If comfortably fits within
estimated_observations_per_month, proceed.remaining - If it's a large fraction of (or exceeds) , stop and tell the user the concrete numbers — e.g. "This scanner is projected to produce ~X observations/month; you have Y of Z left this month." — and confirm before creating, or suggest tightening the
remainingor loweringqueryfirst.sampling_rate - If the org is already , say so — a new enabled scanner won't produce anything until the quota resets, and its observations will be silently skipped.
exhausted
Confirmation here is a conversation step, not an API capability — surface the trade-off and let the user
choose. When the projected volume is clearly small relative to the budget, you don't need to ask.
创建前,需同时执行以下两项检查并综合分析:
- 估算规模——调用接口,传入拟议的
vision-scanners-estimate-create和query。接口会返回sampling_rate(统计窗口内匹配的会话数)、matched_sessions_in_window(统计天数)以及window_days(月度预估观测数)。estimated_observations_per_month - 检查预算——调用接口,获取组织月度
vision-quota-retrieve的monthly_quota(剩余配额)和remaining(是否已耗尽)状态。exhausted
随后根据结果决策:
- 如果远小于
estimated_observations_per_month,可直接推进创建。remaining - 如果预估规模占的比例较高(或超出),需暂停操作并告知用户具体数值——例如“该扫描器预计每月产生约X条观测数据;本月您的配额剩余Y/Z”——并在创建前获得用户确认,或建议先缩小
remaining范围或降低query。sampling_rate - 如果组织配额已,需告知用户——新启用的扫描器在配额重置前不会生成任何观测数据,其观测请求会被静默跳过。
exhausted
此处的确认属于对话环节,而非API功能——需向用户说明权衡关系并由用户选择。当预估规模远小于预算时,无需询问确认。
Step 4: Create
步骤4:创建扫描器
Call . Minimal example:
vision-scanners-createjson
{
"name": "Rage click monitor",
"scanner_type": "monitor",
"scanner_config": { "prompt": "Flag sessions where the user repeatedly clicks the same element in frustration." },
"query": { "kind": "RecordingsQuery", "events": [{ "id": "$rageclick", "type": "events" }] },
"sampling_rate": 1.0,
"model": "gemini-3-flash-preview",
"enabled": true
}nameenabled: false调用接口。最简示例:
vision-scanners-createjson
{
"name": "Rage click monitor",
"scanner_type": "monitor",
"scanner_config": { "prompt": "Flag sessions where the user repeatedly clicks the same element in frustration." },
"query": { "kind": "RecordingsQuery", "events": [{ "id": "$rageclick", "type": "events" }] },
"sampling_rate": 1.0,
"model": "gemini-3-flash-preview",
"enabled": true
}nameenabled: falseAfter creation
创建后操作
- Show the scanner's PostHog URL from the response so the user can review it in the UI.
- Results take a few minutes to appear (rasterizing the recording to video + the LLM call are slow). Inspect
them with for one scanner over time, or
vision-scanners-observations-list(requiresvision-observations-list) for every scanner's findings on a single session. To dig into a recording, hand off to thesession_idskill.investigating-replay
- 展示响应中的扫描器PostHog URL,方便用户在UI中查看。
- 结果需数分钟后才会显示(将录制内容栅格化为视频+LLM调用的过程较慢)。可使用查看单个扫描器的历史观测结果,或使用
vision-scanners-observations-list(需传入vision-observations-list)查看所有扫描器对单个会话的检测结果。如需深入分析录制内容,可转交至session_id技能处理。investigating-replay
Updating an existing scanner
更新现有扫描器
vision-scanners-updatequerysampling_rateenabledscanner_versionvision-scanners-updatequerysampling_rateenabledscanner_versionGotchas
注意事项
- One observation per (scanner, session). Re-running a scanner on a session it already observed — even a failed or ineligible one — is a no-op and won't produce a fresh scan.
- Ineligible ≠ failed. Observations can land (e.g.
ineligible,too_short) — a terminal non-error outcome. Checkno_recordingwhen triaging why a scanner produced nothing.error_reason - Provider/model are Google/Gemini only in the current version.
- 每个(扫描器,会话)组合仅生成一条观测数据。即使扫描器已观测过某会话(包括观测失败或不符合条件的情况),再次运行也不会生成新的扫描结果。
- 不符合条件≠失败。观测结果可能标记为(例如
ineligible、too_short)——这是终端非错误状态。排查扫描器无产出的原因时,需检查no_recording。error_reason - 当前版本仅支持Google/Gemini作为服务商/模型。