MEMORY.md is canonical; SQLite is a rebuildable index of vector nearest neighbours and full-text ranking
hermes-agent
Yes
MEMORY.md and USER.md; eight optional hosted services, one at a time
OpenProgram
Yes
Markdown workspace: topics/ and MEMORY.md; footnotes link chat messages
opencode
No
User-written AGENTS.md or CLAUDE.md; no memory tool
pi-mono
No
JSONL session tree for replay and branching; only AGENTS.md crosses sessions
pi-ai
No
Provider SDK, 12 files, no session concept; the caller owns the message array
weclaw
No
WeChat bridge storing an opaque session id; the launched process owns memory
Classify by whether content returns to context. weclaw saves pasted URLs as Markdown, but no prompt reads them back. codex, opencode and pi-mono keep full transcripts that nobody distills or reads across sessions: storing originals is not memory.
Claude writes during the session; when is undocumented
codex-cli
Fire-and-forget task at turn start; exits on low quota, handles only sessions idle over six hours, deduplicated by a database lease that records the watermark on completion
openclaw
Cron, default daily 03:00; short-term entries promoted by six weighted criteria; no in-session writes
hermes-agent
The model calls a tool whenever it chooses; a background agent reminds it every ten turns
OpenProgram
Checked each turn; writes at 16k tokens (8k, 16k or 32k by setting), writes the rest after 30 idle minutes, reorganizes at 03:00
pi-mono
No memory writes; original events persist synchronously
opencode, pi-ai, weclaw
No writes
Three of four writers work outside the conversation, because memory edits add a call and distract the model from the task.
Kept to resume a conversation. In a new one they are effectively absent.
Distilled facts only
hermes-agent
Small and fast. Tool text says: "Do not store logs; search past sessions for those." A wrong fact has no source to check.
Both
claude-code, codex-cli, pi-mono, OpenProgram
Originals are append-only, facts may be rewritten. Only ours footnotes each statement to /s/<session>#<msg>.
codex distills twice: per-session into raw memories and a summary, then an agent without network or approval prompts rewrites MEMORY.md, summary pages and skill directories from those and a workspace diff. Writing and organizing are separate roles, like ours, but split by pipeline stage rather than time.
How unwritten content is identified
Framework
Form
Stored in
hermes-agent
None; the model writes when it chooses. Persistence uses an integer index, compaction scans body markers.
—
weclaw, pi-ai
None; weclaw has only a hard message-count cutoff
—
codex-cli
Integer timestamp watermark per session file
SQLite task table with lease and retry count
claude-code
Undocumented
—
pi-mono
One entry id, firstKeptEntryId, scan backward
Compaction records in the transcript
opencode
Message-level summary: true and a tail_start_id
On the messages
openclaw
Entry promotedAt timestamp plus an HTML deduplication comment, cross-checking
On entries and in the MEMORY.md body
OpenProgram
Workspace marker memory_written_scriptorium on each node; inspect back from the branch tip to the first marked node
b4, b5, b6 are unmarked: pending. m1 to m3 carry markers, so inspection stops there.
Session structure
Framework
Branching
Implementation
claude-code
Yes, most complete
/branch copies the session; /rewind rewinds conversation, files or both; subagents write separate files
codex-cli
Yes
codex fork and TUI edits of earlier prompts create threads, source unchanged
openclaw
Subagents only
Dispatch can inherit the parent transcript or start clean; no old-message edit found
opencode
Copy; rewind deletes
fork deep-copies. revert sets a marker, and the next prompt permanently deletes later messages, so editing an old message is irreversible unless forked first.
hermes-agent
Yes
/branch copies into a session linked by parent id; compaction also makes child sessions, and /resume follows the chain to the latest
pi-mono
Trees
Editing an old message creates a sibling branch; leaving one can keep a generated summary
OpenProgram
DAGs
Reasking, retrying and spawning agents branch from intermediate points; branches under one session id share prefixes
weclaw
No
One session per WeChat contact; /new deletes the old one
Yes, all of it; only Phase 2 consolidation merges semantically
claude-code
Undocumented
—
openclaw
New session, flush markers cleared on purpose
Yes; comments prefer repetition to omission from equal hashes
opencode
New ids; tail_start_id translated through a lookup table
No
hermes-agent
New session; index advanced by hand to the copied length
No. Compaction-created sessions reset to 0 because they start empty.
pi-mono
No cursor needed: walk leaf to nearest common ancestor
No; traversal excludes it
OpenProgram
Unchanged; markers read back from the current tip
No
pi-ai, weclaw
No forks; weclaw's /new clears the session
—
Index and timestamp cursors need one line per scope, so they change scope at a fork, and that works because their forks copy content. Our forks copy nothing, so we record identities. pi-mono's alternative needs a comparison branch for every traversal; memory asks what is unwritten in the session and has no second branch to compare.
All of AGENTS.md enters the system prompt; the model greps for finer detail
No infrastructure; large files exhaust the budget
Keyword
OpenProgram, hermes, codex
Ours: BM25, five results each turn, no model call (1 to 10 by setting; embedding, hybrid and agent are options). hermes: SQLite full-text session search. codex: line-by-line substring.
Fast and explainable; paraphrases may miss
Vector
openclaw
Nearest neighbours combined with full-text ranking; a subagent also searches before the user turn and inserts conclusions
Embeddings, indexes, rebuilds: over half of 20,000-plus lines
Resident content when full
Block
Limit
When full
Disclosure
claude-code MEMORY.md
200 lines or 25KB
The rest does not load at session start
Error telling Claude to rewrite the index
claude-code CLAUDE.md
4 MiB; under 200 lines advised
A file over 4 MiB is skipped
—
codex-cli
Project AGENTS.md 32 KiB shared; summary 2500 tokens; global unlimited
Cut at the remaining-byte boundary
Log entry only
openclaw MEMORY.md
10000 characters
Removes only automatically promoted paragraphs, oldest first; handwritten text stays
Vectors, full-text, dream pipeline, promotion ranking. Two alternative backends add 12,000, excluded.
OpenProgram
11,600
All of openprogram/state/memory/: writing, transactions, retrieval, topic format, nightly organization. None is compaction.
codex-cli
8,900 + 3,700
Two-stage distillation and read path. About 60,000 transcript and fork lines are not memory.
hermes-agent
2,800 + 2,400
Eight optional service plugins total 11,600, all off by default
pi-mono
5,000
Session tree and compaction, the same logic twice; 0 long-term memory
opencode
1,550
Compaction and storage; 0 long-term memory
weclaw
200
Session-id bookkeeping
pi-ai
0
—
Vectors, embedding caches, index rebuilds and hybrid ranking dominate openclaw. Maintaining an index, not having memory, is the divide.
Practices worth borrowing
From
Practice
Ours
codex-cli
Writer lease from a SQLite table with retry counts and last watermark; checks quota first
Cross-process write lock, one-second timeout; the idle watcher keeps failures by the scope of their cause (conversation, memory, sign-in) in ingest-state.json; failures reach writer status and a memory_writer_failed frame
codex-cli
The model embeds a hidden marker naming memory it used; the server counts it and strips it. Counts rank content at organization.
Not built; nightly organization merges by content
openclaw
Deduplication in two copies that check each other
Node marks alone; Topic footnotes name the same messages without cross-checking
pi-mono
A generated summary on leaving a branch
Not built
Implementation status
Status
Items
Implemented
topics/core.md as canonical resident source, per-node workspace markers, live-branch enumeration at session boundaries, Topic footnotes preserving Source references
Not yet
Index-free selection from Topic self-descriptions, retrieval usage as organization input, direct writer notification on head changes instead of post-turn thresholds or the idle watcher