mattrguerra/better-memory-pipelinemainPrivate on GitHub, published here in full

distiller/

The distiller

Stage 2 of better-memory. gate.py has already walled off the private material and staged only the notes that are new or changed since the last run. The distiller reads that staging directory and upserts one Notion page per entity into better-memory (schema).

Distillation needs a model, not a script, so this stage is a Claude skill run as a scheduled Cowork task: better-memory-nightly-distill/SKILL.md. Each run starts with no memory of the last one, so the skill carries everything it needs: the read boundary, the schema, idempotency by Title, and the two light judgments (memory vs raw material, no private-by-nature specifics).

Schedule and binding

  • Nightly, after the gate: gate at 20:00 (launchd), distiller at 20:30 (Cowork).
  • Bound to ~/cowork-staging/staging only. The task is never given a path to any vault, so the walled folders are physically absent from everything it can read: the wall is enforced by the filesystem, not by the skill's instructions.
  • Notion access is the Claude connector's own authorization. No token lives in a vault, a script or this repo. Fill the database URL and data source ID into the skill before scheduling it.

The invariant

Only this task writes the database. See the invariants in the top-level README.