Chapter 01
Item-to-Item Collaborative Filtering: the basic block
In 1998, Amazon patented Item-to-Item Collaborative Filtering. Unlike user-based systems that compare customer profiles (which become slow when you have hundreds of millions of users), Amazon's algorithm precomputes an item-to-item similarity matrix. This matrix matches products purchased together, scaling efficiently to massive user bases.
The similarity score is computed using the cosine similarity metric over product purchase histories. Because this similarity matrix is cached offline, the recommendation block on the product detail page renders in sub-10ms, satisfying tight latency budgets.
35%
Of total sales
attributable to recommendation blocks
400M+
Active SKUs
in item-to-item similarity matrix
Sub-10ms
Recommendation latency
rendered on page load
Chapter 02
Hierarchical Demand Forecasting
Amazon must predict customer purchases before they happen to pre-position inventory. Their forecasting system uses deep sequence-to-sequence models that predict demand at different geographic levels (global, regional, and individual fulfillment centers).
By utilizing DeepAR (an autoregressive recurrent network), Amazon predicts sales distributions for millions of SKUs. This allows fulfillment centers to pre-allocate shelf space for products before orders are placed, enabling same-day and next-day deliveries.
| Global Forecasting | Warehouse-level Forecasting | |
|---|---|---|
| Prediction Granularity | Country level | Individual fulfillment center |
| Data Inputs | Macro economic trends | Local search activity & delivery times |
| Core Decision | Bulk manufacturing order | Immediate logistics shipping route |
Chapter 03
Last-Mile Routing optimization
Once inventory is pre-positioned, last-mile delivery is treated as a complex vehicle routing problem (VRP) under constraints. Machine learning models predict traffic conditions, delivery window compliance, and average driver walking times to compute optimal delivery routes.
Amazon's routing models predict driver transit times by analyzing historical route telemetry data. These predictions allow the system to create realistic route plans that account for parking availability and delivery times in specific buildings.
Chapter 04
Fulfillment Center automation and robotic slotting
Inside fulfillment centers, machine learning algorithms coordinate the movements of thousands of Kiva robots. By analyzing order frequencies in real time, slotting algorithms position high-demand products near picking stations, reducing order picking times.
Chapter 05
Diversity, freshness, and the exploration loop
To keep recommendations fresh, Amazon balances exploitation (showing products matches) with exploration (introducing new or trending products). This exploration loop prevents recommendation lists from becoming repetitive, improving long-term engagement.
Chapter 06
Generative Shopping Agents & Automated Warehousing
Amazon's recent customer-facing AI launch is Rufus—a generative shopping assistant built directly into the mobile search bar. Unlike keyword search, Rufus evaluates complex customer inquiries (e.g. 'is this jacket warm enough for a wet winter in Scotland?') using LLMs trained on product descriptions, reviews, and Q&A logs.
| Keyword search query | Rufus Generative Agent | |
|---|---|---|
| Query shape | 'waterproof jacket' | 'is this jacket good for rainy biking?' |
| Data inputs evaluated | Product index matching | Product descriptions + catalog reviews + QA logs |
| Expected outcome | List of items containing keywords | Direct conversational summary + recommended items |