Recipe
Personalized gift finder
Build a recommendation engine that matches recipients to products using weighted preference vectors and collaborative filtering.
Overview
This recipe walks through constructing a lightweight gift-matching pipeline. You will ingest recipient profiles, score products against preference dimensions, and surface ranked results — all without external ML services.
Ingredients
- Recipient profile store (KV or Postgres)
- Product catalog with tag vectors
- Weighted cosine similarity scorer
- Budget filter and deduplication layer
- Result cache with TTL
Steps
- Normalize recipient preferences into a sparse float vector keyed by tag ID.
- Fetch candidate products within budget range; exclude previously purchased items.
- Compute cosine similarity between recipient vector and each product tag vector.
- Apply recency boost and popularity decay multipliers to raw scores.
- Sort descending, take top-N, and cache the result set keyed by recipient ID.
Cold-start fallback
When a recipient has fewer than three preference signals, fall back to a curated trending list segmented by broad demographic bucket. Log the fallback event so you can measure coverage over time.