Whole-word matching option and a minimum term length
For human review. This came from a usage review of knolo-box. A human maintainer will review and implement this manually. No code or PRs come with this issue. No version bump or npm publish is requested.
Summary
Search matching is substring-based. Short terms match inside longer words (for example a three-letter term matching inside "quote" and "quota"), and one-letter terms match nearly every chunk. That produces noisy false hits and makes short queries unusable.
Steps to reproduce
- Build a knolo-box image with ordinary skill or doc text that contains words like "quote", "quota", or other common stems.
- Call
knolo_searchwith a short substring that appears only inside those longer words (not as its own whole word). - Observe multiple hits that do not contain the term as a whole word.
- Call
knolo_searchwith a single-letter term. Nearly every chunk matches.
Expected behavior
- Add a whole-word or prefix matching mode (or make one of those the default).
- Ignore one- and two-letter terms unless they are quoted.
- Keep behavior deterministic and document the matching rules in the knolo-box /
@knolo/mcpdocs.
Why it matters
False substring hits crowd out real answers and train users and agents to distrust search. Single-letter noise is especially bad when an agent expands a short acronym or a product letter into a query.
Acceptance criteria
- A three-letter substring inside "quote"/"quota"-style words does not match unless whole-word/prefix rules say it should.
- Unquoted one- and two-letter terms are ignored (or documented as no-ops).
- Quoted short terms still match when the caller asks for them.
- Fixture tests cover substring false positives and the minimum term length rule.
Related
- Ranking / relevance follow-up for knolo-box search (file alongside this issue if present)
- #79 / #87:
@knolo/mcpsearch tools
A human maintainer will review and implement this manually.