openclaw-mem-engine admin ops (P0-1)¶
This page documents the operator-facing admin surfaces added for openclaw-mem-engine.
Core memory runtime capability¶
openclaw-mem-engine registers with OpenClaw's core memory runtime capability when the
host exposes registerMemoryCapability or the legacy registerMemoryRuntime hook. This
lets core doctor/status and memory-search health checks see the engine as the active
memory plugin instead of treating it as only a sidecar tool/hook plugin.
The runtime adapter is intentionally thin:
searchroutes through the existing LanceDB-backed hybrid recall path and returns bounded synthetic memory citations.readFilesupports syntheticopenclaw-mem-engine/<id>.mdpreviews with direct ID lookup and line slicing for core UI/debug consumers.status,probeEmbeddingAvailability, andprobeVectorAvailabilityexpose the same backend facts operators already see in plugin logs.
Older OpenClaw hosts remain compatible. If the host lacks the core capability hook, the
plugin logs core memory runtime registration skipped and continues to provide its
existing tools, docs cold lane, auto-capture, and prompt-hook behavior.
Verification after enabling or upgrading:
openclaw doctor
openclaw status
Expected capable-host log line:
openclaw-mem-engine: registered core memory runtime capability
What is supported¶
Comparable admin capabilities are now available for the engine backend:
listmemories (filterable byscope/category, bounded bylimit)stats(counts byscope/category+ size/age summaries)export(sanitized, deterministic JSONL/JSON)import(append mode, with dedupe and dry-run validation)
All admin operations return a receipt/debug block with:
operationfiltersAppliedreturnedCount(orimportedCount/skippedCount/failedCountfor import)- backend context (
dbPath,tableName, latency)
CLI commands¶
OpenClaw core may not ship built-in
openclaw memory list|stats|export|importyet. This plugin registers equivalent admin commands under both surfaces when loaded:
openclaw memory <subcommand>(extends existing memory command)openclaw ltm <subcommand>(fallback compatibility namespace)
List¶
openclaw memory list --scope openclaw-mem --limit 20 --json
# fallback:
openclaw ltm list --scope openclaw-mem --limit 20 --json
Stats¶
openclaw memory stats --scope openclaw-mem --json
# fallback:
openclaw ltm stats --scope openclaw-mem --json
Export (sanitized by default)¶
openclaw memory export \
--scope openclaw-mem \
--out /path/to/tmp/mem_export_test.jsonl \
--format jsonl \
--json
# fallback:
openclaw ltm export --scope openclaw-mem --out /tmp/mem.json --format json --json
- Deterministic ordering:
createdAt ASC, thenid ASC - Default redaction: obvious API/token/private-key patterns in
textare masked - Use
--no-redactonly in trusted/local scenarios
Import (append + dedupe + dry-run)¶
openclaw memory import \
--in /path/to/tmp/mem_export_test.jsonl \
--dedupe id_text \
--dry-run \
--json
# fallback:
openclaw ltm import --in /tmp/mem.jsonl --dedupe id_text --dry-run --json
Dedupe modes:
none– no dedupeid– skip rows with existing IDsid_text(default) – skip existing IDs and normalized duplicate text
Import behavior:
- append-only; no destructive overwrite
- if
vectoris missing, engine attempts embedding generation - if embeddings are unavailable and no
vectorprovided, row is counted as failed
Tool API surface¶
The same admin operations are also exposed as tools:
memory_listmemory_statsmemory_exportmemory_import
This keeps admin functionality available in agent/tool workflows even if CLI wiring differs across OpenClaw versions.
Docs Memory cold lane (installable)¶
openclaw-mem-engine now includes an optional docs cold lane for operator-authored markdown (DECISIONS/roadmaps/specs) without writing those chunks into hot memory rows.
New tools¶
memory_docs_ingest— bounded ingest intoopenclaw-mem docsSQLite indexmemory_docs_search— bounded docs snippets (operatorprovenance)
memory_recall and autoRecall can consult docs cold lane only when hot recall is insufficient (minHotItems threshold).
Config knobs¶
{
"plugins": {
"entries": {
"openclaw-mem-engine": {
"enabled": true,
"config": {
"docsColdLane": {
"enabled": true,
"sqlitePath": "~/.openclaw/memory/openclaw-mem.sqlite",
"sourceRoots": [
"/path/to/decision-docs",
"/path/to/project-docs"
],
"sourceGlobs": ["**/*.md", "**/ROADMAP*.md", "**/*SPEC*.md"],
"scopeMappingStrategy": "repo_prefix", // none|repo_prefix|path_prefix|map
"scopeMap": {
"openclaw-mem": ["openclaw-mem/docs", "openclaw-mem/specs"]
},
"maxChunkChars": 1400,
"embedOnIngest": true,
"ingestOnStart": false,
"maxItems": 2,
"maxSnippetChars": 280,
"minHotItems": 2,
"searchFtsK": 20,
"searchVecK": 20,
"searchRrfK": 60
}
}
}
}
}
}
Verification commands¶
# 1) Ingest allowlisted docs
openclaw tools invoke memory_docs_ingest --json '{}'
# 2) Query docs lane directly
openclaw tools invoke memory_docs_search --json '{"query":"status code decision","scope":"openclaw-mem"}'
# 3) Verify cold-lane marker in recall receipt/logs
# expect: openclaw-mem-engine:docsColdLane.search
# and autoRecall receipt field: coldLane.{consulted,returned,strategy}
Log markers / receipts¶
- ingest:
openclaw-mem-engine:docsColdLane.ingest - search:
openclaw-mem-engine:docsColdLane.search - includes bounded search counters such as
requested,returned,filteredByScope,rawCandidates, andscopedCandidates - recall receipt (
openclaw-mem-engine.recall.receipt.v1) now carries optionalcoldLanesummary
Scoped docs search note: - when a strict scope is present, the plugin now over-fetches a bounded candidate pool before applying scope filtering, reducing false 0-hit cases caused by filter-after-limit starvation.
Rollback¶
Fast rollback (no code revert):
openclaw config set plugins.entries.openclaw-mem-engine.config.docsColdLane.enabled false
openclaw gateway restart
Hard rollback (remove lane tools as well): revert to previous commit and restart gateway.