Retrieval Desk — AI Web

Tune the copy shop's question desk: chunks, BM25, embeddings, hybrid search, and refusing. 14 levels, played right in the browser with nothing to install.

What you learn in this game

The Question Desk looks for chunks of documents that answer a villager's question, then quotes them with their page. That is the first half of RAG (Retrieval-Augmented Generation): retrieval, fetching the right context before anyone answers. The oldest way to look is to match words. BM25 scores each page: the more often a search word appears on that page, the higher, and a word rare across the binders is worth more than a word that is everywhere.

An embedding turns text into a vector: a row of numbers standing for its meaning. Texts close in meaning give vectors pointing the same way. The model at this desk is multilingual-e5-small (384 numbers, trained on many languages, Indonesian among them). It was run once for every chunk of the binders and every question; the similarity is computed right in the browser each time you tap.

Chunking: a document is cut before it is embedded, because one vector can only stand well for a few things. At this desk chunks are counted in sentences and never cross a page, so a quote can always name its binder and page.

Hybrid search runs the word search and the meaning search at once, then fuses the two rankings. The most common way to fuse them is Reciprocal Rank Fusion: each chunk gets 1 / (60 + rank) from each list it is on, and the sum sets the new order. The scores need no scaling, because only the ranks are used.

Two-stage search: the first stage (BM25, embeddings) is fast and fetches dozens of candidates; the second, the reranker, reads each pair of question and candidate at once and gives a new score. A bi-encoder sees the two apart, a cross-encoder sees them together.

A cache keeps the answers to questions already searched. A plain cache only hits when the text is exactly the same; a semantic cache hits when the question's embedding is close enough to a stored one. It saves work, but it is dangerous for questions that are almost the same with a different detail.