aiml

Lesson 16 of 37Module 6

Compare retrieval configurations

Measure fixed development rankings and misses

Compare word-based, vector, hybrid and reranked search on the same questions and source targets. Inspect individual misses before averages.

Prerequisites

The preceding retrieval module and its preserved development recording.

By the end, you can

  • Run frozen retrieval configurations over identical development inputs.
  • Map legacy target labels to exact current chunks after retrieval.
  • Read supported-query rank metrics separately from unsupported candidate behavior.
Runtime
Python 3.12+ with the pinned LangChain Core and NumPy environment
Dependencies
langchain-core 1.7.0, numpy 2.5.4 and pydantic 2.14.1; complete pins in requirements.lock

Lab code, tests and fixtures (ZIP, 2.1 MB)Quiz check your understanding

Progress is saved in this browser.

A retrieval change needs a fair comparison. Use the same questions, source snapshot and expected passages for each configuration, then inspect which targets each one finds. Otherwise a better-looking average may reflect a different task or denominator.

Recall measures how many labelled target passages appear within the chosen result cutoff. Reciprocal rank describes how early the first target appears. Per-question results explain those summary values and keep misses visible.

When you need this. Use it when you need to compare retrieval changes against fixed source targets while keeping the candidate pipeline separate from the labels used to check its output.

Follow one example. Keep the original UTF-8 writing question and its writing-passage target. Run lexical, vector, fused and coverage-reranked retrieval, then inspect the target’s position in each result. In the saved development run, all four configurations place this target second and have equal supported-query metrics. Do not swap in an easier question to make a configuration look better.

You will compare the existing retrieval paths without tuning them or calling a model. Expected targets enter the checker after retrieval; they do not guide candidate selection. The original baseline’s held-out score belongs to its original configuration, so this lesson does not reuse it for the changed paths.

Compare retrieval using the same questions

Frozen inputsQuestions +configurationsRun eachretrieverKeep returned IDsMapped targetsExpected sourcebindingsRank checksJoin labels afterretrievalPer-case resultsKeep missesvisibleInvalid mappingValueErrorFrozen inputsQuestions +configurationsRun eachretrieverKeep returned IDsMapped targetsExpected sourcebindingsRank checksJoin labels afterretrievalPer-case resultsKeep missesvisibleInvalid mappingValueError
Expected targets do not enter retrieval. Unsupported questions retain candidate traces outside supported-query recall and reciprocal-rank averages. Dashed arrows show conditional paths.
  1. Execute every frozen configuration.
  2. Pass returned IDs to evaluation.
  3. Join source targets after retrieval.
  4. Report case-level ranks and misses.
  5. Refuse invalid source mappings.

Freeze inputs before comparing configurations

The program fixes the configuration names, candidate budget, rank constant and evaluation cutoffs before running retrieval. Each configuration uses the same question, requested version, snapshot and saved vector recording. The lexical branch searches for the question’s terms joined with OR; the vector branch uses the complete original question string.

Before retrieval, the program reduces each case to its ID, query and requested version. Retrieval and coverage scoring do not receive expected sources, answer labels or target chunk IDs. A test replaces every label with an empty target list and checks that the rankings stay the same. The adapter exposes only development questions. The archived vector file still contains held-out vectors, but the program does not query them.

Bind legacy labels to the exact current chunk

The original baseline labels use earlier chunk IDs. A string comparison against current versioned IDs would silently produce false misses. After retrieval finishes, the binding step matches each target’s source ID, source version, source-text hash and exact chunk-text hash to one current chunk.

Invalid target mapping. A changed hash, missing target or ambiguous match raises ValueError. Duplicate target bindings are refused. The record keeps both the legacy and current IDs, so you can inspect the mapping instead of guessing it from a familiar source name.

The mapping changes the label’s identifier, not the expected content. Editing a target after you see the results would change the evaluation task. When chunk IDs change between the label set and the current snapshot, bind each label by its source ID, source version and text hashes, not by its ID string.

Read each metric before its average

Recall at a cutoff is the fraction of expected target chunks found within that cutoff. Reciprocal rank at a cutoff is the reciprocal of the first target’s rank when it falls inside the cutoff, or zero when no target does. The program also keeps target positions and missed case IDs for each configuration.

Unsupported denominator. A question with no target chunks has no defined recall or reciprocal rank in this comparison. Its metric values stay null, and the program leaves it out of those averages. The report lists separately how many candidates each configuration returned. An empty list would not show that an unsupported-question policy worked.

In the recorded run, all four configurations have the same supported-query metrics. The UTF-8 writing case is the only supported miss at cutoff 1. Coverage reranking does not fix it, and rank fusion does not turn the unsupported backup candidates into answers. Here the coverage reranker returns every list in the same order as plain rank fusion, so this run shows no gain from reranking. Judge a reranking stage on a separate validation set, and check per-question ranks for targets that move up and targets that move down.

The table below reads the recorded aggregates directly. Read the per-question ranks in the raw result before you interpret these means. The dataset is a small development set, not a held-out quality benchmark or a model-answer evaluation.

ConfigurationCutoffSupported casesMean recallMean reciprocal rank
lexical130.66666666666666660.6666666666666666
lexical2310.8333333333333334
vector130.66666666666666660.6666666666666666
vector2310.8333333333333334
rrf130.66666666666666660.6666666666666666
rrf2310.8333333333333334
rrf+coverage130.66666666666666660.6666666666666666
rrf+coverage2310.8333333333333334

Execute the frozen comparison

Download the complete lab. It contains the copied retrieval and reranking code, the fixtures, exact dependency pins, the failure tests and the recorded output.

Prepare the local labTerminal · bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.lock
compare.pySource · pythonDownload
"""Frozen tiny-development comparison; label joins occur after retrieval."""
import hashlib
import math
from hybrid import HybridRetriever
from rerank import rerank
from version_documents import validate_snapshot

CANDIDATE_BUDGET=3
RANK_CONSTANT=60
CUTOFFS=(1,2)
CONFIGURATIONS=('lexical','vector','rrf','rrf+coverage')


def retrieve_runs(snapshot,embeddings,questions):
    """questions contains only id, query and requested version; no target labels."""
    retriever=HybridRetriever(snapshot,embeddings);runs=[]
    try:
        for question in questions:
            policy={'version':{'$eq':question['version']}}
            hybrid=retriever.search(question['query'],k=CANDIDATE_BUDGET,candidate_budget=CANDIDATE_BUDGET,rank_constant=RANK_CONSTANT,policy=policy)
            runs.append({'case_id':question['case_id'],'query':question['query'],'version':question['version'],'lexical_query_terms':hybrid['lexical_query_terms'],'rankings':{'lexical':hybrid['lexical'],'vector':hybrid['vector'],'rrf':hybrid['results'],'rrf+coverage':rerank(question['query'],hybrid['results'],snapshot,k=CANDIDATE_BUDGET)}})
    finally:retriever.close()
    return runs


def bind_targets(snapshot,cases):
    """Map legacy labels by source ID, API version and exact chunk-text hash."""
    validate_snapshot(snapshot)
    bindings={};receipts=[]
    for case in cases:
        if case['id'] in bindings:raise ValueError('duplicate_case')
        if case['split']!='development':raise ValueError('development_only')
        targets=[]
        for target in case['expected']['targets']:
            matches=[chunk for source in snapshot['documents'] if source['source_id']==target['source_id'] and source['version']==target['source_version'] and source['sha256']==target['source_text_sha256'] for chunk in source['chunks'] if hashlib.sha256(chunk['text'].encode('utf-8')).hexdigest()==target['chunk_text_sha256']]
            if len(matches)!=1:raise ValueError('target_binding_not_bijective')
            cid=matches[0]['chunk_id']
            if cid in targets:raise ValueError('duplicate_target')
            targets.append(cid)
            receipts.append({'case_id':case['id'],'legacy_chunk_id':target['chunk_id'],'current_chunk_id':cid,'binding':['source_id','source_version','source_text_sha256','chunk_text_sha256']})
        if case['class']=='answerable' and not targets:raise ValueError('answerable_requires_targets')
        if case['class']!='answerable' and targets:raise ValueError('unsupported_must_have_no_targets')
        bindings[case['id']]={'case_class':case['class'],'target_chunk_ids':targets}
    return bindings,receipts


def metrics(rows,targets,k):
    ids=[r['chunk_id'] for r in rows]
    if len(ids)!=len(set(ids)):raise ValueError('duplicate_ranked_chunk')
    ranks=[i for i,cid in enumerate(ids,1) if cid in targets]
    if not targets:return {'target_ranks':[],'recall_at_k':None,'reciprocal_rank_at_k':None,'status':'unsupported-excluded'}
    within=[r for r in ranks if r<=k]
    return {'target_ranks':ranks,'recall_at_k':len(within)/len(targets),'reciprocal_rank_at_k':1/min(within) if within else 0.0,'status':'supported'}


def evaluate(runs,bindings):
    if len({r['case_id'] for r in runs})!=len(runs) or set(bindings)!={r['case_id'] for r in runs}:raise ValueError('case_join_mismatch')
    per_query=[]
    for run in runs:
        label=bindings[run['case_id']]
        per_query.append({'case_id':run['case_id'],'case_class':label['case_class'],'target_chunk_ids':label['target_chunk_ids'],'configurations':{name:{str(k):metrics(run['rankings'][name],label['target_chunk_ids'],k) for k in CUTOFFS} for name in CONFIGURATIONS}})
    supported=[r for r in per_query if r['case_class']=='answerable']
    aggregate={name:{str(k):{'supported_case_count':len(supported),'mean_recall_at_k':math.fsum(r['configurations'][name][str(k)]['recall_at_k'] for r in supported)/len(supported) if supported else None,'mean_reciprocal_rank_at_k':math.fsum(r['configurations'][name][str(k)]['reciprocal_rank_at_k'] for r in supported)/len(supported) if supported else None} for k in CUTOFFS} for name in CONFIGURATIONS}
    unsupported=[{'case_id':run['case_id'],'returned_candidate_counts':{name:len(rows) for name,rows in run['rankings'].items()}} for run in runs if bindings[run['case_id']]['case_class']!='answerable']
    misses={name:{str(k):[r['case_id'] for r in supported if r['configurations'][name][str(k)]['recall_at_k']==0] for k in CUTOFFS} for name in CONFIGURATIONS}
    return {'supported_misses':misses,'per_query':per_query,'aggregate':aggregate,'unsupported_candidate_behavior':unsupported,'supported_case_count':len(supported),'unsupported_case_count':len(unsupported)}
Run the local labTerminal · bash
python run.py --output scratch-result.json
python -m unittest discover -v

The output below is from a saved run in execution mode offline-frozen-development-comparison. It called no model, so running the lab needs no API key.

Saved CLI result fieldsRecorded output (excerpt) · jsonFull output
{
  "supported_case_count": 3,
  "unsupported_case_count": 1,
  "aggregate": {
    "lexical": {
      "1": {
        "recall": 0.6666666666666666,
        "reciprocal_rank": 0.6666666666666666
      },
      "2": {
        "recall": 1,
        "reciprocal_rank": 0.8333333333333334
      }
    },
    "vector": {
      "1": {
        "recall": 0.6666666666666666,
        "reciprocal_rank": 0.6666666666666666
      },
      "2": {
        "recall": 1,
        "reciprocal_rank": 0.8333333333333334
      }
    },
    "rrf": {
      "1": {
        "recall": 0.6666666666666666,
        "reciprocal_rank": 0.6666666666666666
      },
      "2": {
        "recall": 1,
        "reciprocal_rank": 0.8333333333333334
      }
    },
    "rrf+coverage": {
      "1": {
        "recall": 0.6666666666666666,
        "reciprocal_rank": 0.6666666666666666
      },
      "2": {
        "recall": 1,
        "reciprocal_rank": 0.8333333333333334
      }
    }
  },
  "supported_misses": {
    "lexical": {
      "1": [
        "utf8-write"
      ],
      "2": []
    },
    "vector": {
      "1": [
        "utf8-write"
      ],
      "2": []
    },
    "rrf": {
      "1": [
        "utf8-write"
      ],
      "2": []
    },
    "rrf+coverage": {
      "1": [
        "utf8-write"
      ],
      "2": []
    }
  }
}

The CLI runs each configuration in memory, then joins the labels to check the rankings. It generates no answer and does not measure cost, latency or capacity. A larger evaluation needs more representative cases and a separate untouched validation set. Do not tune on these development results and then present them as independent validation.

Inspect the complete saved result
Actual local execution recordRecorded output · jsonDownload
{
  "execution_mode": "offline-frozen-development-comparison",
  "model_called": false,
  "snapshot_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
  "frozen_configuration": {
    "names": [
      "lexical",
      "vector",
      "rrf",
      "rrf+coverage"
    ],
    "candidate_budget_per_branch": 3,
    "rank_constant": 60,
    "cutoffs": [
      1,
      2
    ],
    "scope": "four original development cases; no held-out queries; no configuration tuning"
  },
  "label_binding_receipts": [
    {
      "case_id": "utf8-write",
      "legacy_chunk_id": "path-write:b71a2d18a53d86bf",
      "current_chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
      "binding": [
        "source_id",
        "source_version",
        "source_text_sha256",
        "chunk_text_sha256"
      ]
    },
    {
      "case_id": "replace-file",
      "legacy_chunk_id": "path-write:b71a2d18a53d86bf",
      "current_chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
      "binding": [
        "source_id",
        "source_version",
        "source_text_sha256",
        "chunk_text_sha256"
      ]
    },
    {
      "case_id": "json-result-type",
      "legacy_chunk_id": "json-text:8a17e251a41ccb3b",
      "current_chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
      "binding": [
        "source_id",
        "source_version",
        "source_text_sha256",
        "chunk_text_sha256"
      ]
    }
  ],
  "retrieval_runs": [
    {
      "case_id": "utf8-write",
      "query": "How do I explicitly select UTF-8 when saving text with pathlib?",
      "version": "3.12",
      "lexical_query_terms": [
        "how",
        "do",
        "i",
        "explicitly",
        "select",
        "utf",
        "8",
        "when",
        "saving",
        "text",
        "with",
        "pathlib"
      ],
      "rankings": {
        "lexical": [
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "native_score": -0.8901430296001853
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "native_score": -4.904418516387322e-06
          },
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "native_score": -9.765013054830289e-07
          }
        ],
        "vector": [
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "score": 0.637539995393079
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "score": 0.5762678845903342
          },
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "score": 0.4948350231504922
          }
        ],
        "rrf": [
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "lexical_score": -0.8901430296001853,
            "vector_score": 0.637539995393079,
            "lexical_rank": 1,
            "vector_rank": 1,
            "lexical_contribution": 0.01639344262295082,
            "vector_contribution": 0.01639344262295082,
            "fused_score": 0.03278688524590164
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "lexical_score": -4.904418516387322e-06,
            "vector_score": 0.5762678845903342,
            "lexical_rank": 2,
            "vector_rank": 2,
            "lexical_contribution": 0.016129032258064516,
            "vector_contribution": 0.016129032258064516,
            "fused_score": 0.03225806451612903
          },
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "lexical_score": -9.765013054830289e-07,
            "vector_score": 0.4948350231504922,
            "lexical_rank": 3,
            "vector_rank": 3,
            "lexical_contribution": 0.015873015873015872,
            "vector_contribution": 0.015873015873015872,
            "fused_score": 0.031746031746031744
          }
        ],
        "rrf+coverage": [
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "lexical_score": -0.8901430296001853,
            "vector_score": 0.637539995393079,
            "lexical_rank": 1,
            "vector_rank": 1,
            "lexical_contribution": 0.01639344262295082,
            "vector_contribution": 0.01639344262295082,
            "fused_score": 0.03278688524590164,
            "incoming_rank": 1,
            "rerank_features": {
              "query_tokens": [
                "how",
                "do",
                "i",
                "explicitly",
                "select",
                "utf",
                "8",
                "when",
                "saving",
                "text",
                "with",
                "pathlib"
              ],
              "matched_tokens": [
                "8",
                "text",
                "utf",
                "when"
              ],
              "matched_count": 4,
              "query_token_count": 12
            },
            "coverage_score": 0.3333333333333333,
            "rerank_rank": 1
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "lexical_score": -4.904418516387322e-06,
            "vector_score": 0.5762678845903342,
            "lexical_rank": 2,
            "vector_rank": 2,
            "lexical_contribution": 0.016129032258064516,
            "vector_contribution": 0.016129032258064516,
            "fused_score": 0.03225806451612903,
            "incoming_rank": 2,
            "rerank_features": {
              "query_tokens": [
                "how",
                "do",
                "i",
                "explicitly",
                "select",
                "utf",
                "8",
                "when",
                "saving",
                "text",
                "with",
                "pathlib"
              ],
              "matched_tokens": [
                "8",
                "select",
                "text",
                "utf"
              ],
              "matched_count": 4,
              "query_token_count": 12
            },
            "coverage_score": 0.3333333333333333,
            "rerank_rank": 2
          },
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "lexical_score": -9.765013054830289e-07,
            "vector_score": 0.4948350231504922,
            "lexical_rank": 3,
            "vector_rank": 3,
            "lexical_contribution": 0.015873015873015872,
            "vector_contribution": 0.015873015873015872,
            "fused_score": 0.031746031746031744,
            "incoming_rank": 3,
            "rerank_features": {
              "query_tokens": [
                "how",
                "do",
                "i",
                "explicitly",
                "select",
                "utf",
                "8",
                "when",
                "saving",
                "text",
                "with",
                "pathlib"
              ],
              "matched_tokens": [
                "select"
              ],
              "matched_count": 1,
              "query_token_count": 12
            },
            "coverage_score": 0.08333333333333333,
            "rerank_rank": 3
          }
        ]
      }
    },
    {
      "case_id": "replace-file",
      "query": "Will write_text replace the contents of an existing file?",
      "version": "3.12",
      "lexical_query_terms": [
        "will",
        "write",
        "text",
        "replace",
        "the",
        "contents",
        "of",
        "an",
        "existing",
        "file"
      ],
      "rankings": {
        "lexical": [
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "native_score": -2.3976548397386743
          },
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "native_score": -4.084683995209214e-06
          },
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "native_score": -3.3056246724488786e-06
          }
        ],
        "vector": [
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "score": 0.6357498076122466
          },
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "score": 0.5547892797395033
          },
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "score": 0.36746132784169144
          }
        ],
        "rrf": [
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "lexical_score": -2.3976548397386743,
            "vector_score": 0.6357498076122466,
            "lexical_rank": 1,
            "vector_rank": 1,
            "lexical_contribution": 0.01639344262295082,
            "vector_contribution": 0.01639344262295082,
            "fused_score": 0.03278688524590164
          },
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "lexical_score": -4.084683995209214e-06,
            "vector_score": 0.5547892797395033,
            "lexical_rank": 2,
            "vector_rank": 2,
            "lexical_contribution": 0.016129032258064516,
            "vector_contribution": 0.016129032258064516,
            "fused_score": 0.03225806451612903
          },
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "lexical_score": -3.3056246724488786e-06,
            "vector_score": 0.36746132784169144,
            "lexical_rank": 3,
            "vector_rank": 3,
            "lexical_contribution": 0.015873015873015872,
            "vector_contribution": 0.015873015873015872,
            "fused_score": 0.031746031746031744
          }
        ],
        "rrf+coverage": [
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "lexical_score": -2.3976548397386743,
            "vector_score": 0.6357498076122466,
            "lexical_rank": 1,
            "vector_rank": 1,
            "lexical_contribution": 0.01639344262295082,
            "vector_contribution": 0.01639344262295082,
            "fused_score": 0.03278688524590164,
            "incoming_rank": 1,
            "rerank_features": {
              "query_tokens": [
                "will",
                "write",
                "text",
                "replace",
                "the",
                "contents",
                "of",
                "an",
                "existing",
                "file"
              ],
              "matched_tokens": [
                "an",
                "existing",
                "file",
                "of",
                "text",
                "the",
                "write"
              ],
              "matched_count": 7,
              "query_token_count": 10
            },
            "coverage_score": 0.7,
            "rerank_rank": 1
          },
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "lexical_score": -4.084683995209214e-06,
            "vector_score": 0.5547892797395033,
            "lexical_rank": 2,
            "vector_rank": 2,
            "lexical_contribution": 0.016129032258064516,
            "vector_contribution": 0.016129032258064516,
            "fused_score": 0.03225806451612903,
            "incoming_rank": 2,
            "rerank_features": {
              "query_tokens": [
                "will",
                "write",
                "text",
                "replace",
                "the",
                "contents",
                "of",
                "an",
                "existing",
                "file"
              ],
              "matched_tokens": [
                "file",
                "text",
                "the"
              ],
              "matched_count": 3,
              "query_token_count": 10
            },
            "coverage_score": 0.3,
            "rerank_rank": 2
          },
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "lexical_score": -3.3056246724488786e-06,
            "vector_score": 0.36746132784169144,
            "lexical_rank": 3,
            "vector_rank": 3,
            "lexical_contribution": 0.015873015873015872,
            "vector_contribution": 0.015873015873015872,
            "fused_score": 0.031746031746031744,
            "incoming_rank": 3,
            "rerank_features": {
              "query_tokens": [
                "will",
                "write",
                "text",
                "replace",
                "the",
                "contents",
                "of",
                "an",
                "existing",
                "file"
              ],
              "matched_tokens": [
                "file",
                "the",
                "write"
              ],
              "matched_count": 3,
              "query_token_count": 10
            },
            "coverage_score": 0.3,
            "rerank_rank": 3
          }
        ]
      }
    },
    {
      "case_id": "json-result-type",
      "query": "Does json.dumps produce text or a bytes object?",
      "version": "3.12",
      "lexical_query_terms": [
        "does",
        "json",
        "dumps",
        "produce",
        "text",
        "or",
        "a",
        "bytes",
        "object"
      ],
      "rankings": {
        "lexical": [
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "native_score": -3.628237730877387
          },
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "native_score": -3.0341221974564053e-06
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "native_score": -2.263641817358195e-06
          }
        ],
        "vector": [
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "score": 0.652333570145617
          },
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "score": 0.42563890525675496
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "score": 0.4145266500154773
          }
        ],
        "rrf": [
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "lexical_score": -3.628237730877387,
            "vector_score": 0.652333570145617,
            "lexical_rank": 1,
            "vector_rank": 1,
            "lexical_contribution": 0.01639344262295082,
            "vector_contribution": 0.01639344262295082,
            "fused_score": 0.03278688524590164
          },
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "lexical_score": -3.0341221974564053e-06,
            "vector_score": 0.42563890525675496,
            "lexical_rank": 2,
            "vector_rank": 2,
            "lexical_contribution": 0.016129032258064516,
            "vector_contribution": 0.016129032258064516,
            "fused_score": 0.03225806451612903
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "lexical_score": -2.263641817358195e-06,
            "vector_score": 0.4145266500154773,
            "lexical_rank": 3,
            "vector_rank": 3,
            "lexical_contribution": 0.015873015873015872,
            "vector_contribution": 0.015873015873015872,
            "fused_score": 0.031746031746031744
          }
        ],
        "rrf+coverage": [
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "lexical_score": -3.628237730877387,
            "vector_score": 0.652333570145617,
            "lexical_rank": 1,
            "vector_rank": 1,
            "lexical_contribution": 0.01639344262295082,
            "vector_contribution": 0.01639344262295082,
            "fused_score": 0.03278688524590164,
            "incoming_rank": 1,
            "rerank_features": {
              "query_tokens": [
                "does",
                "json",
                "dumps",
                "produce",
                "text",
                "or",
                "a",
                "bytes",
                "object"
              ],
              "matched_tokens": [
                "a",
                "does",
                "dumps",
                "json",
                "or"
              ],
              "matched_count": 5,
              "query_token_count": 9
            },
            "coverage_score": 0.5555555555555556,
            "rerank_rank": 1
          },
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "lexical_score": -3.0341221974564053e-06,
            "vector_score": 0.42563890525675496,
            "lexical_rank": 2,
            "vector_rank": 2,
            "lexical_contribution": 0.016129032258064516,
            "vector_contribution": 0.016129032258064516,
            "fused_score": 0.03225806451612903,
            "incoming_rank": 2,
            "rerank_features": {
              "query_tokens": [
                "does",
                "json",
                "dumps",
                "produce",
                "text",
                "or",
                "a",
                "bytes",
                "object"
              ],
              "matched_tokens": [
                "a",
                "text"
              ],
              "matched_count": 2,
              "query_token_count": 9
            },
            "coverage_score": 0.2222222222222222,
            "rerank_rank": 2
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "lexical_score": -2.263641817358195e-06,
            "vector_score": 0.4145266500154773,
            "lexical_rank": 3,
            "vector_rank": 3,
            "lexical_contribution": 0.015873015873015872,
            "vector_contribution": 0.015873015873015872,
            "fused_score": 0.031746031746031744,
            "incoming_rank": 3,
            "rerank_features": {
              "query_tokens": [
                "does",
                "json",
                "dumps",
                "produce",
                "text",
                "or",
                "a",
                "bytes",
                "object"
              ],
              "matched_tokens": [
                "a",
                "text"
              ],
              "matched_count": 2,
              "query_token_count": 9
            },
            "coverage_score": 0.2222222222222222,
            "rerank_rank": 3
          }
        ]
      }
    },
    {
      "case_id": "backup-schedule",
      "query": "How frequently does our cloud provider back up these files?",
      "version": "3.12",
      "lexical_query_terms": [
        "how",
        "frequently",
        "does",
        "our",
        "cloud",
        "provider",
        "back",
        "up",
        "these",
        "files"
      ],
      "rankings": {
        "lexical": [
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "native_score": -0.8273874668010814
          }
        ],
        "vector": [
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "score": 0.3202785226491292
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "score": 0.26563513588901855
          },
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "score": 0.2488070454064458
          }
        ],
        "rrf": [
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "lexical_score": -0.8273874668010814,
            "vector_score": 0.2488070454064458,
            "lexical_rank": 1,
            "vector_rank": 3,
            "lexical_contribution": 0.01639344262295082,
            "vector_contribution": 0.015873015873015872,
            "fused_score": 0.032266458495966696
          },
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "lexical_score": null,
            "vector_score": 0.3202785226491292,
            "lexical_rank": null,
            "vector_rank": 1,
            "lexical_contribution": 0.0,
            "vector_contribution": 0.01639344262295082,
            "fused_score": 0.01639344262295082
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "lexical_score": null,
            "vector_score": 0.26563513588901855,
            "lexical_rank": null,
            "vector_rank": 2,
            "lexical_contribution": 0.0,
            "vector_contribution": 0.016129032258064516,
            "fused_score": 0.016129032258064516
          }
        ],
        "rrf+coverage": [
          {
            "chunk_id": "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c",
            "source_id": "json-text",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/json.html#json.dumps",
            "text": "json.dumps(obj, ensure_ascii=True) returns a JSON string. Setting ensure_ascii=False leaves non-ASCII characters in that string. It does not write a file or select the encoding used by a file writer.",
            "lexical_score": -0.8273874668010814,
            "vector_score": 0.2488070454064458,
            "lexical_rank": 1,
            "vector_rank": 3,
            "lexical_contribution": 0.01639344262295082,
            "vector_contribution": 0.015873015873015872,
            "fused_score": 0.032266458495966696,
            "incoming_rank": 1,
            "rerank_features": {
              "query_tokens": [
                "how",
                "frequently",
                "does",
                "our",
                "cloud",
                "provider",
                "back",
                "up",
                "these",
                "files"
              ],
              "matched_tokens": [
                "does"
              ],
              "matched_count": 1,
              "query_token_count": 10
            },
            "coverage_score": 0.1,
            "rerank_rank": 1
          },
          {
            "chunk_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
            "source_id": "path-read",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
            "text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
            "lexical_score": null,
            "vector_score": 0.3202785226491292,
            "lexical_rank": null,
            "vector_rank": 1,
            "lexical_contribution": 0.0,
            "vector_contribution": 0.01639344262295082,
            "fused_score": 0.01639344262295082,
            "incoming_rank": 2,
            "rerank_features": {
              "query_tokens": [
                "how",
                "frequently",
                "does",
                "our",
                "cloud",
                "provider",
                "back",
                "up",
                "these",
                "files"
              ],
              "matched_tokens": [],
              "matched_count": 0,
              "query_token_count": 10
            },
            "coverage_score": 0.0,
            "rerank_rank": 2
          },
          {
            "chunk_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
            "source_id": "path-write",
            "version": "3.12",
            "url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
            "text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
            "lexical_score": null,
            "vector_score": 0.26563513588901855,
            "lexical_rank": null,
            "vector_rank": 2,
            "lexical_contribution": 0.0,
            "vector_contribution": 0.016129032258064516,
            "fused_score": 0.016129032258064516,
            "incoming_rank": 3,
            "rerank_features": {
              "query_tokens": [
                "how",
                "frequently",
                "does",
                "our",
                "cloud",
                "provider",
                "back",
                "up",
                "these",
                "files"
              ],
              "matched_tokens": [],
              "matched_count": 0,
              "query_token_count": 10
            },
            "coverage_score": 0.0,
            "rerank_rank": 3
          }
        ]
      }
    }
  ],
  "supported_misses": {
    "lexical": {
      "1": [
        "utf8-write"
      ],
      "2": []
    },
    "vector": {
      "1": [
        "utf8-write"
      ],
      "2": []
    },
    "rrf": {
      "1": [
        "utf8-write"
      ],
      "2": []
    },
    "rrf+coverage": {
      "1": [
        "utf8-write"
      ],
      "2": []
    }
  },
  "per_query": [
    {
      "case_id": "utf8-write",
      "case_class": "answerable",
      "target_chunk_ids": [
        "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7"
      ],
      "configurations": {
        "lexical": {
          "1": {
            "target_ranks": [
              2
            ],
            "recall_at_k": 0.0,
            "reciprocal_rank_at_k": 0.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              2
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 0.5,
            "status": "supported"
          }
        },
        "vector": {
          "1": {
            "target_ranks": [
              2
            ],
            "recall_at_k": 0.0,
            "reciprocal_rank_at_k": 0.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              2
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 0.5,
            "status": "supported"
          }
        },
        "rrf": {
          "1": {
            "target_ranks": [
              2
            ],
            "recall_at_k": 0.0,
            "reciprocal_rank_at_k": 0.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              2
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 0.5,
            "status": "supported"
          }
        },
        "rrf+coverage": {
          "1": {
            "target_ranks": [
              2
            ],
            "recall_at_k": 0.0,
            "reciprocal_rank_at_k": 0.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              2
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 0.5,
            "status": "supported"
          }
        }
      }
    },
    {
      "case_id": "replace-file",
      "case_class": "answerable",
      "target_chunk_ids": [
        "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7"
      ],
      "configurations": {
        "lexical": {
          "1": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          }
        },
        "vector": {
          "1": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          }
        },
        "rrf": {
          "1": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          }
        },
        "rrf+coverage": {
          "1": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          }
        }
      }
    },
    {
      "case_id": "json-result-type",
      "case_class": "answerable",
      "target_chunk_ids": [
        "e5455737b11664449f653280d89dfc2faaa9a14de16e9c3eb24296ca2ceea51c"
      ],
      "configurations": {
        "lexical": {
          "1": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          }
        },
        "vector": {
          "1": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          }
        },
        "rrf": {
          "1": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          }
        },
        "rrf+coverage": {
          "1": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          },
          "2": {
            "target_ranks": [
              1
            ],
            "recall_at_k": 1.0,
            "reciprocal_rank_at_k": 1.0,
            "status": "supported"
          }
        }
      }
    },
    {
      "case_id": "backup-schedule",
      "case_class": "unsupported",
      "target_chunk_ids": [],
      "configurations": {
        "lexical": {
          "1": {
            "target_ranks": [],
            "recall_at_k": null,
            "reciprocal_rank_at_k": null,
            "status": "unsupported-excluded"
          },
          "2": {
            "target_ranks": [],
            "recall_at_k": null,
            "reciprocal_rank_at_k": null,
            "status": "unsupported-excluded"
          }
        },
        "vector": {
          "1": {
            "target_ranks": [],
            "recall_at_k": null,
            "reciprocal_rank_at_k": null,
            "status": "unsupported-excluded"
          },
          "2": {
            "target_ranks": [],
            "recall_at_k": null,
            "reciprocal_rank_at_k": null,
            "status": "unsupported-excluded"
          }
        },
        "rrf": {
          "1": {
            "target_ranks": [],
            "recall_at_k": null,
            "reciprocal_rank_at_k": null,
            "status": "unsupported-excluded"
          },
          "2": {
            "target_ranks": [],
            "recall_at_k": null,
            "reciprocal_rank_at_k": null,
            "status": "unsupported-excluded"
          }
        },
        "rrf+coverage": {
          "1": {
            "target_ranks": [],
            "recall_at_k": null,
            "reciprocal_rank_at_k": null,
            "status": "unsupported-excluded"
          },
          "2": {
            "target_ranks": [],
            "recall_at_k": null,
            "reciprocal_rank_at_k": null,
            "status": "unsupported-excluded"
          }
        }
      }
    }
  ],
  "aggregate": {
    "lexical": {
      "1": {
        "supported_case_count": 3,
        "mean_recall_at_k": 0.6666666666666666,
        "mean_reciprocal_rank_at_k": 0.6666666666666666
      },
      "2": {
        "supported_case_count": 3,
        "mean_recall_at_k": 1.0,
        "mean_reciprocal_rank_at_k": 0.8333333333333334
      }
    },
    "vector": {
      "1": {
        "supported_case_count": 3,
        "mean_recall_at_k": 0.6666666666666666,
        "mean_reciprocal_rank_at_k": 0.6666666666666666
      },
      "2": {
        "supported_case_count": 3,
        "mean_recall_at_k": 1.0,
        "mean_reciprocal_rank_at_k": 0.8333333333333334
      }
    },
    "rrf": {
      "1": {
        "supported_case_count": 3,
        "mean_recall_at_k": 0.6666666666666666,
        "mean_reciprocal_rank_at_k": 0.6666666666666666
      },
      "2": {
        "supported_case_count": 3,
        "mean_recall_at_k": 1.0,
        "mean_reciprocal_rank_at_k": 0.8333333333333334
      }
    },
    "rrf+coverage": {
      "1": {
        "supported_case_count": 3,
        "mean_recall_at_k": 0.6666666666666666,
        "mean_reciprocal_rank_at_k": 0.6666666666666666
      },
      "2": {
        "supported_case_count": 3,
        "mean_recall_at_k": 1.0,
        "mean_reciprocal_rank_at_k": 0.8333333333333334
      }
    }
  },
  "unsupported_candidate_behavior": [
    {
      "case_id": "backup-schedule",
      "returned_candidate_counts": {
        "lexical": 1,
        "vector": 3,
        "rrf": 3,
        "rrf+coverage": 3
      }
    }
  ],
  "supported_case_count": 3,
  "unsupported_case_count": 1,
  "limit": "Descriptive results on three supported development questions, not a general search-quality estimate or model comparison. Unsupported questions have no retrieval target and are excluded from metric means."
}

Compare the recorded behavior

Follow the UTF-8 writing case from its legacy target mapping to the current target ID and returned ranks. Explain the difference between finding that target within a cutoff and placing it first. Then inspect the backup case: find its candidate counts and its null metric values. Do not turn either into an answer-quality score.

The corpus does not support one development question. How should this comparison handle its retrieval metrics?

Choose one answer, then check your reasoning.

Read the explanation

Labels join after retrieval, and undefined metrics remain distinct from measured failures.

What’s next

Continue with Choose chunk boundaries.

References

The original RRF paper, section 1, was checked on 23 October 2026 for the fusion formula. The dataset lesson defines this application’s versioned targets and split. The lab’s compare.py defines the metrics, the label binding and the frozen configuration.

Written by Arjun Prabhulal.

Module 6

Hybrid search and reranking