Skip to content

chore: extract memory plugin to liyoungc/hermes-memory-plugin#4

Merged
liyoungc merged 1 commit intomainfrom
feat/memory-extracted
May 2, 2026
Merged

chore: extract memory plugin to liyoungc/hermes-memory-plugin#4
liyoungc merged 1 commit intomainfrom
feat/memory-extracted

Conversation

@liyoungc
Copy link
Copy Markdown
Owner

@liyoungc liyoungc commented May 2, 2026

Summary

Removes the 25 memory-system implementation files merged in #2 (W1-W4-2). The code now lives in a dedicated repo: liyoungc/hermes-memory-plugin.

Why extract

  • Upstream tracking: git pull upstream/main from NousResearch becomes trivial again — no merge conflicts in plugins/memory/sqlite_vec/ or tests/plugins/memory/.
  • Reusable install: A vanilla NousResearch fork can pick up the plugin via one script.
  • Clean spec/impl separation: Spec edits and prompt iterations land in one repo, not buried in a 4000-LOC fork PR.

What moved

Path (was here, in this fork) New location
plugins/memory/sqlite_vec/ plugins/memory/sqlite_vec/ (in plugin repo)
plugins/memdebug/ plugins/memdebug/
plugins/memreview/ plugins/memreview/
scripts/import_md.py scripts/import_md.py
scripts/cron/{weekly_promotion,weekly_apply}.py scripts/cron/
scripts/cutover/cutover.sh scripts/cutover/
tests/plugins/memory/test_*.py same paths
tests/plugins/test_{memdebug,memreview}.py same
tests/scripts/test_import_md.py same

25 files, 5,454 LOC removed. No core hermes-agent files modified — these were all additive in #2.

How to install on a fresh checkout

gh repo clone liyoungc/hermes-memory-plugin ~/Projects/hermes-memory-plugin
~/Projects/hermes-memory-plugin/install.sh ~/Projects/hermes-agent

The installer:

  1. Symlinks the three plugin dirs into hermes-agent/plugins/.
  2. Writes docker-compose.override.yml with bind mounts (so docker picks up live edits without rebuild).
  3. Copies weekly_promotion.py / weekly_apply.py to ~/.hermes/scripts/ (scheduler hard-binds that path).
  4. Idempotently registers the two cron jobs.

What also changed in the plugin repo (beyond verbatim move)

A _config.py was added that externalizes hardcoded constants (PHI_BLACKLIST_CHANNELS, FAST_TRACK_DAYS, EXTRACT_MODEL/TEMPERATURE, PROMOTION_*, ENTITY_PREFIX, memory_review_channel_name) to ~/.hermes/config.yaml memory.sqlite_vec.*. Defaults match the previous hardcoded values exactly. PHI_BLACKLIST keeps a hard floor on cmio/cbme/medicine (warn if user list omits them).

EXTRACT_PROMPT and PROMOTION_PROMPT stay hardcoded — they ARE the contract.

Deploy state on chococlaw

Already migrated (this PR documents the corresponding fork-side change):

  • ~/Projects/hermes-memory-plugin/ cloned
  • install.sh ran successfully — symlinks + override.yml in place
  • Gateway force-recreated, picked up bind mount
  • Smoke verified: /memdebug 我太太生日 → top-1 **生日**: 3/19 (sim=0.604), unchanged from pre-extraction baseline
  • Row counts unchanged: episodes=0, semantic_facts=25, vec_facts=25
  • DB backed up at ~/.hermes/memories/memory.db.before-extract-*

Test plan

  • install.sh smoke-tested locally
  • Symlinks resolve on chococlaw
  • Container imports the plugin via bind mount
  • /memdebug retrieval result identical to pre-extraction
  • Row counts unchanged
  • One full weekly promotion cycle observed on the new layout (will fire 2026-05-09 03:00 UTC+8)

Rollback

If anything breaks:

docker compose stop gateway dashboard
git revert HEAD                          # the deletion commit
~/Projects/hermes-memory-plugin/uninstall.sh ~/Projects/hermes-agent
docker compose up -d --force-recreate gateway dashboard

The DB is never touched. Worst case ~10 min downtime.

🤖 Generated with Claude Code

Removes the 25 implementation files merged in #2 (W1-W4-2). The code
now lives in a dedicated repo (liyoungc/hermes-memory-plugin) installed
via:

    git clone git@github.com:liyoungc/hermes-memory-plugin.git ~/Projects/hermes-memory-plugin
    ~/Projects/hermes-memory-plugin/install.sh ~/Projects/hermes-agent

The install symlinks plugins/memory/sqlite_vec, plugins/memdebug, and
plugins/memreview from the plugin repo into hermes-agent/plugins/. For
docker-based deploys, install.sh additionally writes a
docker-compose.override.yml with bind mounts so the running container
picks up live edits without an image rebuild.

Why extract:
  - git pull upstream/main on this fork is now trivial again (no merge conflicts)
  - Plugin code can be installed on a vanilla NousResearch fork
  - Spec edits and prompt iterations land in one place

DB at ~/.hermes/memories/memory.db is untouched. Cron jobs in
~/.hermes/cron/jobs.json migrate via install.sh.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@liyoungc liyoungc merged commit 3103142 into main May 2, 2026
2 of 7 checks passed
@liyoungc liyoungc deleted the feat/memory-extracted branch May 2, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant