Skip to content

perf(ai): compare Qdrant full-text BM25 with the code tokenizer #7755

Backlog

Description

@devops-cli-service

Split from #4971.

Problem: The issue proposes a second BM25 arm on a Qdrant full-text index with the code tokenizer when Qdrant 1.20 is live. Why deferred: The live server is Qdrant 1.19.1, and 1.20 is not released. The main change can ship without this comparison. Acceptance criteria: a live Qdrant 1.20 server exists; the ingest builds a full-text index with the code tokenizer; the eval of #3902 compares the full-text arm with the sparse bm25 arm; and the better arm is kept and recorded in the issue.

Proposed design

Problem statement

Compare the Qdrant 1.20.0 full-text BM25 arm with the current client-side BM25 arm. The code can merge now, but the live eval waits on the cluster upgrade from 1.19.1. The code search fuses a dense arm with a client-side BM25 rerank of the dense candidates. Qdrant 1.20.0 adds a full-text index with a code tokenizer and BM25 scoring, and the #3902 gold set measures both arms.

Acceptance criteria

Requirement: Full-text index with the code tokenizer

The ingest MUST create a text payload index on the content field with the code tokenizer and bm25 scoring when the Qdrant server is 1.20.0 or later.

Scenario: Index build against a 1.20.0 server

  • WHEN The ingest ensures the collection against a fake Qdrant client that reports version 1.20.0.
  • THEN The test asserts that the create-payload-index request names the content field, the code tokenizer and bm25 scoring, and that the existing payload indexes stay as they are.

Requirement: Version gate

The ingest MUST NOT request a text index with the code tokenizer or bm25 scoring when the Qdrant server is below 1.20.0.

Scenario: Index build against a 1.19.1 server

  • WHEN The ingest ensures the collection against a fake Qdrant client that reports version 1.19.1.
  • THEN The test asserts that the ingest sends no text index request and creates the existing payload indexes as it does today.

Requirement: Two-arm comparison

The #3902 gold-set scorer MUST score the full-text arm and the current BM25 arm on the same gold set and MUST return one score row for each arm.

Scenario: Eval with both arms selected

  • WHEN The scorer runs with the full-text arm and the current BM25 arm against a fake Qdrant client.
  • THEN The test asserts two GoldSetScore rows, one for each arm, each with its hit rate at k=5, and no network call.

Requirement: Current arm stays the default

The scorer MUST keep the current BM25 arm as the default and MUST select the full-text arm only by its explicit name until the comparison records a winner.

Scenario: Eval with no arm name

  • WHEN The scorer runs with no arm name.
  • THEN The test asserts that the current BM25 arm scores and that no full-text text query runs.

Requirement: Pending a person after the merge

The issue MUST record the kept arm with the hit rate at k=5 of both arms.

Scenario: Eval on the live 1.20.0 server

  • WHEN A person runs the eval against the live Qdrant 1.20.0 server after the merge.
  • THEN The issue comment names the kept arm and gives the hit rate at k=5 of the full-text arm and of the current BM25 arm.

Existing Tool Considered

No alternatives check has run: the type perf is a skip class, so alternatives is null. Qdrant covers the need. qdrant-client==1.20.0 is pinned (pyproject.toml:28), and Qdrant 1.20.0 adds the code tokenizer and BM25 scoring on a full-text index (https://qdrant.tech/documentation/manage-data/indexing/#code). The change writes no tokenizer and no ranking code. The only gap is the cluster server, which runs 1.19.1. Cost to build the same instead: about 150k tokens and 4 days to write, keep and fix a BM25 index and a code tokenizer until it matches Qdrant.

Key questions

  • Is the existing BM25 arm a Qdrant sparse vector with the bm25 model?: No. The current BM25 arm is the client-side bm25_scores rerank of the dense candidates. hybrid_search_results fuses that ranking with the dense ranking by reciprocal rank fusion. The repository holds no sparse vector and no Qdrant/bm25 model. [sources: src/devops_cli/ai/rag/retriever.py:210, src/devops_cli/ai/rag/retriever.py:224, src/devops_cli/ai/lexical.py:73]
  • Does the comparison need a Qdrant 1.20 server?: Yes. The code tokenizer and BM25 scoring on a full-text index are available as of v1.20.0. The cluster chart is recorded at 1.19.1, so the live run waits on the server upgrade. The 1.20 release is out. [sources: https://qdrant.tech/blog/qdrant-1.20.x/, openspec/changes/archive/2026-10-24-1634-volumes-off-control-plane/proposal.md:47]
  • Which Qdrant client version is pinned, and does it support the code tokenizer and BM25 scoring?: qdrant-client==1.20.0 is pinned, so the client supports the code tokenizer and the bm25 scoring parameter. Only the server needs the upgrade to 1.20.0. [sources: pyproject.toml:28]
  • Which field and tokenizer does the full-text arm use?: The arm indexes the content payload field, the text that the current arm scores, with the code tokenizer and bm25 scoring. The current \w+ tokenizer keeps max_size as one token, and the code tokenizer splits it into max and size. Both arms rank the same chunk text in the eval, so the result shows the effect of the index and the tokenizer. (best practice) [sources: src/devops_cli/ai/rag/indexer.py:512, src/devops_cli/ai/rag/retriever.py:220, src/devops_cli/ai/lexical.py:25]
    • Chosen: The content field with the code tokenizer. The field holds the same chunk text that the current arm scores, and the code tokenizer splits the identifiers that the current tokenizer keeps whole.
    • Rejected: A new text field. A second field adds a second variable and a second payload write, so the eval cannot isolate the tokenizer.
    • Rejected: The content field with the word tokenizer. The word tokenizer does not split identifiers, so the arm tests no new code-search behavior.
  • Which arm does the comparison keep?: Keep the arm with the higher hit rate at k=5 on the test(ai): a gold set measures retrieval of knowledge base facts #3902 gold set. If the arms tie, keep the current BM25 arm, because it needs no 1.20.0 server. (best practice) [sources: src/devops_cli/ai/benchmark/gold_set_scorer.py:67, src/devops_cli/ai/benchmark/gold_set_scorer.py:130]
    • Chosen: Keep the measured winner. The issue asks for a comparison, and the test(ai): a gold set measures retrieval of knowledge base facts #3902 gold set gives one metric for both arms.
    • Rejected: Fix the full-text arm in advance. A fixed arm makes the comparison pointless, and no evidence shows that the full-text arm is better.
    • Rejected: Keep both arms. Two arms double the index and query cost, and the issue asks for one arm.

Fit

Fits in one pull request.

Suspected block

The cluster Qdrant upgrade to 1.20.0: the live server runs 1.19.1, and the code tokenizer and BM25 scoring need 1.20.0.

Dependencies

#3902

Activity

  1. added
    type/infra
    scope/ai
    source/agent
    on Nov 29, 2026
  2. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    ContributorAuthor
  3. added
    status/new
    value/medium
    effort/medium
    priority/p2-medium
    on Nov 29, 2026
  4. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/aisource/agentstatus/newtype/infravalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions