Cole Hoffer

02 guides

Guides

I find a ranking formula easier to follow with a few documents in front of me. In these examples you can change the query or the rankings and see which document moves up.

Keyword search · Updated Dec 22, 2025

BM25 Search in LLM Systems

What does a second mention of “API” do to a document’s BM25 score? A worked example of how word frequency and document length affect the ranking.

Search query
API
  1. Key management

    Create API keys and rotate API credentials.

    0.25BM25
  2. Token setup

    Authorize API requests with OAuth tokens.

    0.19BM25

Key management ranks first. It mentions “API” twice.

Hybrid search · Updated Feb 14, 2026

Reciprocal Rank Fusion for Hybrid Search

A document that ranks second in two lists can end up first overall. Here’s how reciprocal rank fusion combines keyword and semantic search results.

Search query
reset my password
Keyword
  1. 1Password policy
  2. 2Reset link
  1. 1Account recovery
  2. 2Reset link

Reset link ranks first. Two second-place votes beat a single first.

Series / 3 parts

Advanced RAG

I usually draw retrieval as one box. These posts look inside it, from pulling a date range out of a query to deciding which documents reach the model.

Series overview ↗
  1. 01Structured Pre-Filtering for RAG Systems ↗
  2. 02Applying HyDE to Domain-Specific Search ↗
  3. 03Relevancy Filtering in Retrieval Pipelines ↗