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
fix(openclaw-agent-memory): wire memory-host hooks for auto-recall (#279)
Closes#279. The plugin registered seven OB1 tools but did not
participate in the OpenClaw memory-host lifecycle, so agents only
hit OB1 if they remembered to. As a result, recall-before / writeback-
after happened only when the prompt or skill explicitly nudged it.
Adds two additive memory hooks inside register(api):
* registerMemoryPromptSupplement — auto-injects an OB1 discipline
block into the system prompt every turn (recall-before /
writeback-after, instruction-vs-evidence semantics, and the list
of tools currently exposed to the agent).
* registerMemoryCorpusSupplement — exposes OB1 as a searchable
corpus so OpenClaw's native recall flow queries OB1 alongside
whatever other corpora are active. Maps recall responses onto
MemoryCorpusSearchResult and inspects single memories via
MemoryCorpusGetResult, with provenanceLabel reflecting OB1's
use_policy (instruction vs evidence).
Both supplements are additive (per the SDK contract) so they coexist
with the active exclusive memory plugin. Both no-op cleanly when OB1
is not configured (missing endpoint or workspaceId, missing access
key, network failure) — never throws into the host.
The hooks are called via (api as any).registerMemory* so the plugin
stays compatible with older OpenClaw releases that may not have the
methods on the typed surface yet; the typeof checks gate registration
on availability.
No new tooling, dependencies, or breaking changes. The seven existing
tools are unchanged. dist/ is intentionally not committed — maintainers
should run `npm run build` to regenerate it.
"Long-term governed memory is available via OB1. Use it as a discipline, not a fallback.",
207
+
"",
208
+
"Workflow:",
209
+
"- Before meaningful work, call `openbrain_recall` with a task-scoped query.",
210
+
"- Treat returned memories tagged `instruction` as binding rules; `evidence`-tagged ones as supporting context only.",
211
+
"- After meaningful work, call `openbrain_writeback` with compact, provenance-labeled findings (decisions, lessons, constraints, outputs, failures).",
212
+
"- After acting on recalled memories, call `openbrain_report_usage` with `request_id` and the IDs you used vs. ignored — closes the recall-quality loop.",
0 commit comments