kb-dream
Run the memory-consolidation pass. Location is configurable: use $KB_DIR or
kb root (default ~/kb).
Procedure
Read $KB_DIR/DREAM.md and execute it end to end. In summary:
- Load
MEMORY.md, allmemory/**/*.md(recursive — excluding reservedindex.md,log.md,_TEMPLATE.md),raw/inbox/*,raw/source docs, and.agent/state.json. - Ingest & rewrite: promote durable/general/public facts from the inbox and
un-processed
raw/docs intomemory/— create new notes or rewrite/merge existing ones. Then delete consumed inbox files; keep source docs and record them instate.json.processed. - Dedupe & merge; split multi-fact notes; validate frontmatter against the
standard (
kb lint); compact to ≤~25 lines. - Refresh: for notes with
sources:whosetimestamp/updated:is stale (>~30 days), fetch the source (preferllms.txt) and update the note +updated:+timestamp. - Relink (no orphans), merge tag sprawl, prune wrong/obsolete/now-private notes.
- Rebuild
MEMORY.md; runkb gento regenerate everymemory/**/index.md(OKF listings) +viz.html; append a dated entry tomemory/log.md; verify scope (no secrets). - Set
state.json.last_dreamto today; runkb sync.
Principles
Lossless of meaning, atomic, retrieval-first, conservative deletes, idempotent.
Pair with kb-memory for the read/write protocol.