Memory & tools
Three stores, three failure modes
An agent keeps three separate stores with different lifetimes: a small always-injected memory of declarative facts (4,096 characters here, 82% full), a large on-demand library of procedural skills (590 files, read only when matched), and an episodic session database (146 MB) that is summarised rather than remembered. Each fails differently: memory by running out of budget or being clobbered during consolidation, skills by going stale, sessions by losing detail to compaction.
“Does the agent remember this?” is the wrong question. There are three answers, because there are three stores, and they expire on completely different clocks.
The 4,096-character budget
On this machine the always-injected memory is 3,382 characters of a 4,096 budget — 82% full. The user profile is 1,580 of 2,750. Both are counted in characters, which matters more than it sounds.
That budget is tiny. It is not a note-taking app; it is the block that gets pasted into every single prompt, forever. At 82% full, the interesting behaviour is not “can it remember” but “what does it throw away to make room”.
The budget is characters, not bytes
The same store on disk:
$ wc -m "$LOCALAPPDATA/hermes/memories/MEMORY.md" # 3382 characters
$ wc -c "$LOCALAPPDATA/hermes/memories/MEMORY.md" # 5878 bytes
A 1.74× gap, because this memory is written in Chinese and UTF-8 spends three bytes per character. If you budget by file size — the number every file manager shows you — you will believe you have 2,500 characters of headroom when you have 714.
This is the first place an agent memory system lies to its operator, and it lies in the flattering direction.
Where memory actually dies: consolidation
Every memory store eventually needs compacting — merge duplicates, drop what went stale, rewrite the survivors shorter. That rewrite is a write, and writes can go wrong.
The filenames on this machine are the evidence:
MEMORY.md.bak_20261117_182413_deepclean_r193
MEMORY.md.bak_20261117_182423_deepclean_r193
MEMORY.md.bak_20261117_182430_deepclean_r193
MEMORY.md.bak_20261117_182438_deepclean_r193
Four backups, same revision number, written inside twenty-five seconds. That is not four consolidations — that is one consolidation being retried four times, each attempt writing a fresh backup before it ran. Fifteen such backups exist in total, numbered r188 to r194.
The lesson is not “consolidation is dangerous”. It is that a consolidation pass that runs more than once is indistinguishable, from the outside, from one that keeps succeeding. The revision number in the filename is what tells you the truth.
Skills are memory too, and they are read on demand
The second store is procedural: 590 SKILL.md files under 66 top-level directories. None of them is injected into the prompt. They are matched by description and loaded only when relevant — which is exactly why they can hold far more than 4,096 characters, and exactly why they rot silently.
A stale memory entry gets injected into every prompt, so you notice it quickly. A stale skill sits on disk until the day it matches, and then it confidently gives you the wrong procedure with full formatting.
Sessions are not memory
The third store is the session database: 146 MB of SQLite on this machine, plus 14 session files. This is the one people mistake for memory, because it is the one that contains everything.
It does not survive as memory. A long session gets compacted — this article was written in a session where 462 earlier messages were condensed into a summary. The summary is accurate about the shape of the conversation and lossy about the details, which means an agent that “remembers” from a summary can be confidently wrong about a specific number it no longer has.
How you know it worked
After you change anything in these stores, three checks:
$ wc -m "$LOCALAPPDATA/hermes/memories/MEMORY.md" # under 4096, and you know the delta
$ grep -c '§' "$LOCALAPPDATA/hermes/memories/MEMORY.md" # entry count — 22 here
$ ls -1 "$LOCALAPPDATA/hermes/memories"/MEMORY.md.bak* | wc -l # 15 backups
- Characters under budget, and you can say by how much. Not “it saved” — the exact number, because the next add is what will fail.
- Entry count matches what you meant. Merging two entries and adding one should leave the count one lower. If it is unchanged, the merge silently did nothing.
- A new session actually receives it. The real proof is the injected block at the start of the next session, not the file on disk. Files prove it was written; only a fresh session proves it is injected.
How to undo it
- Memory edits: restore from the numbered backup —
cp MEMORY.md.bak_<timestamp>_deepclean_r<NNN> MEMORY.md— with the app stopped. The app rewrites this file; restoring underneath a running process gets overwritten. - A bad consolidation: pick the newest backup whose size and entry count look sane, not simply the newest file. r193 was written four times in twenty-five seconds; the last one is not automatically the good one.
- Skills: they are files, so they belong in git. A skill directory that is not versioned is the only copy you have.
- The session database: do not hand-edit it. Stop the process, copy the file, investigate a copy. A half-written SQLite file is a corrupt SQLite file.
What we have not verified
- Whether the injection survives a version upgrade with a different budget. We have only seen one budget value on one version.
- Whether consolidation ever drops an entry it should have kept. We have the backups to prove retries happened; we have not diffed every r-number against its predecessor to prove content loss.
- How the budget is counted for emoji and combining characters.
wc -mand the tool’s own counter agreed on this store, which is not proof they agree on everything.
Related
Questions people actually ask
How much can an agent actually remember?
Measured on this machine: 3,382 of 4,096 characters of always-injected memory (82%), 1,580 of 2,750 in the user profile — about 1,000 entries if you write them as terse declarative facts rather than prose.
Does memory count in bytes or characters?
Characters. The same store is 3,382 characters and 5,878 bytes on disk, because Chinese characters take three bytes each in UTF-8 — budget by file size and you over-estimate headroom by 74%.
What happens when memory is full?
A plain add is rejected. The tool applies a batch atomically and checks the limit only on the final result, so the way through is one call that removes stale entries and adds the new one.
Are skills the same thing as memory?
No. Skills are procedural and loaded on demand from disk (590 files here); memory is declarative and injected into every prompt. A skill can be stale for months without anyone noticing, because nobody reads it until it matches.
Sources
Last checked: 2026-11-18 · Every number on this page was read from this machine on 2026-11-18: MEMORY.md 3,382 chars / 5,878 bytes, 22 entries, 15 consolidation backups, 590 SKILL.md, state.db 146 MB. Re-run the four commands in the last section to check them yourself.