Problem
A delivery marketplace with hundreds of thousands of merchants, over 100 million items and tens of millions of customers needs embeddings for search and recommendations. The first pipeline ran twice a week per country. It sent every item to an embedding API and upserted the vectors into MongoDB. It re-embedded unchanged items on every run, so cost and run time grew, and new items took days to reach production. The pipeline was tied to one model and had no timestamps or versioning, so switching providers or tracking changes was nearly impossible.
Example from the article: one Coca-Cola bottle sold by thousands of venues was embedded again and again.
Solution in brief
Wolt replaced the batch job with a streaming pipeline. Backfills and live updates enter one events queue, a consumer calls the embedding API in batches and reuses vectors for identical inputs, and results go to a versioned embeddings topic. The same vectors feed an HNSW index for similar items, substitutions, recommendations and semantic search next to lexical search.
Questions this case answers
- How to keep a large entity catalog embedded and fresh at low cost when many entities are near-duplicates and the embedding model is a rate-limited external API
- How to add semantic retrieval to a keyword search engine so that descriptive queries work without losing exact-match quality
- How to generate and refresh embeddings for hundreds of millions of catalog items without re-embedding unchanged ones?
- How to let several teams share embeddings and switch embedding models without breaking downstream users?
Tools and methods
- Apache Kafka — events queue and the embedding updates topic (source of truth)
- OpenAI embeddings API — vectors for item text and search queries
- Hash-table deduplication — reuses vectors for identical or near-identical inputs
- HNSW index (DoorDash in-house engine on Apache Lucene) — approximate nearest-neighbor search
- Hybrid lexical and semantic search — exact matches plus intent matches
Google or a one-time email code. No password.
