Skip to content

< all projects22 steps · medium · Rebuild

Search the problem catalog

You will have built a search engine over this site's own problem catalog, one small function at a time, and measured every stage of it: 5 functions that tokenise the catalog and build the inverted index, 3 that score and rank with BM25, 4 that put the same catalog on the real embedding model, 2 that fuse the two rankings and rerank the top ten with Jev, 5 that score every stage with recall at k and MRR on queries written the way people search, and 3 that put it behind one search that says where each stage ranked the result. The corpus is the catalog you have been browsing. The queries are the kind people type, not the titles: *the model wraps its answer in markdown fences and my parser dies*, *two sources say different things*. BM25 misses what shares no word with the title, the embedding model finds most of it, fusion sits between when one side is weak, and the rerank fixes the shortlist. The table at the end of part five is the argument for each stage, or against it. The embedding model and Jev are real: the steps that call them check what they did and spend a little of your credits. Pure steps print exact numbers. When every step has passed, the files assemble into one engine and you can search the catalog, live, and see the ranks.

Start: TokensSign in to run steps and keep your progress.
  1. Part 01 · 5 steps

    The index

    Words, where they occur, and how rare they are.

    1. 01Tokensnext
    2. 02What gets indexed
    3. 03The inverted index
    4. 04Document lengths
    5. 05How rare a word is
  2. Part 02 · 3 steps

    BM25

    Keyword search with the formula every search engine started from.

    1. 06One term's score
    2. 07Score every document
    3. 08Rank by BM25
  3. Part 03 · 4 steps

    Meaning

    The same catalog on the embedding model.

    1. 09Batches
    2. 10Embed the catalog
    3. 11Rank by meaning
    4. 12Embed the queries
  4. Part 04 · 2 steps

    Fuse and rerank

    Two rankings into one, then a decision model over the top ten.

    1. 13Reciprocal rank fusion
    2. 14Rerank the top ten with Jev
  5. Part 05 · 5 steps

    Measure

    Recall at k and MRR for every stage, on queries written the way people search.

    1. 15Where the answer landed
    2. 16Recall at k
    3. 17Mean reciprocal rank
    4. 18Score one stage
    5. 19Every stage, one table
  6. Part 06 · 3 steps

    The engine

    One search, and where each stage put the result.

    1. 20Build the engine
    2. 21Search
    3. 22Say what happened