Skip to content

Bug: vault_search ranks tangentially-related notes above the directly on-topic note #41

@raphasouthall

Description

@raphasouthall

Summary

For sharp queries that map cleanly to a single canonical note, vault_search sometimes ranks that canonical note below tangentially-related ones — by 2–4 positions and ~0.1+ score gap.

Example shape (anonymised)

Query targeting a specific environment/topic. Workspace scoped. top_k=5, depth=full.

Returned order by score:

  1. 0.59 — Note about an unrelated audit that links to the canonical note in its ## Related section
  2. 0.51 — Investigation note in a different subdirectory
  3. 0.51 — Architecture note for an unrelated system
  4. 0.47The canonical note that explicitly contains the queried fact in a top-level section, with the entities in question listed verbatim in a table
  5. 0.46 — A peripheral ops note

The canonical note's ## Environments section verbatim contains the queried entities; the regenerated summary already mentions them. Yet three lower-relevance notes score higher.

Hypothesis

The ## Related section in note #1 contains a dense block of [[wiki-links]] matching the query terms, which may be inflating its hybrid score. Backlink / link-density / co-occurrence signals may be over-weighted relative to actual section-level body matches.

Suggested investigation

  • Surface (in debug) the per-component score breakdown — semantic vs keyword vs co-occurrence vs context-boost — for the top 5 results in a repro case.
  • Consider down-weighting matches that occur only in ## Related / link-list / index sections vs body content.
  • Verify the context= re-rank boost is being applied as documented; results that should be in-context appear to be losing to out-of-context neighbours.

Workaround

Don't trust rank #1 alone — scan the full top-5/top-8 and re-rank by visually checking which note's section header matches the query topic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions