We’re launching a personalized homepage and need a backend feature to power a “Recommended for You” section. Each signed‑in user should see products tailored to their on‑site behavior (pages viewed, past purchases, items added to cart). Reads need to be very fast, so please precompute recommendations in a scheduled batch (e.g., nightly) rather than at request time.

Source user activity from PostgreSQL, produce a ranked list of product IDs per active user using a simple approach (co‑purchase or collaborative filtering), and store those IDs in Redis keyed by user_id. When the homepage loads, the API should quickly pull the IDs from Redis and then fetch full product details from Postgres (or a product cache) to build the response.

Expose a GraphQL query: myRecommendations(limit: Int = 10): [Product]. Access must require a user JWT Bearer token. Include sensible fallbacks if a user has little or no history (e.g., popular items), and keep response times snappy.