Class: Phronomy::Memory::Compression::Base Abstract
- Inherits:
-
Object
- Object
- Phronomy::Memory::Compression::Base
- Defined in:
- lib/phronomy/memory/compression/base.rb
Overview
Subclass and implement #compress.
Abstract base class for compression strategies.
Two kinds of compression exist:
Content pruning (e.g. ToolOutputPruner) — modifies individual message content in-place (e.g. truncates oversized tool outputs). The original data loss is limited and intentional (tool outputs are auxiliary). These subclasses return { messages: Array, compaction: nil }.
Compaction (e.g. Summary) — replaces multiple messages with an LLM summary. Originals are preserved in Storage via a compaction record. These subclasses return { messages: Array, compaction: Hash } where compaction is { start_seq:, end_seq:, summary_text: }.
ConversationManager inspects the :compaction key and persists the record in Storage when present.
Direct Known Subclasses
Instance Method Summary collapse
-
#compress(thread_id:, messages:, seq_offset: 0) ⇒ Hash
Compress a message array and return a result hash.
Instance Method Details
#compress(thread_id:, messages:, seq_offset: 0) ⇒ Hash
Compress a message array and return a result hash.
31 32 33 |
# File 'lib/phronomy/memory/compression/base.rb', line 31 def compress(thread_id:, messages:, seq_offset: 0) raise NotImplementedError, "#{self.class}#compress is not implemented" end |