Cross-store product clustering across millions of stores

Ilia Kuchumov20 Oct 2026

Problem

Shopify hosts billions of listings from millions of merchants, and the same product appears in many stores with different titles, photos and variant structure. Buyers, developers and AI agents need one global product identifier (UPI) per item. Across stores the merchant's own catalog no longer gives context, barcodes are unreliable, and a match can sit in any store, so comparing all pairs is impossible. A wrong merge can mix two whole product groups.

Example from the article: two phone-case listings share the brand and product line, but one is "for iPhone 15" and the other "for iPhone 15 Pro", so they are different products.

Solution in brief

Ask a narrow question, "are these two listings the same product?", in three steps: retrieve candidate pairs with embeddings, score them with a cascade of three models of rising cost, and cluster the scored graph. The graph is cut into size-bounded components, and each is clustered with a learned merge rule. An LLM judge makes training labels, so expensive reasoning is paid for once.

Questions this case answers
  • How to group records of the same real-world entity from many independent sources when exhaustive pairwise comparison is impossible and pairwise matches are not transitive
  • How to split a huge scored similarity graph into size-bounded parts that can be clustered in parallel without cutting many true matches
  • How to group listings of the same product from millions of merchants under one global identifier?
  • How to score trillions of candidate pairs without running an expensive model on each one?

Tools and methods

  • Approximate nearest-neighbor search — shortlist candidate pairs
  • L1, gradient-boosted trees — cheap CPU score for every pair
  • L2, multilingual E5 cross-encoder — reads both listings together
  • L3, image-aware reranker — decides what text cannot
  • LLM judge — training labels, validated on human labels
  • Bounded union-find, then hierarchical clustering with a learned merge model — build clusters
Continue reading — it's free

Google or a one-time email code. No password.