WhollySoftware
Back to blogAI

Building a Recommendation Engine With Embeddings

Wholly Software TeamJune 17, 20257 min read
Building a Recommendation Engine With Embeddings

A retail client's existing recommendation system was collaborative filtering based purely on purchase history, which worked reasonably well for established customers but produced generic best-seller lists for new users with little to no history — a meaningful chunk of their traffic given how many visitors were first-time buyers. We built an embedding-based alternative using product descriptions and images to see if content similarity could fill that cold-start gap.

For new users, we generated recommendations from the embeddings of whatever items they'd viewed or added to cart in the current session, finding nearest neighbors in embedding space. This beat the collaborative-filtering baseline's cold-start performance clearly — click-through rate on recommendations for first-session users went up about 22% in our A/B test, because content similarity gives useful signal even from a single viewed item.

For established users with meaningful purchase history, though, the embedding approach underperformed the existing collaborative-filtering system. Content similarity tends to recommend more of the same thing, while collaborative filtering captures the 'customers who bought X also bought Y' pattern that reflects actual complementary purchasing behavior — something embeddings on product descriptions alone don't naturally encode.

The final system routes users to one of two recommendation strategies based on how much history they have, with a blended zone in between where we combine both scores with a weighting that shifts gradually as more history accumulates rather than switching abruptly at some arbitrary threshold. We found the abrupt switch version caused a visible quality dip right at the cutover point during testing, which the gradual blend eliminated.

We also had to re-embed the product catalog on a schedule, not just at launch — new inventory arrived weekly, and embeddings computed from a stale model checkpoint started drifting from freshly computed ones after a few months, subtly degrading nearest-neighbor quality. We settled on nightly incremental embedding updates for new or changed products and a full re-embed on model version changes.

EmbeddingsRecommendation SystemsMachine LearningE-commerce
Building a Recommendation Engine With Embeddings — Wholly Software