WillsEducation
AI & ML20 min readPublished 18 February 2026

AmazonAmazon's invisible AI, from product recs to last-mile routing.

Recommendation SystemsLogistics MLForecasting
Amazon case study cover

The story

A tour of the ML stack that runs across recommendations, supply-chain forecasting, dynamic warehousing, and Alexa, and why Amazon's real AI story is industrial, not consumer.

What you’ll learn

  • 01Item-to-item collaborative filtering: the recsys pattern that still pays rent at scale
  • 02Forecasting across millions of SKUs with hierarchical models
  • 03Last-mile routing: a constraint-satisfaction problem masquerading as a data problem

The full breakdown

6 sections · 20 min read

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 ForecastingWarehouse-level Forecasting
Prediction GranularityCountry levelIndividual fulfillment center
Data InputsMacro economic trendsLocal search activity & delivery times
Core DecisionBulk manufacturing orderImmediate 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 queryRufus Generative Agent
Query shape'waterproof jacket''is this jacket good for rainy biking?'
Data inputs evaluatedProduct index matchingProduct descriptions + catalog reviews + QA logs
Expected outcomeList of items containing keywordsDirect conversational summary + recommended items

Alumni outcome

NG

Nitesh Gupta

Product Analyst, Deliveroo Data Science Lead, Deliveroo

Amazon's hierarchical forecasting case study directly shaped the approach I proposed internally. It got me the lead role and an actual roadmap to execute.

Ready to apply this playbook?

Our ai & ml programs turn breakdowns like this into portfolio work you can ship.