Skip to content

bug(kb): hybrid search cannot find a unique literal that is verbatim in the stored content #17628

Open

Description

@mrveiss

Measured on the live deployment (commit 9027bf7e6)

A fact was stored whose content contains a unique 17-character token:

"Round trip acceptance probe RTRIP17527A7F3C2E. The capital of the test set is RTRIP17527A7F3C2E."

Two searches, same route, same mode=hybrid, same corpus:

query result
RTRIP17527A7F3C2E — the exact token, twice in the content 0 results (HTTP 200, 29.6s)
round trip acceptance probe — the surrounding prose that fact, score: 1.0 (HTTP 200, 32.3s)

So the document is retrievable, and the one string that identifies it uniquely is not.

Why this shape matters

"Search for the exact identifier in the document" is the most basic query a knowledge
base gets: an error code, a fact id, a ticket number, a filename, a nonce in a log
line. A hybrid retrieval mode is supposed to combine semantic similarity with lexical
matching precisely so that a rare literal token is findable — a token no embedding has
seen cannot be reached semantically, which is exactly when the lexical half has to
carry the query.

Here the semantic half works and the lexical half returns nothing for a token that is
present verbatim, twice.

What this is not

Not access control: the same fact is returned by the prose query under the same
credential. Not the collection gap in #17625: this fact is in the collection the
retrieval path does query. Not corpus size: one visible fact.

Acceptance criteria

  • A unique literal present in a stored document is returned when searched for.
  • Whether mode=hybrid performs lexical matching at all is established and
    recorded — if the lexical half is unwired, disabled or silently failing, that is
    the finding and hybrid is the wrong name for what it does.
  • A test covers the rare-token case specifically. A test that searches for words
    the embedding model has seen cannot distinguish a working lexical half from an
    absent one, which is presumably why this survived.

Note on the last criterion

The two queries above are the contrast pair this needed: prose that a semantic match
can find, and a token that only a lexical match can. Either alone reports success.

Related

#17625, #17627 (measured in the same host session).

Activity

  1. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 2, 2026
  2. github-actions commented on Nov 2, 2026

    @github-actions
    Contributor

    needs-structure: this issue is missing:

    • a goal milestone M<n> - ...: v0.9.6 - knowledge base is not a goal milestone
    • a phase:M<n>.<k> label whose <n> matches the goal milestone: found none

    The label clears on the next issue event once all three are present (#19522).

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

    backendbugSomething isn't workingneeds-structureMissing goal milestone, matching phase label or native parent (#19522)priority: high

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions