2026-01-15 06:12:54 +00:00
---
2026-04-06 05:09:57 +01:00
summary: "CLI reference for `openclaw memory` (status/index/search/promote/promote-explain/rem-harness)"
2026-01-15 06:12:54 +00:00
read_when:
- You want to index or search semantic memory
- You’ re debugging memory availability or indexing
2026-04-03 20:26:53 -07:00
- You want to promote recalled short-term memory into `MEMORY.md`
2026-01-31 16:04:03 -05:00
title: "memory"
2026-01-15 06:12:54 +00:00
---
2026-01-30 03:15:10 +01:00
# `openclaw memory`
2026-01-15 06:12:54 +00:00
2026-01-18 15:29:43 +00:00
Manage semantic memory indexing and search.
Provided by the active memory plugin (default: `memory-core` ; set `plugins.slots.memory = "none"` to disable).
2026-01-15 06:12:54 +00:00
Related:
2026-01-31 21:13:13 +09:00
2026-01-15 06:12:54 +00:00
- Memory concept: [Memory ](/concepts/memory )
2026-02-07 15:40:35 -05:00
- Plugins: [Plugins ](/tools/plugin )
2026-01-15 06:12:54 +00:00
## Examples
``` bash
2026-01-30 03:15:10 +01:00
openclaw memory status
openclaw memory status --deep
2026-04-04 08:52:33 +01:00
openclaw memory status --fix
2026-03-08 00:03:23 +08:00
openclaw memory index --force
openclaw memory search "meeting notes"
openclaw memory search --query "deployment" --max-results 20
2026-04-03 20:26:53 -07:00
openclaw memory promote --limit 10 --min-score 0.75
openclaw memory promote --apply
openclaw memory promote --json --min-recall-count 0 --min-unique-queries 0
2026-04-06 05:09:57 +01:00
openclaw memory promote-explain "router vlan"
openclaw memory promote-explain "router vlan" --json
openclaw memory rem-harness
openclaw memory rem-harness --json
2026-03-08 00:03:23 +08:00
openclaw memory status --json
2026-01-30 03:15:10 +01:00
openclaw memory status --deep --index
openclaw memory status --deep --index --verbose
openclaw memory status --agent main
openclaw memory index --agent main --verbose
2026-01-15 06:12:54 +00:00
```
2026-01-18 01:24:16 +00:00
## Options
2026-03-08 00:03:23 +08:00
`memory status` and `memory index` :
2026-01-18 15:29:43 +00:00
2026-03-08 00:03:23 +08:00
- `--agent <id>` : scope to a single agent. Without it, these commands run for each configured agent; if no agent list is configured, they fall back to the default agent.
2026-01-18 15:29:43 +00:00
- `--verbose` : emit detailed logs during probes and indexing.
2026-03-08 00:03:23 +08:00
`memory status` :
- `--deep` : probe vector + embedding availability.
- `--index` : run a reindex if the store is dirty (implies `--deep` ).
2026-04-04 08:52:33 +01:00
- `--fix` : repair stale recall locks and normalize promotion metadata.
2026-03-08 00:03:23 +08:00
- `--json` : print JSON output.
`memory index` :
- `--force` : force a full reindex.
2026-02-25 02:40:05 +00:00
`memory search` :
- Query input: pass either positional `[query]` or `--query <text>` .
- If both are provided, `--query` wins.
- If neither is provided, the command exits with an error.
2026-03-08 00:03:23 +08:00
- `--agent <id>` : scope to a single agent (default: the default agent).
- `--max-results <n>` : limit the number of results returned.
- `--min-score <n>` : filter out low-score matches.
- `--json` : print JSON results.
2026-02-25 02:40:05 +00:00
2026-04-03 20:26:53 -07:00
`memory promote` :
2026-04-04 14:25:20 +09:00
Preview and apply short-term memory promotions.
``` bash
openclaw memory promote [ --apply] [ --limit <n>] [ --include-promoted]
```
- `--apply` -- write promotions to `MEMORY.md` (default: preview only).
- `--limit <n>` -- cap the number of candidates shown.
- `--include-promoted` -- include entries already promoted in previous cycles.
Full options:
2026-04-05 17:16:49 -07:00
- Ranks short-term candidates from `memory/YYYY-MM-DD.md` using weighted promotion signals (`frequency` , `relevance` , `query diversity` , `recency` , `consolidation` , `conceptual richness` ).
- Uses short-term signals from both memory recalls and daily-ingestion passes, plus light/REM phase reinforcement signals.
- When dreaming is enabled, `memory-core` auto-manages one cron job that runs a full sweep (`light -> REM -> deep` ) in the background (no manual `openclaw cron add` required).
2026-04-03 20:26:53 -07:00
- `--agent <id>` : scope to a single agent (default: the default agent).
- `--limit <n>` : max candidates to return/apply.
- `--min-score <n>` : minimum weighted promotion score.
- `--min-recall-count <n>` : minimum recall count required for a candidate.
- `--min-unique-queries <n>` : minimum distinct query count required for a candidate.
- `--apply` : append selected candidates into `MEMORY.md` and mark them promoted.
- `--include-promoted` : include already promoted candidates in output.
- `--json` : print JSON output.
2026-04-06 05:09:57 +01:00
`memory promote-explain` :
Explain a specific promotion candidate and its score breakdown.
``` bash
openclaw memory promote-explain <selector> [ --agent <id>] [ --include-promoted] [ --json]
```
- `<selector>` : candidate key, path fragment, or snippet fragment to look up.
- `--agent <id>` : scope to a single agent (default: the default agent).
- `--include-promoted` : include already promoted candidates.
- `--json` : print JSON output.
`memory rem-harness` :
Preview REM reflections, candidate truths, and deep promotion output without writing anything.
``` bash
openclaw memory rem-harness [ --agent <id>] [ --include-promoted] [ --json]
```
- `--agent <id>` : scope to a single agent (default: the default agent).
- `--include-promoted` : include already promoted deep candidates.
- `--json` : print JSON output.
2026-04-03 20:26:53 -07:00
## Dreaming (experimental)
2026-04-05 18:41:53 +01:00
Dreaming is the background memory consolidation system with three cooperative
2026-04-05 17:16:49 -07:00
phases: **light ** (sort/stage short-term material), **deep ** (promote durable
facts into `MEMORY.md` ), and **REM ** (reflect and surface themes).
2026-04-03 20:26:53 -07:00
2026-04-05 18:41:53 +01:00
- Enable with `plugins.entries.memory-core.config.dreaming.enabled: true` .
2026-04-05 17:16:49 -07:00
- Toggle from chat with `/dreaming on|off` (or inspect with `/dreaming status` ).
- Dreaming runs on one managed sweep schedule (`dreaming.frequency` ) and executes phases in order: light, REM, deep.
- Only the deep phase writes durable memory to `MEMORY.md` .
- Human-readable phase output and diary entries are written to `DREAMS.md` (or existing `dreams.md` ), with optional per-phase reports in `memory/dreaming/<phase>/YYYY-MM-DD.md` .
2026-04-05 15:45:54 +01:00
- Ranking uses weighted signals: recall frequency, retrieval relevance, query diversity, temporal recency, cross-day consolidation, and derived concept richness.
- Promotion re-reads the live daily note before writing to `MEMORY.md` , so edited or deleted short-term snippets do not get promoted from stale recall-store snapshots.
2026-04-05 18:41:53 +01:00
- Scheduled and manual `memory promote` runs share the same deep phase defaults unless you pass CLI threshold overrides.
- Automatic runs fan out across configured memory workspaces.
2026-04-03 20:26:53 -07:00
2026-04-05 17:16:49 -07:00
Default scheduling:
2026-04-03 20:26:53 -07:00
2026-04-05 17:16:49 -07:00
- **Sweep cadence**: `dreaming.frequency = 0 3 * * *`
- **Deep thresholds**: `minScore=0.8` , `minRecallCount=3` , `minUniqueQueries=3` , `recencyHalfLifeDays=14` , `maxAgeDays=30`
2026-04-03 20:26:53 -07:00
Example:
``` json
{
"plugins" : {
"entries" : {
"memory-core" : {
"config" : {
"dreaming" : {
2026-04-05 18:41:53 +01:00
"enabled" : true
2026-04-03 20:26:53 -07:00
}
}
}
}
}
}
```
2026-01-18 15:29:43 +00:00
Notes:
2026-01-31 21:13:13 +09:00
2026-01-18 15:29:43 +00:00
- `memory index --verbose` prints per-phase details (provider, model, sources, batch activity).
2026-01-28 21:49:38 -05:00
- `memory status` includes any extra paths configured via `memorySearch.extraPaths` .
2026-03-02 20:58:20 -06:00
- If effectively active memory remote API key fields are configured as SecretRefs, the command resolves those values from the active gateway snapshot. If gateway is unavailable, the command fails fast.
- Gateway version skew note: this command path requires a gateway that supports `secrets.resolve` ; older gateways return an unknown-method error.
2026-04-05 17:16:49 -07:00
- Tune scheduled sweep cadence with `dreaming.frequency` . Deep promotion policy is otherwise internal; use CLI flags on `memory promote` when you need one-off manual overrides.
2026-04-05 18:41:53 +01:00
- See [Dreaming ](/concepts/dreaming ) for full phase descriptions and configuration reference.