Multi-model Β· feature-extraction + reranking Β· WASM
The standard two-stage retrieval pattern, both stages on-device. Stage 1: Jina embeds the query and every passage and ranks them by cosine β fast, and it reads whole documents. Stage 2: the MS MARCO cross-encoder re-reads the top candidates with the query, together, and re-scores them. Embeddings cast a wide net cheaply; the reranker judges precisely. Watch the order change between the two.
A bi-encoder (Jina) embeds query and passages separately, so retrieval is just a dot product β cheap enough to scan a whole corpus, and Jina's long context means each passage is embedded in full. But separate encoding can miss fine-grained relevance. A cross-encoder reads the query and a passage together in one pass, capturing interactions a dot product can't β far more accurate, but too slow to run over everything. So you retrieve a shortlist with Jina, then rerank just those few. The ordering often shifts: keyword-ish matches that ranked high on cosine drop when the reranker reads them closely.