diagram.mmd — flowchart
AI Recommendation System flowchart diagram

An AI recommendation system personalizes content, product, or media suggestions for individual users by combining collaborative filtering (what similar users liked), content-based signals (item attributes), and contextual ranking — served in real time with low latency.

What the diagram shows

This flowchart maps the full recommendation serving path from user request to displayed recommendations:

1. User request: a recommendation surface (homepage feed, "you might also like" widget) fires a request with the user's ID and session context. 2. User profile lookup: the system fetches the user's historical interactions, preferences, and demographic features from the user profile store. 3. Candidate generation — collaborative filtering: an embedding-based CF model (matrix factorization, two-tower neural network) retrieves items similar to those the user and similar users have engaged with (see Embedding Generation Flow). 4. Candidate generation — content-based: item attribute embeddings are used to surface items similar in content to the user's past interactions. 5. Candidate merge: results from both retrieval paths are merged into a unified candidate pool, deduplicating seen items. 6. Feature engineering: user-item pair features are computed or fetched from the feature store for each candidate (see Feature Engineering Pipeline). 7. Ranking model: a personalized ranking model scores each candidate for predicted engagement probability (see AI Ranking Pipeline). 8. Diversity and freshness rules: business logic injects novelty — ensuring the user doesn't see the same top items every session — and applies freshness boosts to recent content. 9. Final recommendations: the ranked, diversified list is returned to the UI for display.

Why this matters

Recommendation systems drive a significant fraction of engagement and revenue in e-commerce, streaming, and social platforms. The two-stage architecture — fast candidate generation followed by accurate ranking — is the production standard because it balances personalization quality with sub-100ms serving latency.

Free online editor
Edit this diagram in Graphlet
Fork, modify, and export to SVG or PNG. No sign-up required.
Open in Graphlet →

Frequently asked questions

An AI recommendation system is a machine learning system that predicts and surfaces items (products, videos, articles) most likely to be relevant or engaging for a specific user, by combining signals from their past behaviour, the behaviour of similar users, and item attributes.
Collaborative filtering learns user and item representations (embeddings) from historical interaction data. At serving time, the user's embedding is used to retrieve items with similar embeddings via ANN search — items that users with similar tastes have engaged with, even if the current user has never seen them.
Combine both when your item catalogue has new items with no interaction history (cold-start problem). Content-based signals — item attribute embeddings — allow new items to be surfaced based on their similarity to items the user has liked, before any collaborative filtering signal has accumulated.
Common mistakes include ignoring diversity (recommending the same popular items repeatedly, reducing long-tail discovery), leaking future interaction data into training (inflating offline metrics), not applying freshness boosts (surfacing stale content), and evaluating only offline metrics (NDCG) without measuring online business KPIs like click-through rate.
Collaborative filtering recommends based on what similar users liked — it is blind to item content but excels at discovering non-obvious connections. Content-based filtering recommends based on item attributes similar to what the user has liked — it is robust to cold-start for new items but limited by the quality of item features and tends toward filter-bubble effects.
mermaid
flowchart TD A([User request: user ID and surface context]) --> B[Fetch user profile: history, preferences, demographics] B --> C[Parallel candidate generation] C --> D[Collaborative filtering: retrieve items from similar users] C --> E[Content-based: retrieve items similar to past interactions] D --> F[Merge candidates: deduplicate and remove seen items] E --> F F --> G[Fetch user-item pair features from feature store] G --> H[Ranking model: score each candidate for engagement probability] H --> I[Sort candidates by predicted score] I --> J[Apply diversity rules: limit same-category items] J --> K[Apply freshness boost to recent items] K --> L([Return top-N personalized recommendations])
Copied to clipboard