Crig::Memory::CompactingMemory(M, P, C)
Inherits Crig::Memory::ConversationMemory < Reference < Object
A ConversationMemory adapter that wraps a backend with a MemoryPolicy and a Compactor, replacing truncated turns with a summary message spliced at the front of the loaded history.
The loaded history shape is [summary_message, ...kept_window] when any compaction has occurred, or just kept_window otherwise. The summary is recomputed on every load that produces newly-evicted messages, folding older summaries into newer ones via the compactor's carry_over parameter.
Concurrent load calls on the same conversation_id are serialized at the compaction seam: only one call invokes the compactor at a time; others observe the previously-stored summary and return immediately.
Constructors
new(inner : M, policy : P, compactor : C)
SourceInstance methods
compactor
Sourceinner
Sourceinto_inner
Sourcepolicy
Sourcetracked_conversations
Source