Pre-compaction memory flush

t-533·WorkTask·
·
·
Created3 weeks ago·Updated3 weeks ago

Description

Edit

Before compacting conversation history, run a silent turn prompting the agent to save important context to memory.

Inspired by moltbot's memory flush system:

  • Triggers when session nears context limit (configurable threshold)
  • Runs a silent agent turn with prompt like:

'Session nearing compaction. Save any important context to memory. Reply NO_REPLY when done.'

  • Only provides remember tool (minimal toolset)
  • Tracks flush per compaction cycle (don't flush twice)
  • NO_REPLY response is discarded

Implementation: 1. Add flush hook to Programs/Compaction.hs 2. Configure soft threshold (e.g., 4000 tokens before hard limit) 3. Add config: compaction.memoryFlush.enabled, .softThresholdTokens, .prompt

Reference: moltbot docs/concepts/memory.md 'Automatic memory flush'

Timeline (0)

No activity yet.