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):
- You have two lists of results:
vector_resultsandkeyword_results. - Calculate a combined score for each document: $$ Score = \frac{1}{rank_{vector} + 60} + \frac{1}{rank_{keyword} + 60} $$
- Sort by combined score.
- 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