|
1 | 1 | --- |
2 | | -summary: "CLI reference for `openclaw memory` (status/index/search/promote/promote-explain/rem-harness/rem-backfill)" |
| 2 | +summary: "CLI reference for `openclaw memory` (status/index/search/promote/promote-explain/rem-harness/rem-backfill/session-backfill)" |
3 | 3 | read_when: |
4 | 4 | - You want to index or search semantic memory |
5 | 5 | - You're debugging memory availability or indexing |
@@ -139,6 +139,50 @@ openclaw memory rem-backfill --rollback [--rollback-short-term] [--json] |
139 | 139 | - `--rollback-short-term`: remove previously staged grounded short-term |
140 | 140 | candidates. |
141 | 141 |
|
| 142 | +## `memory session-backfill` |
| 143 | + |
| 144 | +Distill retained session history through the same provenance and short-term |
| 145 | +staging pipeline used by dreaming. The default is a read-only preview, ordered |
| 146 | +from the oldest unprocessed day to the newest. |
| 147 | + |
| 148 | +```bash |
| 149 | +openclaw memory session-backfill --agent <id> [--from YYYY-MM-DD] [--to YYYY-MM-DD] \ |
| 150 | + [--limit-days <n>] [--archive-files <path...>] [--rem | --apply] [--json] |
| 151 | +openclaw memory session-backfill --agent <id> --rollback [--json] |
| 152 | +``` |
| 153 | + |
| 154 | +| Flag | Default | Effect | |
| 155 | +| --------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------- | |
| 156 | +| `--from YYYY-MM-DD` | | Include messages on or after this day in the dreaming timezone. | |
| 157 | +| `--to YYYY-MM-DD` | | Include messages on or before this day in the dreaming timezone. | |
| 158 | +| `--limit-days <n>` | `92` | Process at most this many hash-untracked days, oldest first. | |
| 159 | +| `--archive-files <path...>` | | Also inspect foreign transcript files as untrusted input; embedded owner metadata is not accepted. | |
| 160 | +| `--rem` | | Write deterministic grounded per-day previews to `DREAMS.md` only. | |
| 161 | +| `--apply` | preview only | Stage trusted candidates and write reversible `DREAMS.md` diary blocks. | |
| 162 | +| `--rollback` | | Remove all grounded backfill candidates and shared backfill diary blocks, including `rem-backfill` artifacts. | |
| 163 | +| `--json` | | Print machine-readable per-day counts and top candidates. | |
| 164 | + |
| 165 | +The command reads the selected agent's canonical session store, including |
| 166 | +retained SQLite transcript identities from session rotation. It uses the same |
| 167 | +tracked message hashes and per-run caps as live session ingestion, so repeated |
| 168 | +`--apply` runs skip already ingested messages. Owner and agent lines from the |
| 169 | +canonical store are eligible; tool output, web or non-owner input, and turns |
| 170 | +without trustworthy owner provenance are excluded. Foreign archive files have |
| 171 | +no authenticated owner-provenance contract, so their embedded ownership fields |
| 172 | +remain untrusted and cannot be staged. |
| 173 | + |
| 174 | +`--apply` writes only the session corpus under `memory/.dreams/`, short-term |
| 175 | +staging state, and reversible diary entries in `DREAMS.md`. It never writes |
| 176 | +`MEMORY.md` or `USER.md`; durable promotion remains a separate `memory promote` |
| 177 | +or dreaming decision. `--rem` and `--apply` are mutually exclusive. |
| 178 | + |
| 179 | +Backfill rollback is intentionally shared with `memory rem-backfill`: both |
| 180 | +commands use the same grounded-only staging class and diary markers. Run |
| 181 | +`session-backfill --rollback` only when you intend to clear both commands' |
| 182 | +grounded backfill artifacts from that workspace. Rollback preserves transcript |
| 183 | +ingestion cursors and tracked message hashes, so removed messages are not |
| 184 | +automatically re-ingested. |
| 185 | + |
142 | 186 | ## Dreaming |
143 | 187 |
|
144 | 188 | Dreaming is the background memory consolidation system with three cooperative |
|
0 commit comments