Memory: byte-budgeted index, memory_search (BM25), auto extraction on compaction/exit

This commit is contained in:
hermes committed 2026-11-30 12:46:16 +00:00
1 parent 59bf45f41d
commit 8705b128ea
8 files changed
+311 -39

No files matched your search

+7 -4
View File
@@ -142,10 +142,13 @@ Builtin commands win when names collide.
## Memory
The agent keeps notes across sessions with `memory_write` / `memory_forget`. `MEMORY.md` (one hook line per
topic, max 50) is in the system prompt; the full text lives in `topics/<slug>.md` and is read on demand.
Global: `~/.hx/memory/`, project: `.hx/memory/` (add it to `.gitignore`). The index is read at session
start, so new entries show up next session. `hx prefix` shows its size.
The agent keeps notes across sessions with `memory_write` / `memory_forget` / `memory_search`. Default scope is
project (`.hx/memory/`, add it to `.gitignore`); global is `~/.hx/memory/`. `MEMORY.md` holds one hook line per
topic, the full text lives in `topics/<slug>.md`. No entry cap: the system prompt shows the most recently
used/written hooks up to 2 KB per scope plus "+N more"; `memory_search` (BM25 over all topics) finds the rest and
refreshes recency. The prompt tells the agent to save decisions, conventions and corrections immediately. On
compaction and on exit, one extra model call extracts up to 5 durable facts from the transcript and saves them
automatically. The index is read at session start. `hx prefix` shows its size.
## Lens