Skip to content

Memory autosave: digest finished turns into the memory store automatically #42

Description

@A-x6

The memory engine (#29 added the store, save/recall tools, and TUI commands) currently only captures what the model explicitly saves via the memory_save tool. The capture pipeline in packages/memory (MemoryCapture.turn, MemoryTurn.open/close) supports automatic turn-close digestion, but nothing in the CLI host drives it — so autosave never runs.

Wire the host side:

  • Implement the capture ports against the CLI session store and provider (MemoryPorts.SessionPort reading the latest finished turn + diffs, MemoryPorts.ModelPort resolving/running the consolidation model via the ai SDK).
  • Open a memory turn when a prompt loop starts and close it when the loop exits (completed / error / interrupted), so the package can digest the turn or schedule an idle flush.
  • The whole path must be a cheap no-op when memory is disabled, and must never break or delay the session loop (fire-and-forget close, errors swallowed and logged).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions