You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 28630a9
Browse filesBrowse the repository at this point in the historyBrowse files
feat(memory): provenance-gated memory with dreaming on by default (#114819)
* feat(memory): add provenance and recall metadata to the memory index
* feat(memory): provenance-gated promotion and capture hygiene
* feat(dreaming): LLM consolidation with deterministic gates, on by default
* feat(active-memory): deterministic recall lane with escalation default
* feat(memory): user model file and standing intents
* docs(memory): document the memory architecture
* fix(memory): live-QA fixes — metadata writers, provenance classes, intent scope, claim accumulation
Copy file name to clipboardExpand all lines: docs/concepts/agent-workspace.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,8 +70,8 @@ Standard files OpenClaw expects inside the workspace:
70
70
<Accordiontitle="SOUL.md - persona and tone">
71
71
Persona, tone, and boundaries. Loaded every session. Guide: [SOUL.md personality guide](/concepts/soul).
72
72
</Accordion>
73
-
<Accordiontitle="USER.md - who the user is">
74
-
Who the user is and how to address them. Loaded every session.
73
+
<Accordiontitle="USER.md - directive-based user model (optional)">
74
+
Stable preferences, communication style, relationships, and active-project context. Write entries as dated active or superseded directives. Loaded every session with a separate 4,000-character budget. See [User model](/concepts/user-model).
Curated long-term memory: durable facts, preferences, decisions, and short summaries. Keep detailed logs in `memory/YYYY-MM-DD.md` so memory tools can retrieve them on demand without injecting them into every prompt. Only load `MEMORY.md` in the main, private session (not shared/group contexts). See [Memory](/concepts/memory) for the workflow and automatic memory flush.
92
+
Curated long-term memory: durable non-profile facts, decisions, and short summaries. Keep detailed logs in `memory/YYYY-MM-DD.md` so memory tools can retrieve them on demand without injecting them into every prompt. Only load `MEMORY.md` in the main, private session (not shared/group contexts). See [Memory](/concepts/memory) for the workflow and automatic memory flush.
Workspace-specific skills. Highest-precedence skill location for that workspace, ahead of project agent skills, personal agent skills, managed skills, bundled skills, and `skills.load.extraDirs` when names collide.
@@ -100,7 +100,7 @@ Standard files OpenClaw expects inside the workspace:
100
100
</AccordionGroup>
101
101
102
102
<Note>
103
-
If a bootstrap file is missing, OpenClaw injects a "missing file" marker into the session and continues. Large bootstrap files are truncated when injected; adjust limits with `agents.defaults.bootstrapMaxChars` (default: `20000`) and `agents.defaults.bootstrapTotalMaxChars` (default: `60000`). `openclaw setup` can recreate missing defaults without overwriting existing files.
103
+
If a required bootstrap file is missing, OpenClaw injects a "missing file" marker into the session and continues. Optional `USER.md` and `MEMORY.md` files are omitted when absent. Large bootstrap files are truncated when injected; adjust general limits with `agents.defaults.bootstrapMaxChars` (default: `20000`) and `agents.defaults.bootstrapTotalMaxChars` (default: `60000`). `USER.md` keeps its separate 4,000-character cap. `openclaw setup` can recreate missing defaults without overwriting existing files.
104
104
</Note>
105
105
106
106
## What is NOT in the workspace
@@ -109,7 +109,7 @@ These live under `~/.openclaw/` and should NOT be committed to the workspace rep
109
109
110
110
-`~/.openclaw/openclaw.json` (config)
111
111
-`~/.openclaw/state/openclaw.sqlite` (shared workspace setup state and attestations)
112
-
-`~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite` (model auth profiles, routing state, and other agent-scoped durability)
112
+
-`~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite` (model auth profiles, routing state, standing intents, and other agent-scoped durability)
113
113
-`~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite` (session rows, transcripts, and per-agent runtime state)
Copy file name to clipboardExpand all lines: docs/concepts/dreaming.md
+43-4Lines changed: 43 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,15 +11,22 @@ read_when:
11
11
Dreaming is the background memory consolidation system in `memory-core`. It moves strong short-term signals into durable memory while keeping the process explainable and reviewable.
12
12
13
13
<Note>
14
-
Dreaming is **opt-in** and disabled by default.
14
+
Dreaming is enabled by default. Set
15
+
`plugins.entries.memory-core.config.dreaming.enabled: false` to disable it.
-**Rewrite preimages** in SQLite-backed plugin state before an accepted `MEMORY.md` rewrite.
20
22
-**Human-readable output** in `DREAMS.md` (or an existing `dreams.md`) and optional phase report files under `memory/dreaming/<phase>/YYYY-MM-DD.md`.
21
23
22
24
Long-term promotion still writes only to `MEMORY.md`.
25
+
Each newly promoted entry carries trailing recall metadata derived from the
26
+
candidate: up to three concept tags in `<!-- trigger: phrase one, phrase two -->`
27
+
and a bounded `<!-- importance: N -->` value from 1 to 10. Consolidation keeps
28
+
existing annotated entries byte-for-byte unless it explicitly merges or
29
+
supersedes them.
23
30
24
31
## Phase model
25
32
@@ -50,15 +57,44 @@ Dreaming runs three cooperative phases per sweep, in order: light -> REM -> deep
50
57
<Accordiontitle="Deep phase">
51
58
- Ranks candidates with weighted scoring and threshold gates (`minScore`, `minRecallCount`, `minUniqueQueries` must all pass).
52
59
- Rehydrates snippets from live daily files before writing, so stale/deleted snippets are skipped.
53
-
- Appends promoted entries to `MEMORY.md`.
60
+
- Passes gated owner and agent-derived candidates to a consolidation subagent with the current `MEMORY.md`.
61
+
- Rewrites `MEMORY.md` only when the result preserves enough prior entries, includes candidate source references, and fits the bootstrap budget.
62
+
- Falls back to the previous append-only promotion path when the model is unavailable or the rewrite fails validation.
54
63
- Writes a `## Deep Sleep` summary into `DREAMS.md` and optionally `memory/dreaming/deep/YYYY-MM-DD.md`.
55
64
56
65
</Accordion>
57
66
</AccordionGroup>
58
67
59
68
## Session transcript ingestion
60
69
61
-
Dreaming can ingest redacted session transcripts into the dreaming corpus. When available, transcripts feed the light phase alongside daily memory signals and recall traces. Personal and sensitive content is redacted before ingestion.
70
+
Dreaming can ingest redacted session transcripts into the dreaming corpus. Only interactive sessions are eligible. Cron, heartbeat, subagent, and unknown sessions stay out of durable candidate ingestion. Personal and sensitive content is redacted before ingestion, and runtime-marked recalled context is removed so recalled snippets cannot be learned again as new memory.
71
+
72
+
## Consolidation safety
73
+
74
+
The deterministic score, recall-count, and query-diversity thresholds remain
75
+
the candidate gate. Consolidation runs only after those gates pass.
76
+
77
+
Before building the consolidation prompt, `memory-core` removes candidates
78
+
whose indexed provenance is `untrusted` or `system`. This is a structural
79
+
taint gate, not a score penalty. Eligible candidates include their origin,
80
+
session kind, observation time, optional supersession key, and daily-note
81
+
source reference.
82
+
83
+
An accepted rewrite must:
84
+
85
+
- preserve prior entries within `phases.deep.maxPriorEntryLossFraction`
86
+
- include every promoted candidate's `Source: path#Lx-Ly` reference
87
+
- stay within the `MEMORY.md` bootstrap-safe file budget
88
+
- parse as the expected structured response
89
+
90
+
Before the file changes, the previous `MEMORY.md` is stored in SQLite-backed
91
+
plugin state. `DREAMS.md` receives added, merged, and superseded counts plus
92
+
short diff-style highlights. This makes each rewrite reviewable without
93
+
turning the Dream Diary into a promotion source.
94
+
95
+
Background consolidation is informed by sleep-time compute
96
+
(arXiv:2504.13171). The provenance and reflection boundary follows the durable
97
+
memory framing in the Generative Agents research.
62
98
63
99
## Dream Diary
64
100
@@ -196,9 +232,12 @@ When enabled, `memory-core` auto-manages one cron job for a full dreaming sweep,
196
232
197
233
All settings live under `plugins.entries.memory-core.config.dreaming`.
0 commit comments