Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: memory-dream-review
description: Review ClawXMemory memory quality with a read-only Dream pass over recent L1, linked project memories, and the global profile.
homepage: https://github.com/OpenBMB/ClawXMemory/tree/main/clawxmemory
metadata:
{
"openclaw":
{
"skillKey": "openbmb-clawxmemory",
"requires": { "config": ["plugins.entries.openbmb-clawxmemory.enabled"] },
},
}
---

# Memory Dream Review

Use this skill when the user asks to audit memory quality, clean up duplicate project memories, inspect profile drift, or decide what should be promoted into longer-term memory.

## Primary Path

1. Call `memory_dream_review`, usually with `focus: "all"`.
2. Report findings in this order:
- `projectRebuild`
- `cleanup`
- `profileSuggestions`
- `ambiguous`
- `noAction`
- `timeLayerNotes`
3. State clearly that Dream review is read-only and no memory records were modified.
4. Only call `memory_get` if the user asks to inspect one specific finding in detail.

## Focus Guidance

- Project cleanup or duplicate project summaries:
use `memory_dream_review({ focus: "projects" })`
- Profile drift or promotion questions:
use `memory_dream_review({ focus: "profile" })`
- Mixed governance review:
use `memory_dream_review({ focus: "all" })`

## Guardrails

- Do not imply that Dream already rewrote L2 or profile memory.
- Treat `timeLayerNotes` as integrity observations only, not rewrite instructions.
- Prefer citing the returned `evidenceRefs` instead of guessing where a finding came from.
2 changes: 1 addition & 1 deletion extensions/openbmb-clawxmemory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@sinclair/typebox": "^0.34.41"
},
"devDependencies": {
"openclaw": "^2026.3.31",
"openclaw": "^2026.3.28",
"vitest": "^4.0.5"
},
"peerDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions extensions/openbmb-clawxmemory/skills/context-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ enoughAt={{enoughAt}}

{{profileBlock}}

{{evidenceNoteBlock}}

{{l2Block}}

{{l1Block}}
Expand Down
57 changes: 42 additions & 15 deletions extensions/openbmb-clawxmemory/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export interface PluginRuntimeConfig {
maxMessageChars: number;
heartbeatBatchSize: number;
autoIndexIntervalMinutes: number;
autoDreamIntervalMinutes: number;
autoDreamMinNewL1: number;
indexIdleDebounceMs: number;
defaultIndexingSettings: IndexingSettings;
recallEnabled: boolean;
Expand Down Expand Up @@ -58,11 +60,23 @@ export const pluginConfigJsonSchema = {
type: "integer",
default: 60,
},
autoDreamIntervalMinutes: {
type: "integer",
default: 360,
},
autoDreamMinNewL1: {
type: "integer",
default: 10,
},
reasoningMode: {
type: "string",
enum: ["answer_first", "accuracy_first"],
default: "answer_first",
},
recallTopK: {
type: "integer",
default: 10,
},
maxAutoReplyLatencyMs: {
type: "integer",
default: 1800,
Expand Down Expand Up @@ -127,12 +141,24 @@ export const pluginConfigUiHints = {
label: "Auto Index Interval",
placeholder: "60",
},
autoDreamIntervalMinutes: {
label: "Auto Dream Interval",
placeholder: "360",
},
autoDreamMinNewL1: {
label: "Auto Dream L1 Threshold",
placeholder: "10",
},
reasoningMode: {
label: "Reasoning Mode",
help: "answer_first stops when reply latency budget is about to run out; accuracy_first prefers full recursive memory retrieval.",
help: "answer_first stops at L2 evidence notes; accuracy_first can continue down to L1 and L0.",
},
recallTopK: {
label: "Recall Top K",
placeholder: "10",
},
maxAutoReplyLatencyMs: {
label: "Max Auto Reply Latency (ms)",
label: "Legacy Max Auto Reply Latency (ms)",
placeholder: "1800",
},
uiEnabled: {
Expand Down Expand Up @@ -186,16 +212,12 @@ export function buildPluginConfig(raw: unknown): PluginRuntimeConfig {
const skillsDir =
typeof cfg.skillsDir === "string" && cfg.skillsDir.trim() ? cfg.skillsDir : undefined;

const configuredLatency =
typeof cfg.maxAutoReplyLatencyMs === "number" && Number.isFinite(cfg.maxAutoReplyLatencyMs)
? Math.floor(cfg.maxAutoReplyLatencyMs)
: typeof cfg.maxAutoReplyLatencyMs === "string" && cfg.maxAutoReplyLatencyMs.trim()
? Number.parseInt(cfg.maxAutoReplyLatencyMs, 10)
: typeof cfg.recallBudgetMs === "number" && Number.isFinite(cfg.recallBudgetMs)
? Math.floor(cfg.recallBudgetMs)
: typeof cfg.recallBudgetMs === "string" && cfg.recallBudgetMs.trim()
? Number.parseInt(cfg.recallBudgetMs, 10)
: 1800;
const configuredRecallTopK =
typeof cfg.recallTopK === "number" && Number.isFinite(cfg.recallTopK)
? Math.floor(cfg.recallTopK)
: typeof cfg.recallTopK === "string" && cfg.recallTopK.trim()
? Number.parseInt(cfg.recallTopK, 10)
: 10;
const captureStrategy = cfg.captureStrategy === "last_turn" ? "last_turn" : "full_session";
const runtime: PluginRuntimeConfig = {
dataDir,
Expand All @@ -205,13 +227,18 @@ export function buildPluginConfig(raw: unknown): PluginRuntimeConfig {
maxMessageChars: toInteger(cfg.maxMessageChars, 6000),
heartbeatBatchSize: Math.max(1, toInteger(cfg.heartbeatBatchSize, 30)),
autoIndexIntervalMinutes: Math.max(0, toInteger(cfg.autoIndexIntervalMinutes, 60)),
autoDreamIntervalMinutes: Math.max(0, toInteger(cfg.autoDreamIntervalMinutes, 360)),
autoDreamMinNewL1: Math.max(0, toInteger(cfg.autoDreamMinNewL1, 10)),
indexIdleDebounceMs: Math.max(200, toInteger(cfg.indexIdleDebounceMs, 2500)),
defaultIndexingSettings: {
reasoningMode: cfg.reasoningMode === "accuracy_first" ? "accuracy_first" : "answer_first",
maxAutoReplyLatencyMs: Math.max(
300,
Number.isFinite(configuredLatency) ? configuredLatency : 1800,
recallTopK: Math.max(
1,
Math.min(50, Number.isFinite(configuredRecallTopK) ? configuredRecallTopK : 10),
),
autoIndexIntervalMinutes: Math.max(0, toInteger(cfg.autoIndexIntervalMinutes, 60)),
autoDreamIntervalMinutes: Math.max(0, toInteger(cfg.autoDreamIntervalMinutes, 360)),
autoDreamMinNewL1: Math.max(0, toInteger(cfg.autoDreamMinNewL1, 10)),
},
recallEnabled: toBoolean(cfg.recallEnabled, true),
addEnabled: toBoolean(cfg.addEnabled, true),
Expand Down
2 changes: 2 additions & 0 deletions extensions/openbmb-clawxmemory/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export function registerMemoryHooks(api: OpenClawPluginApi, runtime: MemoryPlugi
if (!api.on) return;

api.on("before_prompt_build", runtime.handleBeforePromptBuild, { priority: 60 });
api.on("before_tool_call", runtime.handleBeforeToolCall, { priority: 60 });
api.on("after_tool_call", runtime.handleAfterToolCall);
api.on("before_message_write", runtime.handleBeforeMessageWrite, { priority: 80 });
api.on("agent_end", runtime.handleAgentEnd);
api.on("before_reset", runtime.handleBeforeReset);
Expand Down
Loading
Loading