ML System Design: Typed Search Keyword Recommendations for an App Marketplace
Goal
Design an end-to-end ML pipeline that, given a user query (e.g., "games"), generates diverse, typed keyword suggestions (e.g., "puzzle games", "RPG games", "racing games") with high relevance and coverage.
Assume you are designing for a large-scale app marketplace with millions of users and tens of thousands of queries per second during peak. Typed suggestions are grounded in a controlled taxonomy (e.g., Genre, Feature, Price, Age, Mode) and must be compliant with marketplace policies.
Requirements
-
Objectives and constraints
-
Relevance, diversity, coverage
-
Freshness/trends, multilingual/locale correctness
-
Latency and availability SLOs
-
Privacy and policy compliance
-
Data sources and labeling/feedback
-
Query/search logs, clicks, installs, uninstalls
-
App metadata and taxonomy
-
Reviews text, co-search/co-click graphs
-
Embeddings, locale signals
-
Labeling: implicit feedback (CTR/installs), counterfactual debiasing, editorial seeds
-
System architecture
-
Candidate generation: lexical, semantic (ANN), taxonomy, graph/co-occurrence, trending
-
Ranking: multi-stage (LTR + neural), diversity-aware re-rank
-
Feature store (offline/online), offline training, online serving, cache, retrieval indices
-
Features
-
Text/semantic embeddings, lexical features
-
Popularity/recency/trending signals
-
User/context signals (locale, device)
-
Co-occurrence/graph features (PMI, P(s|q))
-
Quality/spam trust signals
-
Models and choices
-
Retrieval: BM25, two-tower ANN, graph-based expansion
-
Ranking: GBDT, pairwise/listwise LTR, cross-encoder re-ranker, optional sequence/graph models
-
Evaluation and experimentation
-
Metrics: CTR, install rate, NDCG, recall@K, coverage/diversity, latency/errors, calibration
-
A/B testing with guardrails and statistical rigor
-
Continual training/ops
-
Streaming feedback ingestion, feature freshness, update cadence
-
Warm-starting, drift detection, rollback
-
Special cases
-
Cold start, multilingual/locale variants, spam/abuse, fairness and policy