Skip to main content
The Cross Compare stage compares source documents against a reference collection using a cascading match strategy: exact → fuzzy → semantic → visual. Each match is classified using configurable rules, enabling drift detection, deduplication, and compliance checking workflows.
Stage Category: APPLY (Cross-collection comparison)Transformation: N documents → M finding documents (findings mode) or N documents → N enriched documents (enrich mode)

When to Use

When NOT to Use

Parameters

These tables are generated from CrossCompareParameters, the model the stage validates against. GET /v1/retrievers/stages serves the same schema, so Studio’s stage form and any agent reading the API see exactly these fields.

Core Parameters

Matching Configuration

match_tiers is a list of tier objects, not a list of strings. Each entry carries its own threshold, so different tiers can accept at different scores. Fields on each MatchTierConfig:

Classification

A ClassificationRule is {"min_score": float, "label": string}, both required. Default rules:

Output Configuration

Reference & Source Configuration

Alignment

Used when source documents should be compared against a specific reference page rather than the whole collection.

Extraction Modes

Use the field value as a single element. Best for comparing whole content blocks.

Matching Cascade

Tiers run in the order you list them and matching stops at the first success:
There are three tier types. Text and image matching are both vector tiers, distinguished by the feature_uri you point the tier at, so a visual comparison is a vector tier on an image feature rather than a separate tier type. If no tier matches, the element gets match_tier: "none" and the no_match_label classification.

Configuration Examples

Output Schema

Findings Mode

Each comparison produces a finding document:

Enrich Mode

Comparison results attached as a field on source documents:

Finding Fields

Performance

Reference documents are fetched once and reused across all source documents. The matching cascade short-circuits at the first successful tier, so ordering match_tiers from fastest to slowest (exact → fuzzy → vector) is optimal.
Limits:
  • Max source documents per execution: 50
  • Max reference documents fetched: 200 (configurable via reference_limit)

Common Pipeline Patterns

Drift Detection Pipeline

Catalog Match + Transform

Error Handling

vs Other Enrichment Stages