Commit graph

3 commits

Author SHA1 Message Date
Victor Taelin
e123c89317 fixed-width records: O(1) lookup, no scanning
Finding a block meant parsing the whole tree: 1.3s at a million memories, and
the Minilins write fast enough to get there. Records are now fixed width, so
position is identity -- memory i at i*320 of LOG.txt, block [ks,(k+1)s) at
k*288 of TREE/s. One seek, no index file to keep in sync.

A directory of one file per block was the obvious alternative and is worse:
25x disk (781 MB for 31 MB of text) and finding pending work still scans.
Here a level file is a dense prefix, so its length IS the watermark: pending
costs one stat per level. Measured at 1M memories: wake 0.96s -> 0.03s,
note 1.30s -> 0.02s, disk 370 MB -> 607 MB.
2026-07-25 14:34:29 -03:00
Victor Taelin
e544f6548a wake in parts: a single-shot dump is silently truncated by every harness
Measured: Codex CLI cuts tool output at 10 KiB or 256 lines, Claude Code at
30,000 chars, pi at 50 KB -- and each drops a different piece. A 320-line
memory is ~79 KB, so waking was losing memories everywhere, silently. Observed
live on pi: memories #0-#41, the compressed ancient past, vanished.

memo wake now pages the document into parts under the strictest cap and each
part names the exact command for the next. No harness is special-cased.
2026-07-25 14:22:29 -03:00
Victor Taelin
7e3d55dad6 OptMem: a permanent, append-only memory for AI agents 2026-07-25 13:58:35 -03:00