SuperAPI AI Directory

kb-dream

General & other

View repository

Updated 10-16 05:06

About this skill

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:

  1. Load MEMORY.md, all memory/*.md, raw/inbox/*, raw/ source docs, and .agent/state.json.
  2. Ingest & rewrite: promote durable/general/public facts from the inbox and un-processed raw/ docs into memory/ — create new notes or rewrite/merge existing ones. Then delete consumed inbox files; keep source docs and record them in state.json.processed.
  3. Dedupe & merge; split multi-fact notes; validate frontmatter against the standard (kb lint); compact to ≤~25 lines.
  4. Refresh: for notes with sources: whose updated: is stale (>~30 days), fetch the source (prefer llms.txt) and update the note + updated:.
  5. Relink (no orphans), merge tag sprawl, prune wrong/obsolete/now-private notes.
  6. Rebuild MEMORY.md; verify scope (no secrets).
  7. Set state.json.last_dream to today; run kb sync.

Principles

Lossless of meaning, atomic, retrieval-first, conservative deletes, idempotent. Pair with kb-memory for the read/write protocol.