Skip to content

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

chore(replay-vision): replace indexer scanner with summarizer facets (#60442)

Tue Haulund553f1ae6977c
diff --git a/products/replay_vision/README.md b/products/replay_vision/README.md
index d3ee0a0b9efa..8502529898dc 100644
--- a/products/replay_vision/README.md
+++ b/products/replay_vision/README.md
@@ -4,7 +4,7 @@ A sub-product of Session Replay. Users configure named **scanners** that PostHog
## Concepts
-**Scanner** — a configured probe scoped to a team. Carries a prompt, a scanner type (`monitor` / `classifier` / `scorer` / `summarizer` / `indexer`), a `RecordingsQuery` that selects matching sessions, and a sampling rate. Each enabled scanner has a Temporal schedule that fires every 5 minutes.
+**Scanner** — a configured probe scoped to a team. Carries a prompt, a scanner type (`monitor` / `classifier` / `scorer` / `summarizer`), a `RecordingsQuery` that selects matching sessions, and a sampling rate. Each enabled scanner has a Temporal schedule that fires every 5 minutes. Summarizers can opt into emitting per-facet embeddings via the `emits_embeddings` config flag.
**Observation** — one application of a scanner to a session. Created in `pending` when triggered (by the scanner's schedule or the `/observe/` action), transitions to `running` while `ApplyScannerWorkflow` executes, and lands in `succeeded` (with content emitted as a `$recording_observed` event) or `failed`. Each observation snapshots the full scanner state (`scanner_snapshot`) that produced it, so subsequent edits to the scanner don't retro-mutate history.
diff --git a/products/replay_vision/backend/api/observations.py b/products/replay_vision/backend/api/observations.py
index 5041131d3ab9..c604990fd0ab 100644
--- a/products/replay_vision/backend/api/observations.py
+++ b/products/replay_vision/backend/api/observations.py
@@ -39,7 +39,7 @@ class ScannerSnapshotSerializer(serializers.Serializer):
)
scanner_type = serializers.ChoiceField(
choices=ScannerType.choices,
- help_text="Scanner type (monitor, classifier, scorer, summarizer, indexer) at run time.",
+ help_text="Scanner type (monitor, classifier, scorer, summarizer) at run time.",
)
scanner_version = serializers.IntegerField(
help_text="The `ReplayScanner.scanner_version` value at the moment the workflow ran.",
diff --git a/products/replay_vision/backend/api/scanners.py b/products/replay_vision/backend/api/scanners.py
index fc266117fde6..6069438fcdba 100644
--- a/products/replay_vision/backend/api/scanners.py
+++ b/products/replay_vision/backend/api/scanners.py
@@ -63,12 +63,12 @@ class ReplayScannerSerializer(serializers.ModelSerializer):
)
scanner_type = serializers.ChoiceField(
choices=ScannerType.choices,
- help_text="What the scanner does: monitor, classifier, scorer, summarizer, or indexer.",
+ help_text="What the scanner does: monitor, classifier, scorer, or summarizer.",
)
scanner_config = serializers.JSONField(
help_text=(
- "Type-specific configuration. Monitor/classifier/scorer/summarizer require `prompt`; "
- "classifiers add `tags`, scorers add `scale`. Indexer is fixed-task and rejects `prompt`."
+ "Type-specific configuration. All scanner types require `prompt`; classifiers add `tags`, "
+ "scorers add `scale`, summarizers add optional `length` and `emits_embeddings` flag."
),
)
query = extend_schema_field(RecordingsQuery)( # type: ignore[arg-type, type-var]
@@ -225,7 +225,7 @@ class ReplayScannerFilter(django_filters.FilterSet):
scanner_type = django_filters.ChoiceFilter(
field_name="scanner_type",
choices=ScannerType.choices,
- help_text="Filter by scanner type (monitor, classifier, scorer, summarizer, indexer).",
+ help_text="Filter by scanner type (monitor, classifier, scorer, summarizer).",
)
emits_signals = django_filters.BooleanFilter(
field_name="emits_signals",
diff --git a/products/replay_vision/backend/migrations/0008_drop_indexer.py b/products/replay_vision/backend/migrations/0008_drop_indexer.py
new file mode 100644
index 000000000000..02f40a1b8c85
--- /dev/null
+++ b/products/replay_vision/backend/migrations/0008_drop_indexer.py
@@ -0,0 +1,16 @@
+from django.db import migrations
+
+
+def delete_indexer_scanners(apps, schema_editor):
+ ReplayScanner = apps.get_model("replay_vision", "ReplayScanner")
+ ReplayScanner.objects.filter(scanner_type="indexer").delete()
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("replay_vision", "0007_add_ineligible_status"),
+ ]
+
+ operations = [
+ migrations.RunPython(delete_indexer_scanners, reverse_code=migrations.RunPython.noop),
+ ]
diff --git a/products/replay_vision/backend/migrations/0009_drop_indexer_choice.py b/products/replay_vision/backend/migrations/0009_drop_indexer_choice.py
new file mode 100644
index 000000000000..973febecf88b
--- /dev/null
+++ b/products/replay_vision/backend/migrations/0009_drop_indexer_choice.py
@@ -0,0 +1,23 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("replay_vision", "0008_drop_indexer"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="replayscanner",
+ name="scanner_type",
+ field=models.CharField(
+ choices=[
+ ("monitor", "Monitor"),
+ ("classifier", "Classifier"),
+ ("scorer", "Scorer"),
+ ("summarizer", "Summarizer"),
+ ],
+ max_length=32,
+ ),
+ ),
+ ]
diff --git a/products/replay_vision/backend/migrations/max_migration.txt b/products/replay_vision/backend/migrations/max_migration.txt
index e8f4512c4adf..9021edf3c4b8 100644
--- a/products/replay_vision/backend/migrations/max_migration.txt
+++ b/products/replay_vision/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0007_add_ineligible_status
+0009_drop_indexer_choice
diff --git a/products/replay_vision/backend/models/replay_scanner.py b/products/replay_vision/backend/models/replay_scanner.py
index e079371fb28e..8e5d0c1f806c 100644
--- a/products/replay_vision/backend/models/replay_scanner.py
+++ b/products/replay_vision/backend/models/replay_scanner.py
@@ -10,7 +10,6 @@ class ScannerType(models.TextChoices):
CLASSIFIER = "classifier", "Classifier"
SCORER = "scorer", "Scorer"
SUMMARIZER = "summarizer", "Summarizer"
- INDEXER = "indexer", "Indexer"
class ScannerProvider(models.TextChoices):
diff --git a/products/replay_vision/backend/temporal/__init__.py b/products/replay_vision/backend/temporal/__init__.py
index 91b5cc6c7300..9db55c49ef02 100644
--- a/products/replay_vision/backend/temporal/__init__.py
+++ b/products/replay_vision/backend/temporal/__init__.py
@@ -5,7 +5,7 @@ from products.replay_vision.backend.temporal.activities import (
call_scanner_provider_activity,
cleanup_gemini_file_activity,
create_observation_activity,
- embed_indexer_observation_activity,
+ embed_summarizer_observation_activity,
emit_classifier_tags_activity,
emit_observation_event_activity,
ensure_session_asset_activity,
@@ -29,7 +29,7 @@ ACTIVITIES: list[Callable[..., Any]] = [
ensure_session_asset_activity,
upload_video_to_gemini_activity,
call_scanner_provider_activity,
- embed_indexer_observation_activity,
+ embed_summarizer_observation_activity,
emit_classifier_tags_activity,
emit_observation_event_activity,
cleanup_gemini_file_activity,
@@ -42,7 +42,7 @@ __all__ = [
"call_scanner_provider_activity",
"cleanup_gemini_file_activity",
"create_observation_activity",
- "embed_indexer_observation_activity",
+ "embed_summarizer_observation_activity",
"emit_classifier_tags_activity",
"emit_observation_event_activity",
"ensure_session_asset_activity",
diff --git a/products/replay_vision/backend/temporal/activities/__init__.py b/products/replay_vision/backend/temporal/activities/__init__.py
index 3c0bde697347..b597bd5693ae 100644
--- a/products/replay_vision/backend/temporal/activities/__init__.py
+++ b/products/replay_vision/backend/temporal/activities/__init__.py
@@ -1,8 +1,8 @@
from products.replay_vision.backend.temporal.activities.call_scanner_provider import call_scanner_provider_activity
from products.replay_vision.backend.temporal.activities.cleanup_gemini_file import cleanup_gemini_file_activity
from products.replay_vision.backend.temporal.activities.create_observation import create_observation_activity
-from products.replay_vision.backend.temporal.activities.embed_indexer_observation import (
- embed_indexer_observation_activity,
+from products.replay_vision.backend.temporal.activities.embed_summarizer_observation import (
+ embed_summarizer_observation_activity,
)
from products.replay_vision.backend.temporal.activities.emit_classifier_tags import emit_classifier_tags_activity
from products.replay_vision.backend.temporal.activities.emit_observation_event import emit_observation_event_activity
@@ -20,7 +20,7 @@ __all__ = [
"call_scanner_provider_activity",
"cleanup_gemini_file_activity",
"create_observation_activity",
- "embed_indexer_observation_activity",
+ "embed_summarizer_observation_activity",
"emit_classifier_tags_activity",
"emit_observation_event_activity",
"ensure_session_asset_activity",
diff --git a/products/replay_vision/backend/temporal/activities/create_observation.py b/products/replay_vision/backend/temporal/activities/create_observation.py
index 35cf36dffd91..1e0b1ce19ef7 100644
--- a/products/replay_vision/backend/temporal/activities/create_observation.py
+++ b/products/replay_vision/backend/temporal/activities/create_observation.py
@@ -19,6 +19,10 @@ from products.replay_vision.backend.temporal.types import (
)
+def _emits_embeddings(scanner_config: dict) -> bool:
+ return bool(scanner_config.get("emits_embeddings", False))
+
+
def _build_scanner_snapshot(scanner: ReplayScanner) -> dict[str, Any]:
return ScannerSnapshot(
name=scanner.name,
@@ -90,10 +94,12 @@ def create_observation_activity(inputs: CreateObservationInputs) -> CreateObserv
observation_id=existing.id,
was_created=False,
scanner_type=existing_snapshot.scanner_type,
+ emits_embeddings=_emits_embeddings(existing_snapshot.scanner_config),
)
return CreateObservationOutput(
observation_id=observation.id,
was_created=True,
scanner_type=scanner.scanner_type,
+ emits_embeddings=_emits_embeddings(scanner.scanner_config),
)
diff --git a/products/replay_vision/backend/temporal/activities/embed_indexer_observation.py b/products/replay_vision/backend/temporal/activities/embed_summarizer_observation.py
similarity index 75%
rename from products/replay_vision/backend/temporal/activities/embed_indexer_observation.py
rename to products/replay_vision/backend/temporal/activities/embed_summarizer_observation.py
index b85a3aa13700..54c280687221 100644
--- a/products/replay_vision/backend/temporal/activities/embed_indexer_observation.py
+++ b/products/replay_vision/backend/temporal/activities/embed_summarizer_observation.py
@@ -1,6 +1,6 @@
-"""Side-effect: emit per-facet embedding requests for an indexer observation.
+"""Side-effect: emit per-facet embedding requests for a summarizer observation.
-Fires four `emit_embedding_request` calls — one each for `intent`, `outcome`, `friction_points`, `keywords` —
+Fires `emit_embedding_request` calls — one each for `intent`, `outcome`, `friction_points`, `keywords` —
under different `rendering` values so they coexist as separate rows in `document_embeddings`. Empty facets
(e.g. no friction_points) are skipped. Any failure surfaces to the workflow and fails the observation.
"""
@@ -17,11 +17,11 @@ from posthog.kafka_client.routing import producer_scope
from posthog.kafka_client.topics import KAFKA_DOCUMENT_EMBEDDINGS_INPUT_TOPIC
from products.replay_vision.backend.temporal.decorators import track_activity
-from products.replay_vision.backend.temporal.types import EmbedIndexerObservationInputs
+from products.replay_vision.backend.temporal.types import EmbedSummarizerObservationInputs
logger = structlog.get_logger(__name__)
-INDEXER_EMBEDDING_MODEL = EmbeddingModelName.TEXT_EMBEDDING_3_LARGE_3072
+SUMMARIZER_EMBEDDING_MODEL = EmbeddingModelName.TEXT_EMBEDDING_3_LARGE_3072
_PRODUCT = "replay-vision"
_DOCUMENT_TYPE = "replay-observation"
# Bounded so broker errors surface as activity failures instead of getting lost in the producer buffer.
@@ -30,9 +30,9 @@ _KAFKA_DELIVERY_TIMEOUT_S = 10.0
@activity.defn
@track_activity()
-async def embed_indexer_observation_activity(inputs: EmbedIndexerObservationInputs) -> None:
- """One embedding per non-empty indexer facet (intent / outcome / friction_points / keywords)."""
- out = inputs.indexer_output
+async def embed_summarizer_observation_activity(inputs: EmbedSummarizerObservationInputs) -> None:
+ """One embedding per non-empty summarizer facet (intent / outcome / friction_points / keywords)."""
+ out = inputs.summarizer_output
facets: list[tuple[str, str]] = [
("intent", out.intent),
("outcome", out.outcome),
@@ -58,14 +58,14 @@ async def embed_indexer_observation_activity(inputs: EmbedIndexerObservationInpu
document_type=_DOCUMENT_TYPE,
rendering=rendering,
document_id=str(inputs.observation_id),
- models=[INDEXER_EMBEDDING_MODEL.value],
+ models=[SUMMARIZER_EMBEDDING_MODEL.value],
metadata=metadata,
)
results.append((rendering, result))
for rendering, result in results:
result.get(timeout=0)
logger.debug(
- "replay_vision.embed_indexer.facet_emitted",
+ "replay_vision.embed_summarizer.facet_emitted",
session_id=inputs.session_id,
observation_id=str(inputs.observation_id),
rendering=rendering,
@@ -74,4 +74,4 @@ async def embed_indexer_observation_activity(inputs: EmbedIndexerObservationInpu
await sync_to_async(emit_all, thread_sensitive=False)()
-__all__ = ["embed_indexer_observation_activity"]
+__all__ = ["embed_summarizer_observation_activity"]
diff --git a/products/replay_vision/backend/temporal/scanners/__init__.py b/products/replay_vision/backend/temporal/scanners/__init__.py
index 071eaf5c0c7a..af0fab74df78 100644
--- a/products/replay_vision/backend/temporal/scanners/__init__.py
+++ b/products/replay_vision/backend/temporal/scanners/__init__.py
@@ -8,7 +8,6 @@ from temporalio.exceptions import ApplicationError
from products.replay_vision.backend.models.replay_scanner import ReplayScanner, ScannerType
from products.replay_vision.backend.temporal.scanners.base import BaseScanner, BaseScannerOutput
from products.replay_vision.backend.temporal.scanners.classifier import ClassifierOutput, ClassifierScanner
-from products.replay_vision.backend.temporal.scanners.indexer import IndexerLlmResponse, IndexerOutput, IndexerScanner
from products.replay_vision.backend.temporal.scanners.monitor import MonitorLlmResponse, MonitorOutput, MonitorScanner
from products.replay_vision.backend.temporal.scanners.scorer import ScorerOutput, ScorerScanner, ScoreScale
from products.replay_vision.backend.temporal.scanners.summarizer import (
@@ -19,7 +18,7 @@ from products.replay_vision.backend.temporal.scanners.summarizer import (
from products.replay_vision.backend.temporal.types import AnyScannerOutput, ScannerSnapshot
AnyScanner = Annotated[
- ClassifierScanner | IndexerScanner | MonitorScanner | ScorerScanner | SummarizerScanner,
+ ClassifierScanner | MonitorScanner | ScorerScanner | SummarizerScanner,
Field(discriminator="scanner_type"),
]
_SCANNER_ADAPTER: TypeAdapter[AnyScanner] = TypeAdapter(AnyScanner)
@@ -73,9 +72,6 @@ __all__ = [
"BaseScannerOutput",
"ClassifierScanner",
"ClassifierOutput",
- "IndexerScanner",
- "IndexerLlmResponse",
- "IndexerOutput",
"MonitorScanner",
"MonitorLlmResponse",
"MonitorOutput",
diff --git a/products/replay_vision/backend/temporal/scanners/base.py b/products/replay_vision/backend/temporal/scanners/base.py
index b79051d247b4..a354826a139c 100644
--- a/products/replay_vision/backend/temporal/scanners/base.py
+++ b/products/replay_vision/backend/temporal/scanners/base.py
@@ -27,6 +27,7 @@ class BaseScannerOutput(BaseModel, frozen=True):
class BaseScanner(BaseModel, frozen=True):
"""Common shape for every concrete scanner; subclasses bind `scanner_type`, `prompt_template`, and `llm_response_schema`."""
+ prompt: str
emits_signals: bool = False
# Per-scanner-type Jinja2 template under `prompts/`. Subclasses set this.
@@ -69,8 +70,7 @@ class BaseScanner(BaseModel, frozen=True):
return render_prompt(
self.prompt_template,
team_name=team_name,
- # `prompt` lives on the four scanners that accept it; the indexer doesn't declare one.
- user_prompt=getattr(self, "prompt", None),
+ user_prompt=self.prompt,
events=events,
url_mapping=url_mapping or {},
window_mapping=window_mapping or {},
diff --git a/products/replay_vision/backend/temporal/scanners/classifier.py b/products/replay_vision/backend/temporal/scanners/classifier.py
index 3c3cf1605607..403975dcd2be 100644
--- a/products/replay_vision/backend/temporal/scanners/classifier.py
+++ b/products/replay_vision/backend/temporal/scanners/classifier.py
@@ -40,7 +40,6 @@ class ClassifierOutput(BaseScannerOutput, frozen=True):
class ClassifierScanner(BaseScanner, frozen=True):
scanner_type: Literal[ScannerType.CLASSIFIER] = ScannerType.CLASSIFIER
- prompt: str
prompt_template: ClassVar[str] = "classifier.jinja"
citation_fields: ClassVar[tuple[str, ...]] = ("reasoning",)
output_cls: ClassVar[type[BaseScannerOutput]] = ClassifierOutput
diff --git a/products/replay_vision/backend/temporal/scanners/indexer.py b/products/replay_vision/backend/temporal/scanners/indexer.py
deleted file mode 100644
index 3463be03a9cc..000000000000
--- a/products/replay_vision/backend/temporal/scanners/indexer.py
+++ /dev/null
@@ -1,69 +0,0 @@
-"""Indexer scanner: produces semantic facets for free-text search via embeddings."""
-
-from typing import ClassVar, Literal
-
-from pydantic import BaseModel, Field, field_validator
-
-from products.replay_vision.backend.models.replay_scanner import ScannerType
-from products.replay_vision.backend.temporal.scanners.base import BaseScanner, BaseScannerOutput
-
-
-class IndexerLlmResponse(BaseScannerOutput, frozen=True):
- """LLM-facing schema: the model decides these fields; `scanner_type` is stamped by the workflow in `finalize`."""
-
- intent: str = Field(
- description=(
- "One sentence describing what the user was trying to accomplish at the start of the session "
- "(their goal), regardless of whether they succeeded."
- )
- )
- summary: str = Field(
- description=(
- "One or two sentences describing the overall arc — what the user actually did and how the session progressed."
- )
- )
- outcome: str = Field(
- description=(
- "One sentence describing the final state — where the user ended up and whether they accomplished "
- "their intent. Do not restate the summary."
- )
- )
- friction_points: list[str] = Field(
- default_factory=list,
- description=(
- "Named blockers, errors, or frustrations encountered, lowercase phrases "
- "(e.g. 'login failure', 'buffering during replay', 'empty logs page'). Empty list if friction-free."
- ),
- )
- keywords: list[str] = Field(
- min_length=1,
- description=(
- "5-15 distinctive lowercase keywords for free-text search. Favor concrete action verbs "
- "(clicked, abandoned, retried, submitted) and specific feature names. "
- "Avoid generic terms that apply to most sessions ('user', 'session', 'navigation', 'interaction'); "
- "avoid the team or product brand name."
- ),
- )
-
- @field_validator("keywords", "friction_points", mode="after")
- @classmethod
- def _lowercase(cls, value: list[str]) -> list[str]:
- # Lowercase so embedding similarity isn't fragmented by mixed casing.
- return [v.lower() for v in value]
-
-
-class IndexerOutput(IndexerLlmResponse, frozen=True):
- """Persisted output: adds the discriminator for the `AnyScannerOutput` union."""
-
- scanner_type: Literal[ScannerType.INDEXER] = ScannerType.INDEXER
-
-
-class IndexerScanner(BaseScanner, frozen=True, extra="forbid"):
- # `extra='forbid'` surfaces stale config (e.g. legacy `prompt`) instead of ignoring it.
- scanner_type: Literal[ScannerType.INDEXER] = ScannerType.INDEXER
- prompt_template: ClassVar[str] = "indexer.jinja"
- output_cls: ClassVar[type[BaseScannerOutput]] = IndexerOutput
-
- @property
- def llm_response_schema(self) -> type[BaseModel]:
- return IndexerLlmResponse
diff --git a/products/replay_vision/backend/temporal/scanners/monitor.py b/products/replay_vision/backend/temporal/scanners/monitor.py
index 74b620325285..dc1847e66305 100644
--- a/products/replay_vision/backend/temporal/scanners/monitor.py
+++ b/products/replay_vision/backend/temporal/scanners/monitor.py
@@ -25,7 +25,6 @@ class MonitorOutput(MonitorLlmResponse, frozen=True):
class MonitorScanner(BaseScanner, frozen=True):
scanner_type: Literal[ScannerType.MONITOR] = ScannerType.MONITOR
- prompt: str
prompt_template: ClassVar[str] = "monitor.jinja"
citation_fields: ClassVar[tuple[str, ...]] = ("reasoning",)
output_cls: ClassVar[type[BaseScannerOutput]] = MonitorOutput
diff --git a/products/replay_vision/backend/temporal/scanners/prompts/indexer.jinja b/products/replay_vision/backend/temporal/scanners/prompts/indexer.jinja
deleted file mode 100644
index 3052e5a02bd7..000000000000
--- a/products/replay_vision/backend/temporal/scanners/prompts/indexer.jinja
+++ /dev/null
@@ -1,10 +0,0 @@
-{% extends "base.jinja" %}
-{% block task %}Produce facets that characterize this session for free-text search by future users.
-
-- `intent`: one sentence about what the user set out to do (their goal).
-- `summary`: 1-2 sentences on the overall arc.
-- `outcome`: one sentence on the final state — do not restate the summary.
-- `friction_points`: list of named blockers, errors, or frustrations the user hit (empty if none). Only include things the user would notice — visible error states, dead clicks, rage clicks, abandoned actions, page reloads. Background JS console errors that don't affect the UI (ResizeObserver loops, feature-flag fetch failures, third-party script noise) are not friction.
-- `keywords`: 5-15 distinctive lowercase terms — favor action verbs and specific feature names; skip generic terms ('user', 'session', 'navigation') and the product/team name.
-
-Do not include any event citations or `event_id` hashes anywhere — this output is consumed by a vector-embedding pipeline and hex tokens would be noise.{% endblock %}
diff --git a/products/replay_vision/backend/temporal/scanners/prompts/summarizer.jinja b/products/replay_vision/backend/temporal/scanners/prompts/summarizer.jinja
index 418952ad8e01..80bc65cdd08d 100644
--- a/products/replay_vision/backend/temporal/scanners/prompts/summarizer.jinja
+++ b/products/replay_vision/backend/temporal/scanners/prompts/summarizer.jinja
@@ -4,4 +4,15 @@
`title` is at most ~80 characters and contains no event citations. `summary` should be {{ length_guidance }}.
-{{ cite_in('summary') }}{% endblock %}
+{{ cite_in('summary') }}
+{% if emits_embeddings %}
+
+Also produce facets that characterize this session for free-text search by future users:
+
+- `intent`: one sentence about what the user set out to do (their goal).
+- `outcome`: one sentence on the final state — do not restate the summary.
+- `friction_points`: list of named blockers, errors, or frustrations the user hit (empty if none). Only include things the user would notice — visible error states, dead clicks, rage clicks, abandoned actions, page reloads. Background JS console errors that don't affect the UI (ResizeObserver loops, feature-flag fetch failures, third-party script noise) are not friction.
+- `keywords`: 5-15 distinctive lowercase terms — favor action verbs and specific feature names; skip generic terms ('user', 'session', 'navigation') and the product/team name.
+
+Do not include any event citations or `event_id` hashes inside `intent`, `outcome`, `friction_points`, or `keywords` — those are consumed by a vector-embedding pipeline and hex tokens would be noise.
+{% endif %}{% endblock %}
diff --git a/products/replay_vision/backend/temporal/scanners/scorer.py b/products/replay_vision/backend/temporal/scanners/scorer.py
index 674b46e92441..5f7e0aaaea1e 100644
--- a/products/replay_vision/backend/temporal/scanners/scorer.py
+++ b/products/replay_vision/backend/temporal/scanners/scorer.py
@@ -31,7 +31,6 @@ class ScorerOutput(BaseScannerOutput, frozen=True):
class ScorerScanner(BaseScanner, frozen=True):
scanner_type: Literal[ScannerType.SCORER] = ScannerType.SCORER
- prompt: str
prompt_template: ClassVar[str] = "scorer.jinja"
citation_fields: ClassVar[tuple[str, ...]] = ("reasoning",)
output_cls: ClassVar[type[BaseScannerOutput]] = ScorerOutput
diff --git a/products/replay_vision/backend/temporal/scanners/summarizer.py b/products/replay_vision/backend/temporal/scanners/summarizer.py
index 2ac1e4f0ae35..b3b52a311a74 100644
--- a/products/replay_vision/backend/temporal/scanners/summarizer.py
+++ b/products/replay_vision/backend/temporal/scanners/summarizer.py
@@ -1,8 +1,8 @@
-"""Summarizer scanner: produces a title and a text summary."""
+"""Summarizer scanner: produces a title and a text summary, optionally with facet embeddings."""
from typing import Any, ClassVar, Literal
-from pydantic import BaseModel, Field
+from pydantic import BaseModel, Field, field_validator
from products.replay_vision.backend.models.replay_scanner import ScannerType
from products.replay_vision.backend.temporal.scanners.base import BaseScanner, BaseScannerOutput
@@ -17,29 +17,77 @@ _LENGTH_GUIDANCE: dict[SummaryLength, str] = {
class SummarizerLlmResponse(BaseScannerOutput, frozen=True):
- """LLM-facing schema: the model decides these fields; `scanner_type` is stamped by the workflow in `finalize`."""
+ """LLM-facing schema (title + summary). Used when `emits_embeddings=False` to keep the schema lean."""
title: str = Field(max_length=120, description="Short title for the session (~80 chars). Plain text, no quotes.")
summary: str = Field(description="Body text whose length follows the scanner's configured length.")
+class SummarizerWithFacetsLlmResponse(SummarizerLlmResponse, frozen=True):
+ """Extended LLM-facing schema with embedding facets. Used when `emits_embeddings=True`."""
+
+ intent: str = Field(
+ description=(
+ "One sentence describing what the user was trying to accomplish at the start of the session "
+ "(their goal), regardless of whether they succeeded."
+ ),
+ )
+ outcome: str = Field(
+ description=(
+ "One sentence describing the final state — where the user ended up and whether they accomplished "
+ "their intent. Do not restate the summary."
+ ),
+ )
+ friction_points: list[str] = Field(
+ description=(
+ "Named blockers, errors, or frustrations encountered, lowercase phrases "
+ "(e.g. 'login failure', 'buffering during replay'). Empty list when friction-free."
+ ),
+ )
+ keywords: list[str] = Field(
+ description=(
+ "5-15 distinctive lowercase keywords for free-text search. Favor concrete action verbs "
+ "(clicked, abandoned, retried, submitted) and specific feature names. "
+ "Avoid generic terms that apply to most sessions ('user', 'session', 'navigation'); "
+ "avoid the team or product brand name."
+ ),
+ )
+
+ @field_validator("keywords", "friction_points", mode="after")
+ @classmethod
+ def _lowercase(cls, value: list[str]) -> list[str]:
+ # Lowercase so embedding similarity isn't fragmented by mixed casing.
+ return [v.lower() for v in value]
+
+
class SummarizerOutput(SummarizerLlmResponse, frozen=True):
- """Persisted output: adds the discriminator for the `AnyScannerOutput` union."""
+ """Persisted output: facet fields default to empty so flag-off summarizers round-trip cleanly."""
scanner_type: Literal[ScannerType.SUMMARIZER] = ScannerType.SUMMARIZER
+ intent: str = ""
+ outcome: str = ""
+ friction_points: list[str] = Field(default_factory=list)
+ keywords: list[str] = Field(default_factory=list)
+
+ def has_any_facet(self) -> bool:
+ """True when the LLM filled at least one facet field; gates the embedding side-effect."""
+ return bool(self.intent or self.outcome or self.friction_points or self.keywords)
class SummarizerScanner(BaseScanner, frozen=True):
scanner_type: Literal[ScannerType.SUMMARIZER] = ScannerType.SUMMARIZER
- prompt: str
prompt_template: ClassVar[str] = "summarizer.jinja"
citation_fields: ClassVar[tuple[str, ...]] = ("summary",)
output_cls: ClassVar[type[BaseScannerOutput]] = SummarizerOutput
length: SummaryLength = "medium"
+ emits_embeddings: bool = False
@property
def llm_response_schema(self) -> type[BaseModel]:
- return SummarizerLlmResponse
+ return SummarizerWithFacetsLlmResponse if self.emits_embeddings else SummarizerLlmResponse
def prompt_context(self) -> dict[str, Any]:
- return {"length_guidance": _LENGTH_GUIDANCE[self.length]}
+ return {
+ "length_guidance": _LENGTH_GUIDANCE[self.length],
+ "emits_embeddings": self.emits_embeddings,
+ }
diff --git a/products/replay_vision/backend/temporal/types.py b/products/replay_vision/backend/temporal/types.py
index 7f844a587ddd..25f6aae0fb2a 100644
--- a/products/replay_vision/backend/temporal/types.py
+++ b/products/replay_vision/backend/temporal/types.py
@@ -9,13 +9,12 @@ from products.replay_vision.backend.models.replay_observation import Observation
from products.replay_vision.backend.models.replay_scanner import ScannerModel, ScannerProvider, ScannerType
from products.replay_vision.backend.temporal.constants import MAX_SESSION_ID_LENGTH
from products.replay_vision.backend.temporal.scanners.classifier import ClassifierOutput
-from products.replay_vision.backend.temporal.scanners.indexer import IndexerOutput
from products.replay_vision.backend.temporal.scanners.monitor import MonitorOutput
from products.replay_vision.backend.temporal.scanners.scorer import ScorerOutput
from products.replay_vision.backend.temporal.scanners.summarizer import SummarizerOutput
AnyScannerOutput = Annotated[
- ClassifierOutput | IndexerOutput | MonitorOutput | ScorerOutput | SummarizerOutput,
+ ClassifierOutput | MonitorOutput | ScorerOutput | SummarizerOutput,
Field(discriminator="scanner_type"),
]
@@ -83,6 +82,7 @@ class CreateObservationOutput(BaseModel, frozen=True):
observation_id: UUID | None
was_created: bool
scanner_type: ScannerType
+ emits_embeddings: bool = False
class MarkObservationRunningInputs(BaseModel, frozen=True):
@@ -208,13 +208,13 @@ class CleanupGeminiFileInputs(BaseModel, frozen=True):
gemini_file_name: str
-class EmbedIndexerObservationInputs(BaseModel, frozen=True):
- """Input to the indexer-side-effect activity that emits per-facet embedding requests."""
+class EmbedSummarizerObservationInputs(BaseModel, frozen=True):
+ """Input to the summarizer-side-effect activity that emits per-facet embedding requests."""
team_id: int
session_id: str
observation_id: UUID
- indexer_output: IndexerOutput
+ summarizer_output: SummarizerOutput
class EmitClassifierTagsInputs(BaseModel, frozen=True):
diff --git a/products/replay_vision/backend/temporal/workflow.py b/products/replay_vision/backend/temporal/workflow.py
index b99e5d34b8fc..df67f8dde205 100644
--- a/products/replay_vision/backend/temporal/workflow.py
+++ b/products/replay_vision/backend/temporal/workflow.py
@@ -19,7 +19,7 @@ from products.replay_vision.backend.temporal.activities import (
call_scanner_provider_activity,
cleanup_gemini_file_activity,
create_observation_activity,
- embed_indexer_observation_activity,
+ embed_summarizer_observation_activity,
emit_classifier_tags_activity,
emit_observation_event_activity,
ensure_session_asset_activity,
@@ -38,14 +38,14 @@ from products.replay_vision.backend.temporal.errors import (
ScannerFailureError,
)
from products.replay_vision.backend.temporal.scanners.classifier import ClassifierOutput
-from products.replay_vision.backend.temporal.scanners.indexer import IndexerOutput
+from products.replay_vision.backend.temporal.scanners.summarizer import SummarizerOutput
from products.replay_vision.backend.temporal.types import (
ApplyScannerInputs,
CallScannerProviderInputs,
CleanupGeminiFileInputs,
CreateObservationInputs,
CreateObservationOutput,
- EmbedIndexerObservationInputs,
+ EmbedSummarizerObservationInputs,
EmitClassifierTagsInputs,
EmitObservationEventInputs,
EnsureSessionAssetInputs,
@@ -186,7 +186,9 @@ class ApplyScannerWorkflow(PostHogWorkflow):
start_to_close_timeout=dt.timedelta(minutes=5),
retry_policy=_PROVIDER_CALL_RETRY,
)
- await self._apply_scanner_side_effects(inputs, observation_id, call_output.model_output)
+ await self._apply_scanner_side_effects(
+ inputs, observation_id, call_output.model_output, create_result.emits_embeddings
+ )
await wf.execute_activity(
emit_observation_event_activity,
EmitObservationEventInputs(observation_id=observation_id, model_output=call_output.model_output),
@@ -296,17 +298,21 @@ class ApplyScannerWorkflow(PostHogWorkflow):
)
async def _apply_scanner_side_effects(
- self, inputs: ApplyScannerInputs, observation_id: UUID, model_output: object
+ self,
+ inputs: ApplyScannerInputs,
+ observation_id: UUID,
+ model_output: object,
+ emits_embeddings: bool,
) -> None:
"""Dispatch scanner-type-specific side-effects after the LLM call; failure aborts the workflow."""
- if isinstance(model_output, IndexerOutput):
+ if isinstance(model_output, SummarizerOutput) and emits_embeddings and model_output.has_any_facet():
await wf.execute_activity(
- embed_indexer_observation_activity,
- EmbedIndexerObservationInputs(
+ embed_summarizer_observation_activity,
+ EmbedSummarizerObservationInputs(
team_id=inputs.team_id,
session_id=inputs.session_id,
observation_id=observation_id,
- indexer_output=model_output,
+ summarizer_output=model_output,
),
start_to_close_timeout=dt.timedelta(seconds=30),
retry_policy=_SIDE_EFFECT_RETRY,
diff --git a/products/replay_vision/backend/tests/test_api.py b/products/replay_vision/backend/tests/test_api.py
index 815fcc1b884e..baad4b150880 100644
--- a/products/replay_vision/backend/tests/test_api.py
+++ b/products/replay_vision/backend/tests/test_api.py
@@ -190,7 +190,7 @@ class TestReplayScannerViewSet(_VisionAPITestCase):
("classifier", ScannerType.CLASSIFIER, {"prompt": "p", "tags": ["a", "b"]}),
("scorer", ScannerType.SCORER, {"prompt": "p", "scale": {"min": 0, "max": 10}}),
("summarizer", ScannerType.SUMMARIZER, {"prompt": "p"}),
- ("indexer", ScannerType.INDEXER, {}),
+ ("summarizer-with-embeddings", ScannerType.SUMMARIZER, {"prompt": "p", "emits_embeddings": True}),
]
)
def test_create_accepts_valid_scanner_config_per_type(
diff --git a/products/replay_vision/backend/tests/test_scanners.py b/products/replay_vision/backend/tests/test_scanners.py
index 716f3443e4cb..b97b06f55f1c 100644
--- a/products/replay_vision/backend/tests/test_scanners.py
+++ b/products/replay_vision/backend/tests/test_scanners.py
@@ -7,17 +7,17 @@ from products.replay_vision.backend.models.replay_scanner import ReplayScanner,
from products.replay_vision.backend.temporal.scanners import (
ClassifierOutput,
ClassifierScanner,
- IndexerOutput,
- IndexerScanner,
MonitorLlmResponse,
MonitorOutput,
MonitorScanner,
ScorerOutput,
ScorerScanner,
+ SummarizerLlmResponse,
SummarizerOutput,
SummarizerScanner,
scanner_from_db,
)
+from products.replay_vision.backend.temporal.scanners.summarizer import SummarizerWithFacetsLlmResponse
from products.replay_vision.backend.temporal.types import EventTable
@@ -492,49 +492,90 @@ class TestSummarizerScanner:
assert round_tripped == out
-class TestIndexerScanner:
- def test_scanner_from_db_picks_indexer_subclass(self) -> None:
- scanner = scanner_from_db(_build_replay_scanner(scanner_type=ScannerType.INDEXER, scanner_config={}))
- assert isinstance(scanner, IndexerScanner)
+class TestSummarizerScannerFacets:
+ def test_emits_embeddings_defaults_to_false(self) -> None:
+ scanner = scanner_from_db(
+ _build_replay_scanner(scanner_type=ScannerType.SUMMARIZER, scanner_config={"prompt": "p"})
+ )
+ assert isinstance(scanner, SummarizerScanner)
+ assert scanner.emits_embeddings is False
- def test_scanner_from_db_rejects_prompt_on_indexer(self) -> None:
- with pytest.raises(ApplicationError, match="prompt"):
- scanner_from_db(_build_replay_scanner(scanner_type=ScannerType.INDEXER, scanner_config={"prompt": "x"}))
-
- def test_output_round_trip_includes_all_facets(self) -> None:
- out = IndexerOutput(
- intent="File a regression report",
- summary="Bug report",
- outcome="Submitted ticket",
- friction_points=["upload failure"],
- keywords=["bug", "regression", "ticket"],
- confidence=0.8,
- )
- round_tripped = IndexerOutput.model_validate_json(out.model_dump_json())
+ def test_emits_embeddings_propagates_into_prompt_context(self) -> None:
+ scanner = scanner_from_db(
+ _build_replay_scanner(
+ scanner_type=ScannerType.SUMMARIZER,
+ scanner_config={"prompt": "p", "emits_embeddings": True},
+ )
+ )
+ assert scanner.prompt_context()["emits_embeddings"] is True
+
+ def test_output_round_trip_carries_facets(self) -> None:
+ out = SummarizerOutput(
+ title="Onboarding",
+ summary="Walked through demo",
+ intent="Try the demo",
+ outcome="Finished",
+ friction_points=["empty state"],
+ keywords=["demo", "onboarding", "walkthrough"],
+ confidence=0.9,
+ )
+ round_tripped = SummarizerOutput.model_validate_json(out.model_dump_json())
assert round_tripped == out
- def test_output_rejects_empty_keywords(self) -> None:
- with pytest.raises(ValidationError):
- IndexerOutput(intent="x", summary="x", outcome="x", keywords=[], confidence=0.8)
+ def test_facets_default_to_empty(self) -> None:
+ out = SummarizerOutput(title="t", summary="s", confidence=0.9)
+ assert out.intent == ""
+ assert out.outcome == ""
+ assert out.friction_points == []
+ assert out.keywords == []
- def test_finalize_lowercases_keywords_and_friction_points(self) -> None:
- scanner = scanner_from_db(_build_replay_scanner(scanner_type=ScannerType.INDEXER, scanner_config={}))
- from products.replay_vision.backend.temporal.scanners import IndexerLlmResponse
+ def test_llm_response_schema_branches_on_flag(self) -> None:
+ without_facets = scanner_from_db(
+ _build_replay_scanner(scanner_type=ScannerType.SUMMARIZER, scanner_config={"prompt": "p"})
+ )
+ with_facets = scanner_from_db(
+ _build_replay_scanner(
+ scanner_type=ScannerType.SUMMARIZER,
+ scanner_config={"prompt": "p", "emits_embeddings": True},
+ )
+ )
+ assert without_facets.llm_response_schema is SummarizerLlmResponse
+ assert with_facets.llm_response_schema is SummarizerWithFacetsLlmResponse
- response = IndexerLlmResponse(
- intent="Authenticate",
+ def test_finalize_lowercases_keywords_and_friction_points(self) -> None:
+ scanner = scanner_from_db(
+ _build_replay_scanner(
+ scanner_type=ScannerType.SUMMARIZER,
+ scanner_config={"prompt": "p", "emits_embeddings": True},
+ )
+ )
+ response = SummarizerWithFacetsLlmResponse(
+ title="Auth",
summary="Tried to log in",
+ intent="Authenticate",
outcome="Reached reset page",
friction_points=["Invalid Password Error", "Buffering Page"],
keywords=["Login", "Failed Attempt", "Reset"],
confidence=0.9,
)
finalized = scanner.finalize(response)
- assert isinstance(finalized, IndexerOutput)
+ assert isinstance(finalized, SummarizerOutput)
assert finalized.friction_points == ["invalid password error", "buffering page"]
assert finalized.keywords == ["login", "failed attempt", "reset"]
+class TestSummarizerOutputHasAnyFacet:
+ def test_returns_false_when_all_facets_empty(self) -> None:
+ out = SummarizerOutput(title="t", summary="s", confidence=0.9)
+ assert out.has_any_facet() is False
+
+ def test_returns_true_when_any_facet_filled(self) -> None:
+ assert SummarizerOutput(title="t", summary="s", intent="i", confidence=0.9).has_any_facet() is True
+ assert SummarizerOutput(title="t", summary="s", outcome="o", confidence=0.9).has_any_facet() is True
+ assert SummarizerOutput(title="t", summary="s", friction_points=["x"], confidence=0.9).has_any_facet() is True
+ assert SummarizerOutput(title="t", summary="s", keywords=["x"], confidence=0.9).has_any_facet() is True
+
+
class TestToEventProperties:
def test_flattens_with_scanner_output_prefix(self) -> None:
out = MonitorOutput(verdict=True, reasoning="found it", confidence=0.9)
diff --git a/products/replay_vision/backend/tests/test_temporal.py b/products/replay_vision/backend/tests/test_temporal.py
index f149a2590e7a..2845973584e5 100644
--- a/products/replay_vision/backend/tests/test_temporal.py
+++ b/products/replay_vision/backend/tests/test_temporal.py
@@ -32,8 +32,8 @@ from products.replay_vision.backend.temporal import ApplyScannerWorkflow
from products.replay_vision.backend.temporal.activities.call_scanner_provider import call_scanner_provider_activity
from products.replay_vision.backend.temporal.activities.cleanup_gemini_file import cleanup_gemini_file_activity
from products.replay_vision.backend.temporal.activities.create_observation import create_observation_activity
-from products.replay_vision.backend.temporal.activities.embed_indexer_observation import (
- embed_indexer_observation_activity,
+from products.replay_vision.backend.temporal.activities.embed_summarizer_observation import (
+ embed_summarizer_observation_activity,
)
from products.replay_vision.backend.temporal.activities.emit_classifier_tags import emit_classifier_tags_activity
from products.replay_vision.backend.temporal.activities.emit_observation_event import emit_observation_event_activity
@@ -55,8 +55,8 @@ from products.replay_vision.backend.temporal.errors import (
ScannerFailureError,
)
from products.replay_vision.backend.temporal.scanners.classifier import ClassifierOutput
-from products.replay_vision.backend.temporal.scanners.indexer import IndexerOutput
from products.replay_vision.backend.temporal.scanners.monitor import MonitorOutput
+from products.replay_vision.backend.temporal.scanners.summarizer import SummarizerOutput
from products.replay_vision.backend.temporal.state import (
StateActivitiesEnum,
generate_state_key,
@@ -67,7 +67,7 @@ from products.replay_vision.backend.temporal.types import (
ApplyScannerInputs,
CreateObservationInputs,
CreateObservationOutput,
- EmbedIndexerObservationInputs,
+ EmbedSummarizerObservationInputs,
EmitClassifierTagsInputs,
EnsureSessionAssetInputs,
EnsureSessionAssetOutput,
@@ -1423,10 +1423,11 @@ async def test_apply_scanner_workflow_propagates_workflow_id_to_create() -> None
assert create_input.workflow_id == "wf-from-info"
-def _indexer_output() -> IndexerOutput:
- return IndexerOutput(
- intent="Log in to the dashboard",
+def _summarizer_output_with_facets() -> SummarizerOutput:
+ return SummarizerOutput(
+ title="Login attempt",
summary="User tried to authenticate but the form failed twice.",
+ intent="Log in to the dashboard",
outcome="Reached the password reset page after failed attempts.",
friction_points=["invalid password error"],
keywords=["login", "authentication", "reset"],
@@ -1434,6 +1435,10 @@ def _indexer_output() -> IndexerOutput:
)
+def _summarizer_output_without_facets() -> SummarizerOutput:
+ return SummarizerOutput(title="Onboarding", summary="User walked through the demo.", confidence=0.9)
+
+
def _classifier_output() -> ClassifierOutput:
return ClassifierOutput(
tags=["support"],
@@ -1444,22 +1449,23 @@ def _classifier_output() -> ClassifierOutput:
@pytest.mark.asyncio
-async def test_embed_indexer_observation_emits_one_request_per_nonempty_facet() -> None:
- out = IndexerOutput(
- intent="Investigate slow query response",
+async def test_embed_summarizer_observation_emits_one_request_per_nonempty_facet() -> None:
+ out = SummarizerOutput(
+ title="Investigation",
summary="User browsed dashboards and clicked through several insights.",
+ intent="Investigate slow query response",
outcome="No issue reproduced — user closed the tab.",
friction_points=[],
keywords=["dashboard", "insight"],
confidence=0.8,
)
- inputs = EmbedIndexerObservationInputs(
- team_id=99, session_id="sess-abc", observation_id=uuid.uuid4(), indexer_output=out
+ inputs = EmbedSummarizerObservationInputs(
+ team_id=99, session_id="sess-abc", observation_id=uuid.uuid4(), summarizer_output=out
)
with patch(
- "products.replay_vision.backend.temporal.activities.embed_indexer_observation.emit_embedding_request"
+ "products.replay_vision.backend.temporal.activities.embed_summarizer_observation.emit_embedding_request"
) as mock_emit:
- await embed_indexer_observation_activity(inputs)
+ await embed_summarizer_observation_activity(inputs)
renderings = [call.kwargs["rendering"] for call in mock_emit.call_args_list]
assert renderings == ["intent", "outcome", "keywords"]
@@ -1476,16 +1482,19 @@ async def test_embed_indexer_observation_emits_one_request_per_nonempty_facet()
@pytest.mark.asyncio
-async def test_embed_indexer_observation_raises_propagates_failure() -> None:
- inputs = EmbedIndexerObservationInputs(
- team_id=99, session_id="sess-x", observation_id=uuid.uuid4(), indexer_output=_indexer_output()
+async def test_embed_summarizer_observation_raises_propagates_failure() -> None:
+ inputs = EmbedSummarizerObservationInputs(
+ team_id=99,
+ session_id="sess-x",
+ observation_id=uuid.uuid4(),
+ summarizer_output=_summarizer_output_with_facets(),
)
with patch(
- "products.replay_vision.backend.temporal.activities.embed_indexer_observation.emit_embedding_request",
+ "products.replay_vision.backend.temporal.activities.embed_summarizer_observation.emit_embedding_request",
side_effect=RuntimeError("kafka down"),
):
with pytest.raises(RuntimeError, match="kafka down"):
- await embed_indexer_observation_activity(inputs)
+ await embed_summarizer_observation_activity(inputs)
@pytest.mark.asyncio
@@ -1537,18 +1546,21 @@ async def test_emit_classifier_tags_raises_when_metadata_missing() -> None:
@pytest.mark.asyncio
-async def test_embed_indexer_observation_raises_when_kafka_delivery_fails() -> None:
- inputs = EmbedIndexerObservationInputs(
- team_id=99, session_id="sess-x", observation_id=uuid.uuid4(), indexer_output=_indexer_output()
+async def test_embed_summarizer_observation_raises_when_kafka_delivery_fails() -> None:
+ inputs = EmbedSummarizerObservationInputs(
+ team_id=99,
+ session_id="sess-x",
+ observation_id=uuid.uuid4(),
+ summarizer_output=_summarizer_output_with_facets(),
)
failed_result = MagicMock()
failed_result.get.side_effect = RuntimeError("broker timeout")
with patch(
- "products.replay_vision.backend.temporal.activities.embed_indexer_observation.emit_embedding_request",
+ "products.replay_vision.backend.temporal.activities.embed_summarizer_observation.emit_embedding_request",
return_value=failed_result,
):
with pytest.raises(RuntimeError, match="broker timeout"):
- await embed_indexer_observation_activity(inputs)
+ await embed_summarizer_observation_activity(inputs)
@pytest.mark.asyncio
@@ -1578,13 +1590,16 @@ async def test_emit_classifier_tags_raises_when_kafka_delivery_fails() -> None:
@pytest.mark.asyncio
-async def test_apply_scanner_workflow_dispatches_indexer_side_effect() -> None:
+async def test_apply_scanner_workflow_dispatches_summarizer_embedding_when_flag_and_facets_present() -> None:
new_observation_id = uuid.uuid4()
- model_output = _indexer_output()
+ model_output = _summarizer_output_with_facets()
mocks = _WorkflowMocks(
activity_results={
create_observation_activity: CreateObservationOutput(
- observation_id=new_observation_id, was_created=True, scanner_type=ScannerType.MONITOR
+ observation_id=new_observation_id,
+ was_created=True,
+ scanner_type=ScannerType.SUMMARIZER,
+ emits_embeddings=True,
),
ensure_session_asset_activity: EnsureSessionAssetOutput(asset_id=42),
upload_video_to_gemini_activity: UploadedVideo(
@@ -1594,19 +1609,69 @@ async def test_apply_scanner_workflow_dispatches_indexer_side_effect() -> None:
},
)
- await _run_workflow(_build_inputs(session_id="sess-idx", team_id=99), mocks, workflow_id="wf-idx")
+ await _run_workflow(_build_inputs(session_id="sess-sum", team_id=99), mocks, workflow_id="wf-sum")
activity_order = [fn for fn, _ in mocks.activity_calls]
call_idx = activity_order.index(call_scanner_provider_activity)
- assert activity_order[call_idx + 1] == embed_indexer_observation_activity
+ assert activity_order[call_idx + 1] == embed_summarizer_observation_activity
assert activity_order[call_idx + 2] == emit_observation_event_activity
assert activity_order[call_idx + 3] == mark_observation_succeeded_activity
assert emit_classifier_tags_activity not in activity_order
- embed_input = next(arg for fn, arg in mocks.activity_calls if fn is embed_indexer_observation_activity)
- assert embed_input.session_id == "sess-idx"
+ embed_input = next(arg for fn, arg in mocks.activity_calls if fn is embed_summarizer_observation_activity)
+ assert embed_input.session_id == "sess-sum"
assert embed_input.team_id == 99
- assert embed_input.indexer_output == model_output
+ assert embed_input.summarizer_output == model_output
+
+
+async def test_apply_scanner_workflow_skips_summarizer_embedding_when_flag_off() -> None:
+ new_observation_id = uuid.uuid4()
+ mocks = _WorkflowMocks(
+ activity_results={
+ create_observation_activity: CreateObservationOutput(
+ observation_id=new_observation_id,
+ was_created=True,
+ scanner_type=ScannerType.SUMMARIZER,
+ emits_embeddings=False,
+ ),
+ ensure_session_asset_activity: EnsureSessionAssetOutput(asset_id=42),
+ upload_video_to_gemini_activity: UploadedVideo(
+ file_uri="gemini://files/x", mime_type="video/mp4", gemini_file_name="files/x"
+ ),
+ call_scanner_provider_activity: ScannerCallOutput(model_output=_summarizer_output_with_facets()),
+ },
+ )
+
+ await _run_workflow(_build_inputs(session_id="sess-noemb"), mocks)
+
+ called = {fn for fn, _ in mocks.activity_calls}
+ assert embed_summarizer_observation_activity not in called
+
+
+async def test_apply_scanner_workflow_skips_summarizer_embedding_when_no_facets() -> None:
+ new_observation_id = uuid.uuid4()
+ mocks = _WorkflowMocks(
+ activity_results={
+ create_observation_activity: CreateObservationOutput(
+ observation_id=new_observation_id,
+ was_created=True,
+ scanner_type=ScannerType.SUMMARIZER,
+ emits_embeddings=True,
+ ),
+ ensure_session_asset_activity: EnsureSessionAssetOutput(asset_id=42),
+ upload_video_to_gemini_activity: UploadedVideo(
+ file_uri="gemini://files/x", mime_type="video/mp4", gemini_file_name="files/x"
+ ),
+ call_scanner_provider_activity: ScannerCallOutput(model_output=_summarizer_output_without_facets()),
+ },
+ )
+
+ await _run_workflow(_build_inputs(session_id="sess-nofacets"), mocks)
+
+ called = {fn for fn, _ in mocks.activity_calls}
+ assert embed_summarizer_observation_activity not in called
@pytest.mark.asyncio
@@ -1633,7 +1698,7 @@ async def test_apply_scanner_workflow_dispatches_classifier_side_effect() -> Non
assert activity_order[call_idx + 1] == emit_classifier_tags_activity
assert activity_order[call_idx + 2] == emit_observation_event_activity
assert activity_order[call_idx + 3] == mark_observation_succeeded_activity
- assert embed_indexer_observation_activity not in activity_order
+ assert embed_summarizer_observation_activity not in activity_order
tag_input = next(arg for fn, arg in mocks.activity_calls if fn is emit_classifier_tags_activity)
assert tag_input.classifier_output == model_output
@@ -1659,7 +1724,7 @@ async def test_apply_scanner_workflow_skips_side_effects_for_monitor() -> None:
await _run_workflow(_build_inputs(session_id="sess-mon", team_id=99), mocks, workflow_id="wf-mon")
called = {fn for fn, _ in mocks.activity_calls}
- assert embed_indexer_observation_activity not in called
+ assert embed_summarizer_observation_activity not in called
assert emit_classifier_tags_activity not in called
@@ -1670,19 +1735,22 @@ async def test_apply_scanner_workflow_marks_failed_when_side_effect_raises() ->
mocks = _WorkflowMocks(
activity_results={
create_observation_activity: CreateObservationOutput(
- observation_id=new_observation_id, was_created=True, scanner_type=ScannerType.MONITOR
+ observation_id=new_observation_id,
+ was_created=True,
+ scanner_type=ScannerType.SUMMARIZER,
+ emits_embeddings=True,
),
ensure_session_asset_activity: EnsureSessionAssetOutput(asset_id=42),
upload_video_to_gemini_activity: UploadedVideo(
file_uri="gemini://files/x", mime_type="video/mp4", gemini_file_name="files/x"
),
- call_scanner_provider_activity: ScannerCallOutput(model_output=_indexer_output()),
+ call_scanner_provider_activity: ScannerCallOutput(model_output=_summarizer_output_with_facets()),
},
- activity_errors={embed_indexer_observation_activity: side_effect_error},
+ activity_errors={embed_summarizer_observation_activity: side_effect_error},
)
with pytest.raises(ApplicationError, match="embedding kafka down"):
- await _run_workflow(_build_inputs(session_id="sess-idx-fail"), mocks)
+ await _run_workflow(_build_inputs(session_id="sess-sum-fail"), mocks)
called = [fn for fn, _ in mocks.activity_calls]
assert emit_observation_event_activity not in called
diff --git a/products/replay_vision/frontend/components/ObservationCard.tsx b/products/replay_vision/frontend/components/ObservationCard.tsx
index de4a224da4ef..a6fa6d6ed05a 100644
--- a/products/replay_vision/frontend/components/ObservationCard.tsx
+++ b/products/replay_vision/frontend/components/ObservationCard.tsx
@@ -225,7 +225,7 @@ export function ObservationPrimaryOutput({
)
}
- // Indexer / unknown fallback.
+ // Unknown / generic fallback (also covers summarizers that emit facets alongside title/summary).
const summary = typeof result.summary === 'string' ? result.summary : null
const userType = typeof result.user_type === 'string' ? result.user_type : null
const outcome = typeof result.outcome === 'string' ? result.outcome : null
diff --git a/products/replay_vision/frontend/generated/api.schemas.ts b/products/replay_vision/frontend/generated/api.schemas.ts
index bf332b9786b7..585ee58d7242 100644
--- a/products/replay_vision/frontend/generated/api.schemas.ts
+++ b/products/replay_vision/frontend/generated/api.schemas.ts
@@ -29,7 +29,6 @@ export const ObservationStatusEnumApi = {
* `classifier` - Classifier
* `scorer` - Scorer
* `summarizer` - Summarizer
- * `indexer` - Indexer
*/
export type ScannerTypeEnumApi = (typeof ScannerTypeEnumApi)[keyof typeof ScannerTypeEnumApi]
@@ -38,7 +37,6 @@ export const ScannerTypeEnumApi = {
Classifier: 'classifier',
Scorer: 'scorer',
Summarizer: 'summarizer',
- Indexer: 'indexer',
} as const
/**
@@ -67,13 +65,12 @@ export const ScannerProviderEnumApi = {
export interface ScannerSnapshotApi {
/** Scanner name at run time. */
name: string
- /** Scanner type (monitor, classifier, scorer, summarizer, indexer) at run time.
+ /** Scanner type (monitor, classifier, scorer, summarizer) at run time.
* `monitor` - Monitor
* `classifier` - Classifier
* `scorer` - Scorer
- * `summarizer` - Summarizer
- * `indexer` - Indexer */
+ * `summarizer` - Summarizer */
scanner_type: ScannerTypeEnumApi
/** The `ReplayScanner.scanner_version` value at the moment the workflow ran. */
scanner_version: number
@@ -247,15 +244,14 @@ export interface ReplayScannerApi {
name: string
/** Free-form description shown in the scanner management UI. */
description?: string
- /** What the scanner does: monitor, classifier, scorer, summarizer, or indexer.
+ /** What the scanner does: monitor, classifier, scorer, or summarizer.
* `monitor` - Monitor
* `classifier` - Classifier
* `scorer` - Scorer
- * `summarizer` - Summarizer
- * `indexer` - Indexer */
+ * `summarizer` - Summarizer */
scanner_type: ScannerTypeEnumApi
- /** Type-specific configuration. Monitor/classifier/scorer/summarizer require `prompt`; classifiers add `tags`, scorers add `scale`. Indexer is fixed-task and rejects `prompt`. */
+ /** Type-specific configuration. All scanner types require `prompt`; classifiers add `tags`, scorers add `scale`, summarizers add optional `length` and `emits_embeddings` flag. */
scanner_config: unknown
/** Persisted `RecordingsQuery` shape used to pick candidate sessions. `date_from`/`date_to` are stripped on save — the schedule controls time, not the user. */
query?: unknown
@@ -306,15 +302,14 @@ export interface PatchedReplayScannerApi {
name?: string
/** Free-form description shown in the scanner management UI. */
description?: string
- /** What the scanner does: monitor, classifier, scorer, summarizer, or indexer.
+ /** What the scanner does: monitor, classifier, scorer, or summarizer.
* `monitor` - Monitor
* `classifier` - Classifier
* `scorer` - Scorer
- * `summarizer` - Summarizer
- * `indexer` - Indexer */
+ * `summarizer` - Summarizer */
scanner_type?: ScannerTypeEnumApi
- /** Type-specific configuration. Monitor/classifier/scorer/summarizer require `prompt`; classifiers add `tags`, scorers add `scale`. Indexer is fixed-task and rejects `prompt`. */
+ /** Type-specific configuration. All scanner types require `prompt`; classifiers add `tags`, scorers add `scale`, summarizers add optional `length` and `emits_embeddings` flag. */
scanner_config?: unknown
/** Persisted `RecordingsQuery` shape used to pick candidate sessions. `date_from`/`date_to` are stripped on save — the schedule controls time, not the user. */
query?: unknown
@@ -440,13 +435,12 @@ export type VisionScannersListParams = {
*/
order_by?: string[]
/**
- * Filter by scanner type (monitor, classifier, scorer, summarizer, indexer).
+ * Filter by scanner type (monitor, classifier, scorer, summarizer).
* `monitor` - Monitor
* `classifier` - Classifier
* `scorer` - Scorer
* `summarizer` - Summarizer
-* `indexer` - Indexer
*/
scanner_type?: VisionScannersListScannerType
}
@@ -456,7 +450,6 @@ export type VisionScannersListScannerType =
export const VisionScannersListScannerType = {
Classifier: 'classifier',
- Indexer: 'indexer',
Monitor: 'monitor',
Scorer: 'scorer',
Summarizer: 'summarizer',
diff --git a/products/replay_vision/frontend/generated/api.zod.ts b/products/replay_vision/frontend/generated/api.zod.ts
index 3485eff9a6c5..874090889d43 100644
--- a/products/replay_vision/frontend/generated/api.zod.ts
+++ b/products/replay_vision/frontend/generated/api.zod.ts
@@ -24,17 +24,17 @@ export const VisionScannersCreateBody = /* @__PURE__ */ zod.object({
.describe('Human-readable scanner name. Unique within the team.'),
description: zod.string().optional().describe('Free-form description shown in the scanner management UI.'),
scanner_type: zod
- .enum(['monitor', 'classifier', 'scorer', 'summarizer', 'indexer'])
+ .enum(['monitor', 'classifier', 'scorer', 'summarizer'])
.describe(
- '\* `monitor` - Monitor\n\* `classifier` - Classifier\n\* `scorer` - Scorer\n\* `summarizer` - Summarizer\n\* `indexer` - Indexer'
+ '\* `monitor` - Monitor\n\* `classifier` - Classifier\n\* `scorer` - Scorer\n\* `summarizer` - Summarizer'
)
.describe(
- 'What the scanner does: monitor, classifier, scorer, summarizer, or indexer.\n\n\* `monitor` - Monitor\n\* `classifier` - Classifier\n\* `scorer` - Scorer\n\* `summarizer` - Summarizer\n\* `indexer` - Indexer'
+ 'What the scanner does: monitor, classifier, scorer, or summarizer.\n\n\* `monitor` - Monitor\n\* `classifier` - Classifier\n\* `scorer` - Scorer\n\* `summarizer` - Summarizer'
),
scanner_config: zod
.unknown()
.describe(
- 'Type-specific configuration. Monitor\/classifier\/scorer\/summarizer require `prompt`; classifiers add `tags`, scorers add `scale`. Indexer is fixed-task and rejects `prompt`.'
+ 'Type-specific configuration. All scanner types require `prompt`; classifiers add `tags`, scorers add `scale`, summarizers add optional `length` and `emits_embeddings` flag.'
),
query: zod
.unknown()
@@ -89,19 +89,19 @@ export const VisionScannersPartialUpdateBody = /* @__PURE__ */ zod.object({
.describe('Human-readable scanner name. Unique within the team.'),
description: zod.string().optional().describe('Free-form description shown in the scanner management UI.'),
scanner_type: zod
- .enum(['monitor', 'classifier', 'scorer', 'summarizer', 'indexer'])
+ .enum(['monitor', 'classifier', 'scorer', 'summarizer'])
.describe(
- '\* `monitor` - Monitor\n\* `classifier` - Classifier\n\* `scorer` - Scorer\n\* `summarizer` - Summarizer\n\* `indexer` - Indexer'
+ '\* `monitor` - Monitor\n\* `classifier` - Classifier\n\* `scorer` - Scorer\n\* `summarizer` - Summarizer'
)
.optional()
.describe(
- 'What the scanner does: monitor, classifier, scorer, summarizer, or indexer.\n\n\* `monitor` - Monitor\n\* `classifier` - Classifier\n\* `scorer` - Scorer\n\* `summarizer` - Summarizer\n\* `indexer` - Indexer'
+ 'What the scanner does: monitor, classifier, scorer, or summarizer.\n\n\* `monitor` - Monitor\n\* `classifier` - Classifier\n\* `scorer` - Scorer\n\* `summarizer` - Summarizer'
),
scanner_config: zod
.unknown()
.optional()
.describe(
- 'Type-specific configuration. Monitor\/classifier\/scorer\/summarizer require `prompt`; classifiers add `tags`, scorers add `scale`. Indexer is fixed-task and rejects `prompt`.'
+ 'Type-specific configuration. All scanner types require `prompt`; classifiers add `tags`, scorers add `scale`, summarizers add optional `length` and `emits_embeddings` flag.'
),
query: zod
.unknown()
diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerTypeConfigEditor.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerTypeConfigEditor.tsx
index 7dba111d198e..23f560c69cc7 100644
--- a/products/replay_vision/frontend/replay_scanners/components/ScannerTypeConfigEditor.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerTypeConfigEditor.tsx
@@ -33,6 +33,16 @@ export function ScannerTypeConfigEditor({ scannerId, tabId }: { scannerId: strin
<Field name="scanner_config.length" label="Summary length">
<LemonSegmentedButton options={SUMMARIZER_LENGTH_OPTIONS} />
</Field>
+ <Field name="scanner_config.emits_embeddings">
+ {({ value, onChange }) => (
+ <LemonSwitch
+ label="Emit embeddings to enable free-text search"
+ checked={!!value}
+ onChange={onChange}
+ bordered
+ />
+ )}
+ </Field>
</div>
)
}
@@ -145,16 +155,5 @@ export function ScannerTypeConfigEditor({ scannerId, tabId }: { scannerId: strin
)
}
- if (scanner.scanner_type === 'indexer') {
- return (
- <Field name="scanner_config.prompt" label="Prompt">
- <LemonTextArea
- placeholder="Focus on the user's actions and goals. Ignore loading screens and animation noise."
- minRows={6}
- />
- </Field>
- )
- }
-
return <div className="text-muted text-sm">Unsupported scanner type.</div>
}
diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
index e9b13f1173ab..4b64aacc75d8 100644
--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
@@ -56,10 +56,9 @@ describe('replayScannerLogic', () => {
describe('setScannerType', () => {
it.each([
{ type: 'monitor' as const, expectedConfig: { prompt: '' } },
- { type: 'summarizer' as const, expectedConfig: { prompt: '', length: 'medium' } },
+ { type: 'summarizer' as const, expectedConfig: { prompt: '', length: 'medium', emits_embeddings: false } },
{ type: 'classifier' as const, expectedConfig: { prompt: '', tags: [], multi_label: true } },
{ type: 'scorer' as const, expectedConfig: { prompt: '', scale: { min: 0, max: 10 } } },
- { type: 'indexer' as const, expectedConfig: { prompt: '' } },
])(
'switching to $type replaces scanner_config with the default for that type',
async ({ type, expectedConfig }) => {
@@ -72,7 +71,9 @@ describe('replayScannerLogic', () => {
it('does not preserve old prompt across type changes', async () => {
logic.actions.setScannerValues({ scanner_config: { prompt: 'Was there a refund?' } })
await expectLogic(logic, () => logic.actions.setScannerType('summarizer')).toMatchValues({
- scanner: expect.objectContaining({ scanner_config: { prompt: '', length: 'medium' } }),
+ scanner: expect.objectContaining({
+ scanner_config: { prompt: '', length: 'medium', emits_embeddings: false },
+ }),
})
})
})
diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts
index 0cd778bc650f..ec3cf6943f55 100644
--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts
+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts
@@ -59,7 +59,7 @@ function currentTemplateKey(): string | null {
function defaultConfigForType(scannerType: ScannerType): ScannerConfig {
if (scannerType === 'summarizer') {
- return { prompt: '', length: 'medium' }
+ return { prompt: '', length: 'medium', emits_embeddings: false }
}
if (scannerType === 'classifier') {
return { prompt: '', tags: [], multi_label: true }
diff --git a/products/replay_vision/frontend/replay_scanners/types.ts b/products/replay_vision/frontend/replay_scanners/types.ts
index 57524b8a158f..f81863a9b878 100644
--- a/products/replay_vision/frontend/replay_scanners/types.ts
+++ b/products/replay_vision/frontend/replay_scanners/types.ts
@@ -3,7 +3,7 @@ import { RecordingsQuery } from '~/queries/schema/schema-general'
import { ScannerModelEnumApi } from '../generated/api.schemas'
import type { PatchedReplayScannerApi, ReplayScannerApi } from '../generated/api.schemas'
-export type ScannerType = 'monitor' | 'classifier' | 'scorer' | 'summarizer' | 'indexer'
+export type ScannerType = 'monitor' | 'classifier' | 'scorer' | 'summarizer'
export type EnabledFilter = 'enabled' | 'disabled'
@@ -144,6 +144,7 @@ export interface MonitorScannerConfig {
export interface SummarizerScannerConfig {
prompt: string
length: 'short' | 'medium' | 'long'
+ emits_embeddings: boolean
}
export interface ClassifierScannerConfig {
@@ -158,16 +159,11 @@ export interface ScorerScannerConfig {
scale: { min: number; max: number; label?: string }
}
-export interface IndexerScannerConfig {
- prompt: string
-}
-
export type ScannerConfig =
| MonitorScannerConfig
| SummarizerScannerConfig
| ClassifierScannerConfig
| ScorerScannerConfig
- | IndexerScannerConfig
export interface BaseReplayScanner {
id: string
@@ -207,12 +203,7 @@ export interface ScorerScanner extends BaseReplayScanner {
scanner_config: ScorerScannerConfig
}
-export interface IndexerScanner extends BaseReplayScanner {
- scanner_type: 'indexer'
- scanner_config: IndexerScannerConfig
-}
-
-export type ReplayScanner = MonitorScanner | SummarizerScanner | ClassifierScanner | ScorerScanner | IndexerScanner
+export type ReplayScanner = MonitorScanner | SummarizerScanner | ClassifierScanner | ScorerScanner
export type { VisionQuotaApi as VisionQuota } from '../generated/api.schemas'
diff --git a/products/replay_vision/mcp/tools.yaml b/products/replay_vision/mcp/tools.yaml
index b2d2166f21ec..2e3dc316ba66 100644
--- a/products/replay_vision/mcp/tools.yaml
+++ b/products/replay_vision/mcp/tools.yaml
@@ -31,13 +31,13 @@ tools:
title: Create replay vision scanner
description: >
Create a replay vision scanner. Pick a `scanner_type` — `monitor` (open-ended observations), `classifier`
- (assign a tag from a fixed label set), `scorer` (numeric rubric), `summarizer` (free-text summary), or
- `indexer` (structured extraction for embeddings) — and fill `scanner_config` to match:
- monitor/classifier/scorer/summarizer need a `prompt`; classifiers also need `tags`; scorers also need
- `scale`; indexers reject `prompt`. `query` is a `RecordingsQuery` shape that defines which sessions the
- scanner watches — `date_from` and `date_to` are ignored (the schedule controls time). `sampling_rate` is a
- 0..1 random downsample applied after the query matches (default 1.0). `model` chooses the LLM. Names must be
- unique within the team.
+ (assign a tag from a fixed label set), `scorer` (numeric rubric), or `summarizer` (free-text summary with
+ optional facet embeddings via `emits_embeddings`) — and fill `scanner_config` to match: all types need a
+ `prompt`; classifiers also need `tags`; scorers also need `scale`; summarizers optionally set `length` and
+ `emits_embeddings`. `query` is a `RecordingsQuery` shape that defines which sessions the scanner watches —
+ `date_from` and `date_to` are ignored (the schedule controls time). `sampling_rate` is a 0..1 random
+ downsample applied after the query matches (default 1.0). `model` chooses the LLM. Names must be unique
+ within the team.
exclude_params:
- id
- scanner_version
@@ -95,10 +95,10 @@ tools:
title: List replay vision scanners
description: >
List all replay vision scanners in the current project. A scanner watches a slice of session recordings
- (defined by its `query` and `sampling_rate`) and runs one of five LLM analyses against each matching
+ (defined by its `query` and `sampling_rate`) and runs one of four LLM analyses against each matching
session: `monitor` (open-ended observations), `classifier` (tag from a fixed label set), `scorer` (numeric
- rubric), `summarizer` (free-text summary), or `indexer` (structured extraction for downstream embedding).
- Each scanner returns its current configuration, enabled state, sampling rate, and `last_swept_at` timestamp.
+ rubric), or `summarizer` (free-text summary, optionally with facet embeddings for downstream search). Each
+ scanner returns its current configuration, enabled state, sampling rate, and `last_swept_at` timestamp.
feature_flag: replay-vision
vision-scanners-observations-get:
operation: vision_scanners_observations_retrieve
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 0ed3ab356f7a..0bb06e361eb9 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -5581,7 +5581,7 @@
}
},
"vision-scanners-create": {
- "description": "Create a replay vision scanner. Pick a `scanner_type` — `monitor` (open-ended observations), `classifier` (assign a tag from a fixed label set), `scorer` (numeric rubric), `summarizer` (free-text summary), or `indexer` (structured extraction for embeddings) — and fill `scanner_config` to match: monitor/classifier/scorer/summarizer need a `prompt`; classifiers also need `tags`; scorers also need `scale`; indexers reject `prompt`. `query` is a `RecordingsQuery` shape that defines which sessions the scanner watches — `date_from` and `date_to` are ignored (the schedule controls time). `sampling_rate` is a 0..1 random downsample applied after the query matches (default 1.0). `model` chooses the LLM. Names must be unique within the team.",
+ "description": "Create a replay vision scanner. Pick a `scanner_type` — `monitor` (open-ended observations), `classifier` (assign a tag from a fixed label set), `scorer` (numeric rubric), or `summarizer` (free-text summary with optional facet embeddings via `emits_embeddings`) — and fill `scanner_config` to match: all types need a `prompt`; classifiers also need `tags`; scorers also need `scale`; summarizers optionally set `length` and `emits_embeddings`. `query` is a `RecordingsQuery` shape that defines which sessions the scanner watches — `date_from` and `date_to` are ignored (the schedule controls time). `sampling_rate` is a 0..1 random downsample applied after the query matches (default 1.0). `model` chooses the LLM. Names must be unique within the team.",
"category": "Replay vision",
"feature": "replay_vision",
"summary": "Create replay vision scanner",
@@ -5630,7 +5630,7 @@
"feature_flag": "replay-vision"
},
"vision-scanners-list": {
- "description": "List all replay vision scanners in the current project. A scanner watches a slice of session recordings (defined by its `query` and `sampling_rate`) and runs one of five LLM analyses against each matching session: `monitor` (open-ended observations), `classifier` (tag from a fixed label set), `scorer` (numeric rubric), `summarizer` (free-text summary), or `indexer` (structured extraction for downstream embedding). Each scanner returns its current configuration, enabled state, sampling rate, and `last_swept_at` timestamp.",
+ "description": "List all replay vision scanners in the current project. A scanner watches a slice of session recordings (defined by its `query` and `sampling_rate`) and runs one of four LLM analyses against each matching session: `monitor` (open-ended observations), `classifier` (tag from a fixed label set), `scorer` (numeric rubric), or `summarizer` (free-text summary, optionally with facet embeddings for downstream search). Each scanner returns its current configuration, enabled state, sampling rate, and `last_swept_at` timestamp.",
"category": "Replay vision",
"feature": "replay_vision",
"summary": "List replay vision scanners",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 05a85f2ba8b5..5f5154e41c0f 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -6078,7 +6078,7 @@
}
},
"vision-scanners-create": {
- "description": "Create a replay vision scanner. Pick a `scanner_type` — `monitor` (open-ended observations), `classifier` (assign a tag from a fixed label set), `scorer` (numeric rubric), `summarizer` (free-text summary), or `indexer` (structured extraction for embeddings) — and fill `scanner_config` to match: monitor/classifier/scorer/summarizer need a `prompt`; classifiers also need `tags`; scorers also need `scale`; indexers reject `prompt`. `query` is a `RecordingsQuery` shape that defines which sessions the scanner watches — `date_from` and `date_to` are ignored (the schedule controls time). `sampling_rate` is a 0..1 random downsample applied after the query matches (default 1.0). `model` chooses the LLM. Names must be unique within the team.",
+ "description": "Create a replay vision scanner. Pick a `scanner_type` — `monitor` (open-ended observations), `classifier` (assign a tag from a fixed label set), `scorer` (numeric rubric), or `summarizer` (free-text summary with optional facet embeddings via `emits_embeddings`) — and fill `scanner_config` to match: all types need a `prompt`; classifiers also need `tags`; scorers also need `scale`; summarizers optionally set `length` and `emits_embeddings`. `query` is a `RecordingsQuery` shape that defines which sessions the scanner watches — `date_from` and `date_to` are ignored (the schedule controls time). `sampling_rate` is a 0..1 random downsample applied after the query matches (default 1.0). `model` chooses the LLM. Names must be unique within the team.",
"category": "Replay vision",
"feature": "replay_vision",
"summary": "Create replay vision scanner",
@@ -6127,7 +6127,7 @@
"feature_flag": "replay-vision"
},
"vision-scanners-list": {
- "description": "List all replay vision scanners in the current project. A scanner watches a slice of session recordings (defined by its `query` and `sampling_rate`) and runs one of five LLM analyses against each matching session: `monitor` (open-ended observations), `classifier` (tag from a fixed label set), `scorer` (numeric rubric), `summarizer` (free-text summary), or `indexer` (structured extraction for downstream embedding). Each scanner returns its current configuration, enabled state, sampling rate, and `last_swept_at` timestamp.",
+ "description": "List all replay vision scanners in the current project. A scanner watches a slice of session recordings (defined by its `query` and `sampling_rate`) and runs one of four LLM analyses against each matching session: `monitor` (open-ended observations), `classifier` (tag from a fixed label set), `scorer` (numeric rubric), or `summarizer` (free-text summary, optionally with facet embeddings for downstream search). Each scanner returns its current configuration, enabled state, sampling rate, and `last_swept_at` timestamp.",
"category": "Replay vision",
"feature": "replay_vision",
"summary": "List replay vision scanners",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index b80d2d9ce93b..56767a5f7e5e 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -24000,7 +24000,6 @@ export namespace Schemas {
* `classifier` - Classifier
* `scorer` - Scorer
* `summarizer` - Summarizer
- * `indexer` - Indexer
*/
export type ScannerTypeEnum = typeof ScannerTypeEnum[keyof typeof ScannerTypeEnum];
@@ -24010,7 +24009,6 @@ export namespace Schemas {
Classifier: 'classifier',
Scorer: 'scorer',
Summarizer: 'summarizer',
- Indexer: 'indexer',
} as const;
/**
@@ -24041,13 +24039,12 @@ export namespace Schemas {
export interface ScannerSnapshot {
/** Scanner name at run time. */
name: string;
- /** Scanner type (monitor, classifier, scorer, summarizer, indexer) at run time.
+ /** Scanner type (monitor, classifier, scorer, summarizer) at run time.
* `monitor` - Monitor
* `classifier` - Classifier
* `scorer` - Scorer
- * `summarizer` - Summarizer
- * `indexer` - Indexer */
+ * `summarizer` - Summarizer */
scanner_type: ScannerTypeEnum;
/** The `ReplayScanner.scanner_version` value at the moment the workflow ran. */
scanner_version: number;
@@ -24140,15 +24137,14 @@ export namespace Schemas {
name: string;
/** Free-form description shown in the scanner management UI. */
description?: string;
- /** What the scanner does: monitor, classifier, scorer, summarizer, or indexer.
+ /** What the scanner does: monitor, classifier, scorer, or summarizer.
* `monitor` - Monitor
* `classifier` - Classifier
* `scorer` - Scorer
- * `summarizer` - Summarizer
- * `indexer` - Indexer */
+ * `summarizer` - Summarizer */
scanner_type: ScannerTypeEnum;
- /** Type-specific configuration. Monitor/classifier/scorer/summarizer require `prompt`; classifiers add `tags`, scorers add `scale`. Indexer is fixed-task and rejects `prompt`. */
+ /** Type-specific configuration. All scanner types require `prompt`; classifiers add `tags`, scorers add `scale`, summarizers add optional `length` and `emits_embeddings` flag. */
scanner_config: unknown;
/** Persisted `RecordingsQuery` shape used to pick candidate sessions. `date_from`/`date_to` are stripped on save — the schedule controls time, not the user. */
query?: unknown;
@@ -30497,15 +30493,14 @@ export namespace Schemas {
name?: string;
/** Free-form description shown in the scanner management UI. */
description?: string;
- /** What the scanner does: monitor, classifier, scorer, summarizer, or indexer.
+ /** What the scanner does: monitor, classifier, scorer, or summarizer.
* `monitor` - Monitor
* `classifier` - Classifier
* `scorer` - Scorer
- * `summarizer` - Summarizer
- * `indexer` - Indexer */
+ * `summarizer` - Summarizer */
scanner_type?: ScannerTypeEnum;
- /** Type-specific configuration. Monitor/classifier/scorer/summarizer require `prompt`; classifiers add `tags`, scorers add `scale`. Indexer is fixed-task and rejects `prompt`. */
+ /** Type-specific configuration. All scanner types require `prompt`; classifiers add `tags`, scorers add `scale`, summarizers add optional `length` and `emits_embeddings` flag. */
scanner_config?: unknown;
/** Persisted `RecordingsQuery` shape used to pick candidate sessions. `date_from`/`date_to` are stripped on save — the schedule controls time, not the user. */
query?: unknown;
@@ -43004,13 +42999,12 @@ export namespace Schemas {
*/
order_by?: string[];
/**
- * Filter by scanner type (monitor, classifier, scorer, summarizer, indexer).
+ * Filter by scanner type (monitor, classifier, scorer, summarizer).
* `monitor` - Monitor
* `classifier` - Classifier
* `scorer` - Scorer
* `summarizer` - Summarizer
- * `indexer` - Indexer
*/
scanner_type?: VisionScannersListScannerType;
};
@@ -43020,7 +43014,6 @@ export namespace Schemas {
export const VisionScannersListScannerType = {
Classifier: 'classifier',
- Indexer: 'indexer',
Monitor: 'monitor',
Scorer: 'scorer',
Summarizer: 'summarizer',
diff --git a/services/mcp/src/generated/replay_vision/api.ts b/services/mcp/src/generated/replay_vision/api.ts
index 93070df1ce06..7bc2d3065bf8 100644
--- a/services/mcp/src/generated/replay_vision/api.ts
+++ b/services/mcp/src/generated/replay_vision/api.ts
@@ -31,10 +31,10 @@ export const VisionScannersListQueryParams = /* @__PURE__ */ zod.object({
'Sort scanners by name, created_at, updated_at, or scanner_type. Prefix with `-` for descending.\n\n* `name` - Name\n* `-name` - Name (descending)\n* `created_at` - Created at\n* `-created_at` - Created at (descending)\n* `updated_at` - Updated at\n* `-updated_at` - Updated at (descending)\n* `scanner_type` - Scanner type\n* `-scanner_type` - Scanner type (descending)'
),
scanner_type: zod
- .enum(['classifier', 'indexer', 'monitor', 'scorer', 'summarizer'])
+ .enum(['classifier', 'monitor', 'scorer', 'summarizer'])
.optional()
.describe(
- 'Filter by scanner type (monitor, classifier, scorer, summarizer, indexer).\n\n* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer\n* `indexer` - Indexer'
+ 'Filter by scanner type (monitor, classifier, scorer, summarizer).\n\n* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer'
),
})
@@ -61,17 +61,17 @@ export const VisionScannersCreateBody = /* @__PURE__ */ zod.object({
.describe('Human-readable scanner name. Unique within the team.'),
description: zod.string().optional().describe('Free-form description shown in the scanner management UI.'),
scanner_type: zod
- .enum(['monitor', 'classifier', 'scorer', 'summarizer', 'indexer'])
+ .enum(['monitor', 'classifier', 'scorer', 'summarizer'])
.describe(
- '* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer\n* `indexer` - Indexer'
+ '* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer'
)
.describe(
- 'What the scanner does: monitor, classifier, scorer, summarizer, or indexer.\n\n* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer\n* `indexer` - Indexer'
+ 'What the scanner does: monitor, classifier, scorer, or summarizer.\n\n* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer'
),
scanner_config: zod
.unknown()
.describe(
- 'Type-specific configuration. Monitor/classifier/scorer/summarizer require `prompt`; classifiers add `tags`, scorers add `scale`. Indexer is fixed-task and rejects `prompt`.'
+ 'Type-specific configuration. All scanner types require `prompt`; classifiers add `tags`, scorers add `scale`, summarizers add optional `length` and `emits_embeddings` flag.'
),
query: zod
.unknown()
@@ -147,19 +147,19 @@ export const VisionScannersPartialUpdateBody = /* @__PURE__ */ zod.object({
.describe('Human-readable scanner name. Unique within the team.'),
description: zod.string().optional().describe('Free-form description shown in the scanner management UI.'),
scanner_type: zod
- .enum(['monitor', 'classifier', 'scorer', 'summarizer', 'indexer'])
+ .enum(['monitor', 'classifier', 'scorer', 'summarizer'])
.describe(
- '* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer\n* `indexer` - Indexer'
+ '* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer'
)
.optional()
.describe(
- 'What the scanner does: monitor, classifier, scorer, summarizer, or indexer.\n\n* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer\n* `indexer` - Indexer'
+ 'What the scanner does: monitor, classifier, scorer, or summarizer.\n\n* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer'
),
scanner_config: zod
.unknown()
.optional()
.describe(
- 'Type-specific configuration. Monitor/classifier/scorer/summarizer require `prompt`; classifiers add `tags`, scorers add `scale`. Indexer is fixed-task and rejects `prompt`.'
+ 'Type-specific configuration. All scanner types require `prompt`; classifiers add `tags`, scorers add `scale`, summarizers add optional `length` and `emits_embeddings` flag.'
),
query: zod
.unknown()