Hermes Dreaming
Background memory consolidation for
Hermes.
Curates scarce durable memory through a three-phase
Light → Deep → REM cycle — promoting very little,
replacing what is superseded, and keeping MEMORY.md
compact, current, and high-signal.
Installation
Install Hermes Dreaming into the same Python environment that runs Hermes, then enable the plugin in your Hermes config.
Install
Use the Hermes plugin manager — it handles cloning, environment setup, and enabling automatically:
hermes plugins install alejandroiglesias/hermes-dreaming
To update later:
hermes plugins update hermes-dreaming
Enable the plugin
Add Hermes Dreaming to ~/.hermes/config.yaml:
plugins: enabled: - hermes-dreaming
Verify
From the terminal:
hermes dreaming status
Or from within a Hermes session:
/dreaming status
Commands
Hermes Dreaming exposes commands as Hermes slash commands (for use within sessions) and as CLI subcommands.
Slash Commands
MEMORY.md or USER.md.CLI Commands
hermes dreaming run # full cycle hermes dreaming review # dry-run hermes dreaming status # show state hermes dreaming compact # cleanup pass hermes dreaming install-cron # register nightly 03:00 cron job
install-cron options
hermes dreaming install-cron --schedule "0 3 * * *"
Configuration
Add a dreaming block to ~/.hermes/config.yaml. All fields are optional — defaults are conservative.
dreaming: enabled: true schedule: "0 3 * * *" max_changes_per_run: 3 recent_sessions_limit: 14
false to disable without uninstalling.How It Works
Each dreaming run executes three cooperative phases. Only the REM phase can mutate durable memory.
Phase 1 — Light Sleep
Cheap and conservative. Scans recent sessions and extracts compact candidate signals. Never writes durable memory.
- Reads the most recent sessions from the Hermes session DB (up to
recent_sessions_limit) - Extracts candidates: preferences, corrections, project facts, recurring workflows, supersession signals
- Deduplicates obvious repeats and records source session IDs
- Writes staged candidates to
candidates.jsonl
Candidate types:
| Type | Description |
|---|---|
user_preference
|
A stable preference about tools, workflows, or approaches |
communication_preference
|
How the user prefers to receive information |
project_fact
|
A stable fact about a project or environment |
decision
|
A decision the user has made |
correction
|
User corrected the assistant — strong signal |
recurring_workflow
|
A workflow appearing repeatedly across sessions |
supersession_signal
|
Evidence that an existing memory may be outdated |
stale_signal
|
Evidence that an existing memory is no longer relevant |
skill_candidate
|
Something better represented as a skill than memory |
Phase 2 — Deep Sleep
Reflects on staged candidates against existing durable memory. Does not write memory.
- Identifies recurring themes and detects contradictions
- Identifies superseded memories (older entries overridden by newer statements)
- Distinguishes durable preferences from session-specific details
- Flags candidates better suited to skills than durable memory
- Suggests canonical phrasings for potential merged entries
Phase 3 — REM Sleep
The only phase allowed to mutate durable memory. Applies at most max_changes_per_run high-confidence operations, in preference order:
MEMORY.md and USER.md are created at ~/.hermes/dreaming/backups/. All operations are logged to DREAMS.md.Scoring Model
The REM phase scores each candidate using a weighted model. The agent computes scores via LLM judgment; this module defines the threshold values enforced as hard gates.
score = future_usefulness # will this improve future answers often? + query_diversity # how many different types of future tasks benefit? + stability # is it likely to remain true? + recurrence # has it appeared across multiple sessions? + recency # how recently did this signal appear? + explicitness # did the user state it directly? + correction_signal # did the user correct the assistant? + actionability # will this change what the assistant says or does? + compression_value # does this compactly summarize many observations? − character_cost # how much prompt budget will it consume? − duplication # is it already covered? − volatility # is it likely to change soon? − sensitivity # does it involve sensitive attributes?
Dimensions
Thresholds
| Operation | Threshold | Additional requirement |
|---|---|---|
add
|
score ≥ 0.88 | — |
replace
|
score ≥ 0.80 | supersession confidence ≥ 0.75 |
remove
|
confidence ≥ 0.85 | — |
merge
|
overlap ≥ 0.80 | merged entry is shorter or clearer |
Run-level limits
| Limit | Default | Description |
|---|---|---|
max_changes_per_run
|
3 | Total durable mutations per run |
max_adds_per_run
|
1 | Add operations are rate-limited extra strictly |
max_new_chars_per_run
|
250 | Net characters added to memory per run |
State Files
All runtime state lives under ~/.hermes/dreaming/. The JSONL files are machine-readable sidecars and are not injected into the prompt.
DREAMS.md
The human-readable audit diary. Records every run — what was scanned, proposed, applied, and rejected. Not used as a promotion source.
## 2026-05-01 03:00 — Nightly Dream ### Light Sleep - Scanned 14 recent sessions. - Staged 12 candidates. Deduped 4 repeats. ### REM Sleep Memory operations: 1. REPLACE user memory Old: Ale prefers long explanatory answers by default. New: Ale prefers concise answers first, with detail added when useful. Reason: newer explicit preference supersedes older style guidance. Summary: 2 durable memory changes applied. 10 candidates rejected.
Design Philosophy
Hermes Dreaming treats durable memory as scarce prompt budget: each run consolidates recent session traces into a few compact, high-signal memories, or deliberately writes nothing.
Every character has a permanent prompt cost.
Dreaming must maximise future usefulness per character.
What it is
- A general Hermes plugin — not a memory provider
- A scheduled and manual memory consolidation process
- A curatorial layer over Hermes' existing built-in memory
- A tool for keeping
MEMORY.md/USER.mdcompact, current, and high-signal
What it is not
- Not a replacement for Hermes' memory provider system
- Not a vector database or temporal knowledge graph
- Not a replacement for Honcho, Hindsight, Supermemory, etc.
- Not a nightly memory-append process
- Not dependent on any external infrastructure
Good vs bad durable memory
| ❌ Reject | ✓ Promote |
|---|---|
| Ale discussed whether Dreaming should have review or auto mode. | Ale prefers simple, packaged, low-maintenance tools over custom infrastructure. |
| Ale asked about idle naps and decided not to implement them. | Ale is cost-sensitive about background tasks; prefers scheduled over idle LLM activity. |
Compatibility with memory providers
Hermes Dreaming coexists with any external memory provider. The intended layering:
- Provider (Honcho, Hindsight, etc.) — broader long-term memory
- MEMORY.md / USER.md — always-prompt-visible premium memory
- Dreaming — curator of premium memory
Contributing
Hermes Dreaming is open source under the MIT license. Contributions, bug reports, and feature requests are welcome.
Bug reports & feature requests
Please open an issue on GitHub:
Contributing code
- Fork the repository on GitHub
- Create a branch for your change
- Run the test suite:
pytest tests/ - Open a pull request against
main
Security vulnerabilities
Do not open a public issue. See the Security Policy for responsible disclosure instructions.