The Lost Chunk

Difficulty: HARDID: rag-rerank-failure

The Scenario

User asks: "What is the error code for SKU-998877?"

Vector Search fails because "SKU-998877" has no semantic meaning. It returns generic error pages. Keyword Search would find it instantly, but you aren't using it.

The Problem

Vector search is great for concepts ("shipping delay") but terrible for exact matches (IDs, codes, names).

The Goal

Implement Hybrid Search using Reciprocal Rank Fusion (RRF):

  1. You have two lists of results: vector_results and keyword_results.
  2. Calculate a combined score for each document: $$ Score = \frac{1}{rank_{vector} + 60} + \frac{1}{rank_{keyword} + 60} $$
  3. Sort by combined score.
  4. Return top 3.

Requirements:

  • Iterate through both lists.
  • Compute RRF score.
  • Sort and return top 3 IDs.
solution.py
Loading...
⚠️ Do not include PII or secrets in your code.
SYSTEM_LOGS
5/5
// Waiting for execution trigger...
PREVIEW MODE — SOLVE PREVIOUS MISSIONS TO UNLOCK