Not taken. It would pay every turn for what the index already does.
File descriptions
Not taken. Results are paragraphs, and a path such as topics/people/dave.md already describes its one topic. Strict parsing also rejects an introductory paragraph or blockquote (TopicFormatError: memory block ID required); only an HTML comment passes.
"Prefer empty"
Taken as a minimum score for results.
Search time by workspace size
Topic bytes
First search
New process, cache on disk
Same process, files unchanged
0.5 MB
108 ms
57 ms
50 ms
3.35 MB
584 ms
413 ms
342 ms
9.8 MB
1832 ms
1216 ms
1101 ms
Synthetic workspaces in the real format, 12 blocks per file, mean of three runs on one machine. Parsing is cached by file signature, but every search rebuilds the scoring corpus, so time stays linear in bytes. That cost is local and fixable; an added model round trip can only be avoided.
Trimming resident content
The resident section is the core of MEMORY.md, rendered from topics/core.md.
openclaw
OpenProgram
Who writes
Automatic promotion and hand edits, in one file
Writers and people edit topics/core.md; the Runtime renders the section
Renders in file order until the next paragraph does not fit; a heading left with nothing under it goes too
Removal destroys content
Yes, so ownership must be tracked
No: the rest stays in the source, indexed and citing its evidence
Runs
During writes
After each write, with timeline/, recent_events.jsonl and relations.json
Reports
Removed dates, to the caller
Rendered tokens and left-out block IDs, on last_core_block
To keep a paragraph resident, move it earlier in the file. No marker exists for this.
Why a derived section, and a budget rather than a limit that rejects
Concern
Effect
Block IDs
Every block ID present before an edit must survive it, or the transaction fails with block ID must not be removed. Trimming a file that holds the only copy of an ID cannot pass. Rendered IDs are always a copy of an ID in topics/.
A rejecting limit
One overflow would roll back the whole transaction, Topic changes included, and every later stable fact would be sent elsewhere, leaving the section frozen.
One file kind
topics/core.md follows the Topic contract. validate_writable_path refuses edits outside topics/**/*.md with READ_ONLY_PATH.
Old root core.md
promote_legacy_core moves it into topics/ once.
Reorganization
The organize prompt keeps topics/core.md to facts useful across most interactions; being past the budget is no reason to keep a paragraph. Size-based splitting skips this file.
Reporting whether anything changed
Reorganization rests on model judgment, and a model that finds nothing to do does nothing. reorganize returns changed_files beside topics, the count of files examined, so an empty list is visible.
Departed branches
Current headalways written
Other live tipslong branch left: written at the token thresholdone-turn retry: below the threshold, skippedrewound: filtered out by get_branch
The idle watcher's forced write calls list_branches, skips archived branches, then get_branch(session_id, tip) for each. Written markers cover shared prefixes. Post-turn writes follow the head only.
Why not pi-mono's summary node (branch-summarization.ts)
Point
Reason
Destination
pi-mono has only session JSONL and AGENTS.md, so a summary is the only place abandoned statements can go. Here facts belong in Topic files; a node on the DAG has no footnotes or block IDs and cannot be retrieved.
Another location
Compaction summaries in context/summary already attach to the DAG, for the context window. A second kind is one more place to look.
No leave event
Neither head movement nor branch switching is an event. Head writes are spread across set_head, append_message, SessionNodeWriter.append, update_session and rewind, and SessionMemoryIndex.set_head discards the old value. Copying pi-mono would add an event and retain the old head for work that serves equally well at session end.
Deliberate abandonment
Needs no inference: rewinding marks a segment rewound; its nodes stay in the graph and leave the conversation path.
Idle rule
should_incremental_write also fires when anything is pending and the last message is an hour old, which every left branch satisfies. Non-head branches check the token threshold first, so one-turn retries are skipped.
Cursor fallback
Item
Behaviour
claude-code
The cursor is a message UUID. If that message is gone, everything counts as unwritten, because returning zero messages would end extraction for the session.
Rule here
Unreadable accounting means nothing was written, never an exception that blocks writing for good. Rewriting a batch is bounded, and transactions merge paragraphs stating the same fact.
Node markers
Written state is a marker on session nodes (memory_written_scriptorium), so no cursor file can go unreadable. A missing marker causes repeated work.
runtime.json
Missing, unparsable or the wrong shape: RuntimeStateStore.load returns empty state. The file counts toward the workspace revision, so restored content does not pair with newer state.
Upgrades
A separate, one-time case with the same tradeoff: see written markers.
Change locations
Paths under openprogram/state/memory/. The rejected practice changes none.
Derived core, all-branch writes at session boundaries, unreadable state as empty state, node markers, changed_files
Not yet
A minimum result score; search that does not rebuild the scoring corpus; a writer notified directly by head changes (post-turn thresholds and the idle watcher trigger writes)