Skip to content

[memory-wiki] fix: prioritize user topics over tool and system noise - #48

Closed
teknium1 wants to merge 1 commit into
mainfrom
port/memory-wiki-3
Closed

teknium1 wants to merge 1 commit into
mainfrom
port/memory-wiki-3

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Ported from NousResearch/hermes-memory-wiki#3 by @tillstriegel. hermes-memory-wiki moved into this monorepo (see the README), so this is the same commit(s) applied under memory-wiki/, authorship kept. Review continues here.


Original description:

Summary

Prioritize what the user actually discussed over execution noise in Memory Wiki topics.

  • Derive subjects from every user turn, with session titles as secondary evidence and an intentional title-only fallback. Exclude unverified previews, tool/system/developer text and tool-call metadata from topic creation/scoring.
  • Preserve explicitly discussed identifiers (including snake_case/dotted tool names), packages, commands, paths and plain-language phrases. Read text blocks from structured message content without interpreting image payloads or metadata as prose.
  • Rank user-supported topics first across subjects and daily logs; machine repetition cannot create topics or boost scores/order. Message counts remain factual activity metadata.
  • Prefer user snippets. Assistant text can provide matching context for existing topics, not introduce new ones. Filter noisy daily work items and deduplicate repeated assistant support.

Verification

  • Baseline: 21 tests passed.
  • Final: 38 tests passed with HERMES_AGENT_REPO=<hermes-agent-checkout> <hermes-python> -m pytest tests/ -o 'addopts=' -q.
  • Synthetic SQLite SessionDB + FastAPI coverage for overview, subjects/query/detail, days/day detail and read-only database guarantees; noisy-role/repetition, later user turns, explicit tool names, empty/title-only sessions, ranking limits, multimodal text and empty/punctuation-only assistant regressions.
  • npm run check and git diff --check pass.
  • Independent defect-first exact-diff review; findings repaired and regression-tested before publication.

Checks / CI state

  • This repository has no CI configured: GET /repos/NousResearch/hermes-memory-wiki/actions/workflows returns zero workflows, and the exact head below reports zero check runs and zero commit statuses (statusCheckRollup: []). There is no upstream check for this head that is passing, failing or pending — none exists, and none is claimed here. Required-check/branch-protection state could not be read with the available token (the branch-protection endpoint returns 404 for a non-admin collaborator), so it is reported as unverified rather than absent.
  • All verification for this exact head is local, reproduced by the commands in the Development section of README.md at head 9ae86a3d8005688e0c299b0e28f655e760d68f64: 38 passed, npm run check clean, git diff --check origin/main...HEAD clean, working tree clean.

Scope and limitations

Backend relevance, tests and documentation only. No cache/loading/UI changes; independent of the separate performance PR and based directly on upstream main (single commit on top of 9bc3913, no commits from perf/search-cache-feedback). Diff is exactly four files: README.md, dashboard/memory_wiki_core.py, tests/test_memory_wiki_core.py, tests/test_topic_relevance.py.

Extraction remains deterministic English-oriented regex/keyword heuristics, not semantic topic understanding. Existing bounded history and truncation limits remain (sessions leaving the loaded window are out of scope). No LLM/network ranking, new dependencies, settings, or API response-key changes. No live session data is included. Not merged, installed or activated.

Infographic

port

@teknium1 teknium1 added the memory-wiki memory-wiki plugin label Oct 11, 2026
teknium1 added a commit that referenced this pull request Nov 20, 2026
…-day aggregation

#48 predates #49 (per-session cache), #262 (per-day buckets) and the Chinese
subject support, so its commit landed with main's side of those hunks. This
applies its rule across them:

- extraction: only user turns and the title create or score subjects; previews,
  tool names and tool calls do not. Title text (and title quotes) rank but do not
  count as user-raised. The unquoted Han phrase still comes only from the first
  non-empty user text, and the Han candidate cap stays.
- units carry `user_supported` in subject and per-day candidates; the day log
  ranks user-raised subjects first, as the subject list does.
- no fallback snippet: a subject lists only snippets that mention it. The cache
  sidecar moves to session_units-v2.json so v1 units (no user_supported, with a
  fallback) are rebuilt, not reused.
- snippet matching keeps Han characters, so Chinese subjects get their snippets.
- tests that relied on preview subjects, assistant-only sessions or tool work
  items now state the new rule.
@teknium1

Copy link
Copy Markdown
Contributor Author

Landed on main via #451 (tip 5e11c86). To get it now: hermes plugins install NousResearch/hermes-official-plugins#<plugin> --force; hermes plugins update follows once the catalog pin moves (in progress).

@teknium1 teknium1 closed this Nov 20, 2026
@teknium1

Copy link
Copy Markdown
Contributor Author

Credit to @tillstriegel, who wrote this fix (originally NousResearch/hermes-memory-wiki#3): his commit is carried with authorship in #436, which landed via #451.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

memory-wiki memory-wiki plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants