The Nightly Compaction Pass
Just like biological sleep consolidates memories, Wolffish runs a nightly compaction pass that distills each day’s episode entries into a compact summary and promotes durable facts into knowledge files. This keeps long-term memory high-signal without ever touching the raw logs.Location
YYYY-WNN.md.
How It Works
Two scheduled jobs share the consolidated file:Daily Compaction in Detail
The daily pass used to be an extractor: it never saw what it had already written, so it re-derived the same facts night after night and appended every paraphrase as a fresh bullet — the same phone number recorded a dozen times, contradictions accumulating side by side. Since v1.0.233 it works as a curator:- Trigger — The brainstem’s cron scheduler fires at the configured hour
- Gather — Reads today’s episode file (very long days are middle-truncated at ~160k characters) and the current contents of the five knowledge files; skips the run if the day has fewer than 3 entries
- Curate — The LLM returns complete replacement knowledge files, not a list of new facts: one tidy
##section per person, project, and topic; near-duplicates merged into a single line; contradictions resolved in favour of the newest evidence; junk deleted on sight - Rewrite — Each changed file is replaced whole, with its previous version kept as
<file>.md.bakright beside it. The##section structure the<memory_map>depends on is enforced by the app itself, not entrusted to model discipline — and your own hand-written edits survive curation - Record — The pass’s summary is appended to the week’s consolidated file under a
## Compaction for YYYY-MM-DDheading - Index — The cortex re-indexes the changed files via the file watcher
The Weekly Coverage Digest
The weekly pass used to re-append the raw 7-day episode concatenation on top of the daily summaries. That only polluted the file — and the search index — with one giant low-quality record. It now writes a compact coverage line instead:Example Consolidated File
Here’s what2026-W20.md might look like:
Why Consolidation Matters
Episodes are verbose — a busy day might produce 20+ entries, and every tool call adds a line. Consolidation isn’t about squeezing memory into the prompt (nothing is injected anymore); it’s about signal quality on the read side:- Durable facts graduate into knowledge files — kept tidy by curation rather than piling up — where the
<memory_map>surfaces their topics andmemory_getfetches them in one call. - Consolidated summaries are high-signal search records.
memory_searchwithsources: "consolidated"hits a week of distilled themes instead of hundreds of raw turn blocks. - Nothing is lost. The raw episodes stay on disk and stay indexed — consolidation adds a compressed layer, it never replaces the original.
Configuration
Compaction settings live inconfig.json:
You can also configure these from the Memory compaction card in Settings → Knowledge → Compaction, which shows the next scheduled run for each job in your local timezone. Once a job has run, the card also shows its last completed run — when it ran, how long it took, the output it produced (the daily summary, or the weekly coverage digest), and, for the daily summary’s model call, the tokens in and out. Skipped or failed passes never overwrite it, so what you see is always the last run that actually produced something, and its timestamp stays honest about how long ago that was.
Compaction jobs run through the brainstem’s run pool — up to three jobs at once, and an overflow fire is queued rather than dropped. Summarization runs on your configured Brain with reasoning off — it’s quick utility work, so it stays fast and cheap regardless of the reasoning level you’ve picked for chat. (The weekly pass makes no model call at all — it writes a computed coverage line.) The same scheduler drives the nightly reflection jobs, which share the Knowledge settings page.
Retrieval
Consolidated files are indexed by the cortex like everything else. They are never injected into the prompt — the model reaches them through the retrieval tools:memory_searchwithsources: "consolidated"for themed weekly contextmemory_geton afile:ref to read a whole weekwolffish_recallwith a date to land in the right week