Problem
A grocery delivery service has to return relevant products for typos, partial queries such as "molo" for "moloko" (milk), and meaning-based queries such as "ovoshchi dlya borshcha" (vegetables for borscht). Results must be personalized and hide out-of-stock items at several hundred requests per second. A single model fails somewhere: full-text search cannot read meaning, and neural retrievers lag behind a changing catalog.
Example from the article: a product added a couple of days earlier, "Arbuz bruski «Iz Lavki», 500 g", was found by BM25 but missed by both neural candidate generators.
Solution in brief
Lavka search is a layered "burger". Three candidate generators (BM25, a DSSM trained on cart updates, and BERT distilled into DSSM) feed one candidate set. A CatBoost filtering model removes irrelevant items, and a personalized CatBoost ranker orders the rest. Availability is checked early with a per-warehouse Quotient filter, and data pipelines keep catalog, user and model artifacts fresh.
Questions this case answers
- How to build a retrieval-and-ranking pipeline that covers semantic queries and brand-new catalog items when learned models lag behind catalog changes
- How to skip expensive feature computation for candidates that cannot be shown because of a per-location availability constraint
- How to build grocery search that finds products for typos, partial and semantic queries?
- How to make newly added products and brands searchable before neural models are retrained?
Tools and methods
- BM25 — lexical candidates over an inverted index; finds new items and brands the neural models have not seen.
- DSSM (two-tower) — query and product embeddings; trained on query and purchased-product pairs; nearest-neighbor retrieval.
- BERT distilled into DSSM — deeper query semantics at the cost of a one-time training.
- HNSW — nearest-neighbor index of product embeddings.
- CatBoost — filtering model and personalized ranking model.
- Quotient filter — compact per-warehouse stock check with no false negatives.
Google or a one-time email code. No password.
