2026-07-27T11:27:58.698Z

OpenClaw Memory: Verify the Write, Index, Search, and Restart

Audit durable writes, index freshness, anchored retrieval, and fresh-session decisions without exporting memory content.

OpenClaw memory is healthy only when four different claims are true: the intended record was written to durable storage, the current index covers that write, retrieval returns the right source anchor, and a fresh session still applies the decision correctly. A Markdown file on disk proves only the first claim. A successful search proves only that some indexed chunk matched. Use a content minimized audit that keeps memory text on the host. Record opaque IDs, local comparison results, timestamps, and source anchors; do not export prompts, note contents, absolute paths, or raw search snippets. The operator should be able to distinguish a missing write, stale index, wrong retrieval, and lost decision instead of collapsing all four into “memory is broken.” Treat OpenClaw memory as four separate proofs The current OpenClaw memory overview describes memory as plain Markdown in the agent workspace. MEMORY.md is the curated long term layer, while dated files under memory/ hold detailed daily context. The model remembers what reaches disk; there is no hidden durable state that rescues an omitted write. That design creates useful inspection points: 1. Write proof: the expected file exists and its local content matches the version that was meant to persist. 2. Index proof: the memory backend has indexed the current source snapshot rather than an earlier one. 3. Retrieval proof: a query returns the expected file and line range, not merely a plausible sentence from somewhere else. 4. Decision proof: after a real session boundary, the agent follows the saved decision and its action boundary. These proofs fail independently. A note can exist while the index remains dirty. The index can be current while a query falls below the configured score. Retrieval can find the correct passage while a fresh session ignores its expiry condition or owner. Conversely, a session may answer correctly because the same fact still exists in its conversation context, even though the durable write never happened. The reasonable default is therefore a staged verdict. Stop at the first failed layer and repair only that layer. Do not rewrite memory when the index is stale, and do not rebuild an index when the record was never persisted. Prove the write without exporting the memory Give every action sensitive record an opaque ID such as decision 7f3b , plus the fields needed to act safely later: owner, effective condition, expiry or unlock condition, and prohibited action. The ID is not a secret and does not reveal the decision. At the source, calculate whether the current record matches the expected local version. Export only the comparison: Do not send a raw digest of a short or sensitive note to a remote health service. Low entropy text can be guessed and hashed. Keep the digest on the host, use a keyed HMAC when a stable fingerprint must leave the process boundary, or report only the boolean comparison and an opaque record ID. A filesystem write returning success is not enough. Read the record back from the durable file, then compare the bytes that were actually stored. If the write is expected to survive a host restart, confirm the storage location is persistent for that deployment; a container local workspace can disappear even though the write call succeeded. The same rule applies to MEMORY.md truncation. OpenClaw keeps an oversized file intact while the copy injected into the bootstrap context may be truncated. File presence still passes, but decision proof may fail because the required entry did not reach the new session. The memory overview recommends checking context detail or doctor output when bootstrap limits are involved. Prove index freshness before trusting retrieval OpenClaw’s memory search documentation explains that the built in backend can combine vector similarity with BM25 keyword matching. It also documents automatic synchronization at session start, on search, and through a file watcher. Those mechanisms reduce stale windows; they do not make freshness unobservable. Start with status: The deep probe checks the embedding provider and semantic search path, so it can make a provider call. Inspect at least: whether the store is dirty; indexed file and chunk counts; selected provider and model; FTS availability; vector store and semantic search availability; scan issues and index identity. On OpenClaw 2026.7.1 2 , a live read only probe during this investigation reported a valid built in index identity and available lexical and semantic paths, but also dirty: true . That combination is important: a working embedding probe does not prove that the newest note is indexed. When the source is correct but the store is dirty, run an incremental synchronization with: Reserve a forced rebuild for an invalid identity, changed chunking or embedding configuration, corruption, or an incremental sync that cannot converge: The OpenClaw memory CLI reference distinguishes these operations: status index reindexes when dirty, while index force performs a full rebuild. Treat a provider outage as search unavailable , not an empty memory. The documented behavior is deliberately explicit when a configured embedding provider fails; it should not silently become proof that no relevant record exists. Cross the restart boundary with a decision probe Search for an opaque retrieval key that is unique to the test record, then require an anchored result: A passing retrieval proof contains the expected source type, file reference, and line range. Do not pass because the result text sounds right. Hybrid search may return semantically related notes, and repeated daily entries may place an older version above the current decision. Now cross a genuine session boundary. A second prompt in the same conversation is not a restart test because the original instruction may still be in context. Start a fresh session through the runtime’s normal session mechanism, ask for a bounded decision probe, and compare behavior with the saved contract. For example, if the durable note says a migration remains design only until approval A 42 , the probe should ask whether implementation may begin now. The expected result is a decision code such as WAIT FOR A 42 , not a verbatim quotation of the private note. Record: This tests useful continuity rather than recollection theater. A model can paraphrase a note while dropping the authority boundary that makes it safe. It can also produce the right decision accidentally. Keep the probe narrow, repeat it after relevant configuration changes, and include a negative case whose unlock condition has not been met. Replay a content free nine case audit The accompanying memory health cases.json fixture contains no memory text. It supplies nine synthetic observations to evaluate openclaw memory health.mjs , one for every terminal state: The reproduced summary is: The classifier uses a strict order. It checks durable existence and local equality before index state; index state before search availability; search availability before retrieval; and retrieval before a fresh session decision. This prevents misleading repairs. Reindexing cannot create a missing record. Rewriting a record cannot restore a failed embedding provider. A high scoring hit cannot prove restart continuity. Adapt the fixture with real opaque IDs and local booleans. Add cases for a read only workspace, an index built from an older digest, a result from the wrong dated note, a truncated bootstrap file, an unavailable embedding provider, a keyword only fallback, and a decision whose approval expired. Keep the raw note and raw search result out of shared telemetry. Use an explicit unknown state The compact operating rule is: Mark OpenClaw memory verified only when the durable record matches locally, the current index covers it, retrieval anchors to the expected source, and a fresh session produces the expected bounded decision. Everything else should retain a specific non green state. search unavailable is not retrieval miss . restart unverified is not continuity failed . An explicit unknown is more useful than a generic red status because it identifies the next safe test without inviting the agent to invent missing context. This audit still has limits. A local comparison can validate only records included in the test set. A compromised host can forge both the note and the evidence. A retrieval probe measures one query and one ranking configuration. A matching decision code does not prove every nuance survived, and repeated probes consume model and embedding budget. Use deterministic checks for storage and indexing, then spend model calls only on the behavior that cannot be verified from files and database state. Sidewisp is currently in private preview. It is intended to provide a health layer around existing agent runtimes, but production OpenClaw adapters, live agent health collection, and automated recovery are not shipped in the current website repository. The four proof audit is an operator run pattern you can implement now, not a claim that Sidewisp currently monitors or repairs OpenClaw memory. If this separation between storage, retrieval, and decision health matches how you want to operate agents, join the Sidewisp private preview. Until then, keep the comparison local, make the restart real, and let missing evidence remain unknown.