You already know: convolutional and transformer image encoders (D5), contrastive learning (D4), approximate nearest-neighbour search and quantisation (D4 and D7), and from the autocomplete case that some rules must hold outside every model. This case adds search where the query is a photo: the photo is messy while the index is clean, the index holds billions of vectors, mobile uploads dominate latency, the photo might show text, a barcode or a landmark rather than a product, and it might contain people. The design questions: how to route, how to represent, how to index, and how to protect privacy.
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: "embed the photo with a pretrained model and find the nearest images". A staff candidate first asks what people point the camera at (products, text, plants, landmarks), what they want back (the exact product or similar ones), the latency and device limits, and the privacy and safety rules. Those answers produce routing to specialised handlers, exact match versus similar results, on-device cropping with a compressed index, and a hard rule against identifying people.
Assumptions you state: