Skip to content

Bug: vault_graph / vault_related / vault_summary don't record note usage #32

@raphasouthall

Description

@raphasouthall

Summary

Several retrieval paths fetch notes but never log usage. This creates a feedback loop: notes reached only via graph/related/summary navigation stay `never_used` forever, biasing the ranker toward already-used notes.

Estimated impact: 30–50 of the 218 `never_used` notes would move to `active` if these paths recorded usage.

Root cause

`_record_note_usage` is called on hybrid / semantic / keyword / triples retrieval (`search.py:838, 1051-1110`) and inside `graph.py:263` for graph-neighbour co-activation. But the top-level MCP tool paths bypass it:

  • `vault_graph` — graph retrieval for the root note doesn't record.
  • `vault_related` (`related.py:19-125`) — pure cosine similarity, no usage recording on results.
  • `vault_summary` (`tools/search_tools.py:157`) — reads and returns summary, no usage recording.

Proposed fix

Add `_record_note_usage(conn, [note])` at exit of each of:

  • `vault_graph` — for the root note and the returned neighbours.
  • `vault_related` — for the returned related notes.
  • `vault_summary` — for the note whose summary was fetched.

Expected effect

  • `never_used` count shrinks by an estimated 30–50.
  • Hotness scores more accurately reflect follow-the-link navigation, not just direct search.
  • Hebbian reinforcement fires on all retrieval paths, consistent with the design docs' engram-network framing.

Key files

  • `src/neurostack/graph.py:263`
  • `src/neurostack/related.py:19-125`
  • `src/neurostack/tools/search_tools.py:157`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions