aeo_cluster_by_urls
Cluster search prompts by shared Google SERP URLs and assign each cluster the most relevant page. Uses rank-weighted matching and flags uncertain joins for manual review.
Instructions
Cluster prompts by shared Google SERP URLs, then assign each cluster a page.
Greedy centroid assignment on an ABSOLUTE shared-URL count (no transitive chaining). A join on
exactly one shared URL is allowed only if that URL is specific (low corpus document frequency),
is not a generic hub host, and the prompt is not a brand comparison — and such joins are NEVER
auto-accepted (they come back with needs_review=true). Query-drift SERPs are quarantined.
Page assignment is rank-weighted: a rank-1 brand hit outweighs a rank-10 one.
items = [{id, text, impressions?, serp: [{url, rank, near_miss}], serp_urls?: [...] (legacy),
citation_urls?: [...] (a SEPARATE signal — never joins clusters), spell?, mapped_pages?}]
config = per-project {brand:{domain}, competitors[], cluster:{T, one_shared_max_df, hub_hosts,...},
signals:{a_min_hits, a_high_confidence_max_rank}} — nothing client-specific is hardcoded.
Returns {clusters, assignments, n_items, n_clusters, needs_review, n_quarantined, caveat}.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| config | No | ||
| page_inventory | No |