Whether post-run compaction is enabled
OptionalextractWhether to trigger async note/example extraction via MemoryManager (default: true)
OptionalmaxMaximum number of scratchpad notes to retain after pruning expired/excess notes (optional)
OptionalmessageMinimum conversation message count before post-run compaction triggers (default: 20)
Configuration for background post-run conversation compaction, memory extraction, and scratchpad pruning after an agent run completes (
finalizeAgentRun), so the next user turn starts with a pre-compacted message window and zero compaction latency.When enabled via ExecuteAgentParams.compactAfterRun,
BaseAgent.finalizeAgentRunruns post-run maintenance after flushing step saves and persisting the run record:20), preserving the initial goal message (index 0) and the most recent messages.true) and the run succeeded, triggers asynchronous memory extraction viaMemoryManagerAgent.All post-run maintenance runs inside defensive error boundaries so failures are logged diagnostically without ever failing a completed agent run.