Mutable Memory State
Mutable Memory State
Four-tier memory architecture: curated semantic base, daily episodic streams, session handoffs, and procedural correction logs.
MEMORY πΎ Semantic Base
Curated, durable long-term facts, environment constants, and verified rules distilled from logs.
Purpose
Single source of truth for facts that persist across sessions and survive context compression.
Structure
| |
Write Protocol
- Trigger β User correction, explicit “remember this”, discovered environment fact
- Validate β Cross-reference with existing memory; reject contradictions
- Condense β Single declarative fact, no instructions
- Persist β
memory(action='add', target='memory', content=...)
Read Protocol
- Injected automatically into every turn
- Compact format:
key: valuepairs - Priority: user preferences > environment facts > procedural rules
YYYY-MM-DD π Episodic Stream
Daily chronological append-only scratchpads capturing volatile session context and tool traces.
Format
| |
Content Types
| Type | Prefix | Example |
|---|---|---|
| Session start | ## Session | ## Session 2026-06-07 14:32 |
| Tool trace | ### Tool | ### Tool: terminal β hugo build |
| Decision | ### Decision | ### Decision: Use Svelte 5 runes |
| Observation | ### Obs | ### Obs: Vite HMR caches stale files |
| Error | ### Error | ### Error: 429 rate limit on OpenRouter |
| Session end | ## Summary | ## Summary: Deployed v0.6.0 |
Retention
- Hot (0-7 days): Full detail, injected in context
- Warm (8-30 days): Summarized, searchable via
session_search - Cold (30+ days): Archived, only major decisions retained
Automation
Daily cron (llm-wiki-evolve) appends Research β Build β Deploy trace.
SESSION_LOG π Handoff Record
Summarized session records, commit pointers, and namespace metadata appended post-task.
Purpose
Enable seamless handoff between sessions, subagents, and human operator.
Format
| |
Storage
- Primary:
~/.hermes/logs/sessions/<session_id>.md - Index:
~/.hermes/state.db(SQLite, session_search FTS5)
FEEDBACK-LOG π Procedural Corrections
Tracked mistakes, stylistic fixes, and lessons learned to prevent error looping.
Entry Schema
| |
Categories
| Category | Examples |
|---|---|
| tool_usage | Wrong tool, missing flags, background without notify |
| communication | Verbose, wrong tone, missed clarification |
| logic | False assumption, missed edge case, circular reasoning |
| workflow | Skipped skill load, forgot memory write, no verification |
| config | Wrong model, missing env, bad cron schedule |
Loop Prevention
- On error β Create FEEDBACK-LOG entry immediately
- On skill use β Check FEEDBACK-LOG for relevant entries first
- On session start β Review last 5 feedback entries
- Monthly β Audit unresolved entries; escalate patterns
Memory Flow Diagram
| |
Cross-References
- Identity Anchors β SALIENCE prioritizes what enters MEMORY
- Orchestration β AGENTS reads SESSION_LOG for handoff
- Autonomic β HEARTBEAT prunes YYYY-MM-DD on schedule
- Spec-Driven β PLAN derives from SESSION_LOG outcomes
Mutable Memory is the only layer designed for continuous automatic evolution. The system rewrites itself daily.