VFlash: Fast, Accurate Visual Planning via Flash Primitive Decoding
u_Unrolled
D22: AI System Design Bank · Case Study: E-commerce Search and Substitution — Availability-Aware Retrieval, Learned Ranking and Constraint-Safe Replacements at Staff Level
Phase 9/Domain 22/Lesson 16

Case Study: E-commerce Search and Substitution — Availability-Aware Retrieval, Learned Ranking and Constraint-Safe Replacements at Staff Level

25 min read·Staff+ Tier· Unrolled Pro
Case Study: E-commerce Search and Substitution — Availability-Aware Retrieval, Learned Ranking and Constraint-Safe Replacements at Staff Level

You already know: lexical and embedding retrieval (D7), learning to rank and position bias (D7 and the ad case), and from the video feed case that hard policy belongs outside learned models. This case adds search tied to physical inventory: results must be available at the customer's store, inventory data is often wrong, and when an item turns out to be missing, a substitute must be chosen that the customer will accept and that never violates their constraints. The design questions: how to understand and retrieve, how to rank with biased feedback, how to choose substitutes safely, and how to keep search and substitution consistent.

How to read this lesson. No code, on purpose. Numbers marked assumed are assumptions you state out loud.


1. The prompt, and the questions that change the design

A mid-level answer: "embedding search with a ranker, and recommend similar items when something is missing". A staff candidate first asks how inventory is known and how often it is wrong, what queries look like, how substitutes are chosen and approved, and which constraints must never be broken. Those answers produce availability-aware retrieval, hybrid retrieval with query understanding, a learned acceptance model with customer preferences, and hard constraint filters outside every model.

Assumptions you state:

That's the preview. The full lesson, with its code and exercises, is part of Unrolled Pro.
Staff AI & Pro Tier Lesson

Unlock "Case Study: E-commerce Search and Substitution — Availability-Aware Retrieval, Learned Ranking and Constraint-Safe Replacements at Staff Level"

The foundations are free forever. Unrolled Pro unlocks the complete lesson, production architectures, and 55 battle-tested ML system design case studies.

Everything included with Pro:
All 234+ Deep-Dive Lessons across transformer internals, inference, RAG & agents
55 Staff-Level ML & System Design Case Studies with mathematical capacity estimates
AI Engineer Sheet & Exercises with worked solutions, self-checks, and code
100 Landmark Research Papers guided walkthroughs & progress tracking
14-Day Money-Back Guarantee — 100% full refund if you aren't satisfied
View Plans & Unlock All Lessons

From ₹167/mo (~$2/mo) · Cancel anytime · Instant activation

100% Risk-Free: 14-day no-questions-asked money-back guarantee