memory: auto-summarize session into memory.jsonl on :q (cross-session distillation) #102
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
Today
:memory summarizeis a manual meta — users have to remember to run it before quitting, or the session's insights are lost. Phase 4's memory.jsonl + startup-context injection provides the persistence + recall, but the in-flow is gated on user action.The German analysis 2026-05-17 strategy 5 ("History-Zusammenfassung via local", 3h, medium ROI, location: history.lua-shaped module) called this out as a small-local-model improvement: every session should produce a digest that the NEXT session's [background] memory block can use to skip rediscovery.
Proposal
Wires the existing
:memory summarizedistill flow (repl.lua ~1770) intoshutdown_session. On:qwithauto_summarize_on_quit=trueand turn count above threshold, fire one broker.chat againstsummary_modelasking for 1-3 memory items, append to memory.jsonl. Failure is silent (don't block shutdown).Composition
:memory summarize.Acceptance
Effort
~3h. Mostly extracting the
:memory summarizebody into a callable + wiring into shutdown_session + adding the cfg gate.