Dreaming (experimental)
Dreaming is the background memory consolidation pass inmemory-core.
It is called “dreaming” because the system revisits what came up during the day
and decides what is worth keeping as durable context.
Dreaming is experimental, opt-in, and off by default.
What dreaming does
- Tracks short-term recall events from
memory_searchhits inmemory/YYYY-MM-DD.md. - Scores those recall candidates with weighted signals.
- Promotes only qualified candidates into
MEMORY.md.
Promotion signals
Dreaming combines four signals:- Frequency: how often the same candidate was recalled.
- Relevance: how strong recall scores were when it was retrieved.
- Query diversity: how many distinct query intents surfaced it.
- Recency: temporal weighting over recent recalls.
Signal weights
| Signal | Weight | Description |
|---|---|---|
| Frequency | 0.35 | How often the same entry was recalled |
| Relevance | 0.35 | Average recall scores when retrieved |
| Diversity | 0.15 | Count of distinct query intents that surfaced it |
| Recency | 0.15 | Temporal decay (14-day half-life) |
How it works
- Recall tracking — Every
memory_searchhit is recorded tomemory/.dreams/short-term-recall.jsonwith recall count, scores, and query hash. - Scheduled scoring — On the configured cadence, candidates are ranked using weighted signals. All threshold gates must pass simultaneously.
- Promotion — Qualifying entries are appended to
MEMORY.mdwith a promoted timestamp. - Cleanup — Already-promoted entries are filtered from future cycles. A file lock prevents concurrent runs.
Modes
dreaming.mode controls cadence and default thresholds:
| Mode | Cadence | minScore | minRecallCount | minUniqueQueries |
|---|---|---|---|---|
off | Disabled | — | — | — |
core | Daily 3 AM | 0.75 | 3 | 2 |
rem | Every 6 hours | 0.85 | 4 | 3 |
deep | Every 12 hours | 0.80 | 3 | 3 |
Scheduling model
When dreaming is enabled,memory-core manages the recurring schedule
automatically. You do not need to manually create a cron job for this feature.
You can still tune behavior with explicit overrides such as:
dreaming.frequency(cron expression)dreaming.timezonedreaming.limitdreaming.minScoredreaming.minRecallCountdreaming.minUniqueQueries