knolo-core
knolo-core copied to clipboard
Rank V5 box results by relevance instead of by ID
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
V5 box / @knolo/mcp search hits come back in internal-ID order, so the top results are effectively unordered by relevance. A query that names a specific skill or topic can return unrelated sections ahead of the matching skill name, title, or description.
Steps to reproduce
- Build a knolo-box image that includes several skills with distinct names, titles, and descriptions.
- Call
knolo_searchwith a query that clearly names one of those skills (or a distinctive phrase from its title or description). - Observe the hit list: results appear in internal-ID order, and unrelated sections often rank above the named skill.
- Repeat with a short generic query. Hits again follow ID order rather than term strength.
Expected behavior
- Score hits by term frequency (or an equivalent deterministic relevance score).
- Boost exact whole-word matches.
- Boost matches in skill names, titles, and descriptions over body text.
- Keep ranking deterministic so the same image and query always produce the same order and the same receipt payload.
Why it matters
Agents and humans treat the first few hits as the answer. ID-order ranking wastes those slots on near-random chunks and makes knolo-box look unreliable even when the right content is in the image.
Acceptance criteria
- A query that names a specific skill returns that skill (name/title/description match) ahead of unrelated ID-adjacent chunks.
- Ranking is documented and covered by a fixture test with a stable expected order.
- Receipts still record the query and roots; ranking does not weaken pin or verify behavior.
Related
- #110 (closed): Knolo Box Memory
- #79 / #87:
@knolo/mcpsearch tools
A human maintainer will review and implement this manually.