Recommendation engine architecture separates the work of finding eligible items, estimating their relevance, and enforcing the rules that shape a final feed. The core pipeline is candidate generation → ranking → re-ranking, supported by feature services, event logging, and reliability controls.
For engineers building marketplace discovery, social feeds, creator recommendations, or job matching, these boundaries determine latency, debugging complexity, and where monetization belongs.
This guide explains the components, request contracts, architecture choices, and production trade-offs. The examples are illustrative, not benchmark results.
What Does a Recommendation Engine Architecture Include?
A production recommendation system typically has an offline data path and an online serving path.
The offline path processes interactions, item metadata, embeddings, and possibly model training. The online path retrieves candidates, assembles features, scores items, applies constraints, and serves results to an application.
Google's recommendation-system architecture documentation organizes the central online decision into candidate generation, scoring, and re-ranking.
That division matters because each stage has a different job: retrieval favors broad coverage, ranking favors accurate ordering, and re-ranking favors constraints across the displayed list.
The complete request also needs authentication, timeouts, fallbacks, monitoring, and a mechanism to connect displayed recommendations with subsequent events.
How Does a Request Move Through the Architecture?
Consider a fictional creator marketplace where a user opens the home feed:
Request → Context → Retrieval → Features → Ranking → Re-ranking → Response → Events
Retrieval asks which eligible posts are worth considering. The ranker assigns scores. Re-ranking then handles duplicate suppression, creator diversity, and any permitted commercial positions. The application renders the returned content.
This extends the seven-step explanation in how recommendation systems work, but focuses on service responsibilities and interface boundaries rather than the user's journey.
A critical design rule is do not make ranking responsible for discovering the entire catalog unless that responsibility is deliberately included in the service's contract.
What Does Candidate Generation Own?
Candidate generation retrieves a manageable subset from a potentially enormous item corpus. Sources might include followed accounts, keyword matching, popular content, collaborative signals, or vector similarity.
A marketplace might blend query-matched products with related sellers. A creator platform might mix followed creators with new accounts worth exploring.
Multiple generators improve coverage, but their scores are rarely directly comparable. Merge and deduplicate candidates, preserve source identifiers, and enforce hard requirements such as availability or access restrictions before expensive downstream work.
Google Cloud's two-tower retrieval reference architecture uses learned representations to retrieve candidates efficiently from large collections.
Candidate recall is crucial. A ranker cannot promote a relevant item that retrieval never supplied. Measure both coverage and the fraction of relevant items surviving the first stage.
Which Candidate Generation Approach Fits?
These techniques can coexist. An early product may start with filters and topical similarity, then add learned retrieval when feedback and scale justify the added operations.
Don't confuse a retrieval similarity score with a calibrated probability of purchase or engagement.
How Should the Feature Layer Be Designed?
The scoring service needs a consistent representation of recipient, item, and request context. Useful features include recent user interests, item age, availability, historical quality, surface type, and query intent.
Feature freshness varies: inventory status may need immediate updates, while aggregate engagement counters can tolerate delay.
Prefer a defined schema and explicit defaults for missing data. Training-serving skew arises when offline features differ from those available at request time. Version derived features alongside ranking configurations.
Only request features that can be returned within the latency budget. Fetching numerous remote features serially can dominate the entire recommendation response.
What Does the Ranking Stage Actually Optimize?
Ranking assigns each candidate a comparable relevance score for the current context, then orders the set. Objectives may include meaningful engagement, qualified clicks, purchases, or successful matches.
A simple transparent score might be:
score = 0.5 × relevance + 0.3 × freshness + 0.2 × quality
The weights and normalized features here are illustrative. More elaborate systems may use boosted trees or neural models.
Google's scoring guidance warns that optimizing an easily measured metric can undermine the experience: clicks can encourage clickbait, while watch-time objectives can favor unnecessarily long content.
A unified scoring stage also avoids comparing incompatible scores produced by different retrieval generators. Build an explainable baseline before introducing a model requiring a continuous training pipeline.
What Belongs After Scoring?
Re-ranking transforms the scored list into one that satisfies requirements spanning individual items or the entire feed.
It can remove duplicates, reject unavailable listings, cap repeated creators, protect content diversity, ensure freshness, or limit sponsored density.
Google's re-ranking documentation discusses filtering and score adjustments for freshness, diversity, and other considerations.
Hard eligibility checks should never be overridden merely because an item scores highly. Soft constraints, such as diversity targets, should be measured against relevance loss so an apparently balanced feed does not become less useful.
Keep a trace of which policy removed or moved each item. Otherwise, engineers may blame the ranker for changes made downstream.
Where Do Sponsored Placements Fit?
For platforms operating an advertising marketplace, monetization enters after advertisers and sponsored candidates have satisfied campaign and platform eligibility requirements.
The decision layer may combine organic scores, eligible sponsored offers, placement policies, and frequency controls to produce one mixed feed. Sponsored items need clear disclosure in the rendered interface.
A common implementation mistake is to run organic ranking and advertising separately, then merge results with undocumented application logic. This complicates exposure attribution, fallback behavior, and policy enforcement.
The sponsored listings API guide explains the decision boundary between native placement selection and broader advertiser operations.
A sponsored auction, where used, is a commercial allocation mechanism, not proof that the winner belongs anywhere in the organic feed.
What Should Each Service Return?
Define contracts around ownership rather than vague labels such as “AI recommendation API.”
Avoid returning redundant full catalog objects from every stage. Include a request or decision identifier that allows operators to join ranking decisions with impression and conversion events.
Treat sample JSON as schematic until an actual vendor contract is published.
How Should Engineers Budget Serving Time?
Latency is a property of the entire request path, not only the ranking model. Retrieval, feature lookups, network transfer, re-ranking, rendering dependencies, and observability all contribute.
For an illustrative 400-millisecond server-side budget, a team might allocate 100 milliseconds to retrieval, 150 to scoring, 50 to re-ranking and post-processing, and 100 to other overhead. Those are planning assumptions, not industry targets.
Measure p50, p95, and p99 using realistic candidate counts and concurrent traffic. Set per-stage deadlines; avoid retry storms and cascading failures.
Maintain a safe path to eligible recent or previously ranked content when a dependent service fails. An advertising timeout should not make the organic feed disappear.
What Has Changed in Large-Scale Retrieval?
Modern recommendation systems increasingly combine embedding-based retrieval, contextual signals, and efficient serving infrastructure to discover relevant items from enormous content catalogs.
In August 2026, LinkedIn published research on large-scale feed retrieval, describing how its recommendation infrastructure retrieves approximately 2,000 candidates from several million potential items within a latency budget of a few milliseconds.
The system uses a fine-tuned language model to generate user and content embeddings, enabling personalized candidate retrieval before downstream ranking. LinkedIn also describes aligning retrieval representations with ranking signals to improve recommendation quality.
The engineering lesson is straightforward: high-quality recommendations depend on retrieving the right candidates efficiently, not just building a more sophisticated ranking model. Smaller teams should prioritize candidate coverage, data freshness, and reliable service boundaries before introducing complex retrieval infrastructure.
How Do You Evaluate the Whole Architecture?
Different stages require different metrics. Retrieval uses recall and catalog coverage; ranking uses metrics such as NDCG@K; re-ranking needs constraint compliance and diversity measures.
Production also requires error rates, p95/p99 latency, fallback frequency, conversions, and retention. For sponsored placements, track advertiser outcomes alongside organic performance and user complaints.
Log which items were eligible, scored, filtered, and actually displayed. Without exposure logs, missing clicks can be mistaken for negative preferences.
Offline evaluation helps narrow approaches; randomized online experiments are needed to determine actual product impact. Changes to retrieval and policy enforcement should be tested separately when feasible, so results remain interpretable.
What Is a Sensible Build Sequence?
Start with an application-owned catalog and an eligible-candidate retrieval query. Implement a simple scoring baseline, then add explicit policy checks and a stable response contract.
Next, log decisions and impressions, test empty results and timeouts, and establish offline and online evaluation. Only then consider more advanced retrieval models or ranking algorithms.
The feed ranking system architecture provides a related implementation perspective. The goal is not maximum sophistication on day one; it is an understandable system that can be changed safely.
Where Does Gortex Fit in the Architecture?
Gortex provides platform-owned advertising marketplace infrastructure centered on one decision layer for supplied organic and sponsored candidates.
Its POST /v1/decide path coordinates calibrated linear ranking, eligibility and placement policies, sponsored-slot resolution, and decision tracking. Published private-beta capabilities also include advertiser self-service and multi-bidder auctions, with scope subject to validation during integration.
Retrieval and the application's content interface remain platform responsibilities. The Gortex architecture documentation recommends planning near 50 candidates per request, with 100 as an upper planning limit.
Gortex's longer-term AI-agent advertising vision concerns structured offers agents may evaluate under user permissions; it is distinct from the current platform decision API.
Conclusion
Recommendation engine architecture succeeds when retrieval, scoring, re-ranking, and serving have clear ownership and measurable contracts. A sophisticated ranker cannot compensate for poor candidate coverage, stale features, or unobserved policy decisions.
Start with reliable retrieval, a transparent scoring baseline, explicit eligibility checks, and decision-level logging. Expand model complexity only after evaluating user outcomes.
For platforms ready to monetize existing discovery surfaces, Gortex's decision infrastructure provides a way to assess unified organic ranking and sponsored placement without handing over the entire catalog and application experience.
Frequently Asked Questions
Is candidate generation the same as ranking?
No. Candidate generation selects items for consideration. Ranking orders those selected items using a shared relevance objective.
Can re-ranking fix missing candidates?
No. It can reorder or remove supplied items, but cannot recover a relevant item never retrieved.
Do all recommendation engines require neural networks?
No. Rules, filters, linear scoring, and content-based methods can provide useful systems without model training.
Should sponsored placements be decided separately?
They can be, but the platform must reconcile paid and organic eligibility, placement policies, event attribution, and fallback behavior.