Recommendation Engine

Recommendation Engine (Scala + Redis)

We delivered a hybrid recommendation engine that powers personalized feeds, PDP widgets, and email picks using a mix of collaborative filtering, content-based signals, and business rules. The system reacts to real-time events while learning long-term user preferences, driving higher AOV and retention.

The engine combines offline candidate generation with low-latency ranking powered by Redis streams and feature caches. This lets product teams experiment with new experiences—“Recommended for you”, “Similar items”, “Frequently bought together”, and personalized bundles—without rewriting the core infrastructure.

Collaborative filtering Content-based & rules Real-time features (Redis) A/B testing & uplift
Impact at a glance

↑ AOV

Higher basket value

↑ CTR

On rec widgets

ms

P99 latency

Multi-surface

Feed, PDP, email, bundles

Personalized modules now run across homepage, category pages, product detail pages, and lifecycle emails, backed by the same scoring logic, metrics, and experiments.

Problem

Before the engine, recommendations were:

  • Mostly static (“top sellers”, “new arrivals”) rather than user-specific.
  • Scattered logic per page, hard to maintain and evolve.
  • Impossible to measure systematically with experiments and uplift metrics.
Solution

We introduced a centralized recommendation platform:

  • Hybrid models blending collaborative filtering and content similarity.
  • Real-time features from Redis streams (views, carts, purchases).
  • Context-aware ranking that respects inventory, margin, and business rules.
  • Configurable “recipes” for each surface: feed, PDP, cart, email, etc.
Outcome

The Recommendation Engine delivered:

  • Lift in click-through, add-to-cart, and conversion from rec modules.
  • Higher AOV from cross-sell and frequently-bought-together bundles.
  • A shared experimentation and reporting layer around recommendations.

Architecture overview

The platform separates candidate generation from ranking and is built to support multiple algorithms under a single API. Scala services handle high-throughput traffic, while Redis powers fast feature lookups and event streams.

  • Event collection – User interactions (views, clicks, carts, purchases) are captured and pushed to streams and the data warehouse.
  • Offline candidate generation – Batch jobs build item-item and user-item matrices, similar items lists, and fallback sets (trending, new, etc.).
  • Online feature serving – Redis stores per-user and per-item features, updated in near-real time from event streams.
  • Ranking service – Scala microservices compute scores per candidate using model outputs, features, and business constraints.
  • Surfaces & experimentation – A single API powers homepage, PDP, cart, and email widgets, with flags and experiments controlling variants.
Key features in production
Hybrid recommenders

Combines CF (“people who bought X also…”) with content similarity and merchandising rules, reducing cold-start issues and making results more robust.

Real-time adaptation

Recent behavior (last sessions, cart changes) influences ranking, so recommendations adapt quickly as users browse.

Business-aware ranking

Inventory, margin, exclusions, and campaign boosts are baked into the scoring layer to align with commercial goals.

Experimentation & metrics

A/B tests compare algorithms and recipes, with tracking for CTR, add-to-cart, revenue per session, and long-term retention impact.

The architecture is modular, allowing new models, ranking features, or surfaces to be added without rewriting the core recommendation logic.

ML & ranking capabilities
  • Collaborative filtering and item-item similarity models.
  • Content-based recommendation using metadata and embeddings.
  • Learning-to-rank approaches blending multiple signals.
  • Evaluation with offline metrics and online A/B tests.
Engineering & infra
  • Scala microservices for high-throughput, low-latency serving.
  • Redis for feature storage, caching, and event streams.
  • Data pipelines feeding offline candidate generation and feature builds.
  • Feature flags and experimentation framework for safe iteration.
Typical use cases
  • Personalized home and category feeds for e-commerce or content apps.
  • “You might also like” PDP modules and frequently-bought-together bundles.
  • Triggered and batch emails with personalized recommendations.
  • Any product where personalization drives engagement and revenue.