Skip to content

wiki query returns nothing for natural-language questions #235

Description

@theyashasvipandey

mex wiki query returns no results for natural-language questions, and doesn't say why. In
an evaluation over two scaffolds, 0 of 25 questions returned anything useful, while keyword
forms of the same questions did.

query form Hono hit@5 mex hit@5 empty results
natural-language question 0.00 0.00 92–100%
keywords 0.75 0.85 8%
exact title 1.00 1.00 0%

Example: "Why does Hono avoid runtime dependencies?" returns nothing, although an entity titled
Zero runtime dependencies, Web Standards only exists; runtime dependencies finds it at rank 1.

Cause

toMatchExpression() (src/wiki/query/session.ts:482) quotes every term and ANDs them:

"Why" AND "does" AND "Hono" AND "avoid" AND "runtime" AND "dependencies"

Any term missing from an entity (Why, does, avoid) excludes it. The quoting is right for
safety (it stops user text from becoming FTS5 syntax). The AND of every token, stopwords
included, is what empties the result.

This needs a decision first. wiki query is documented as full-text search, not question
answering. But agents naturally phrase lookups as questions, and a silent empty result is read
as "there's no knowledge about this".

Proposed direction

  1. Drop stopwords and question words before building the expression.
  2. If the AND query returns nothing, retry with OR and rank by bm25, labelling the result as
    the broader match.
  3. When nothing matches at all, say so and suggest ROUTER.md or mex graph scope, rather than
    returning a bare empty list.

Keep the quoting either way.

Activity

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

    core / discuss-firstCore behavior that requires maintainer discussion before implementationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions