WholeHistoryMultipleSystemMessages
WholeHistoryMultipleSystemMessages is a concrete implementation of the HistoryCompressionStrategy that handles scenarios where the conversation history contains multiple system messages.
This strategy:
Splits the history into blocks based on system message boundaries
Processes each block separately to generate TL;DR summaries
Maintains the chronological order of system messages while compressing the conversation
Preserves memory messages only in the first block to maintain context
System1, User1, Assistant, ToolCall, ToolResult, System2, User2, Assistant, User3, System3, Assistant, System4 ->System1, User1, Memory, TLDR(System1, User1, Assistant, ToolCall, ToolResult), System2, User2, TLDR(System2, User2, Assistant, User3), System3, Assistant, TLDR(System3, Assistant) System4, TLDR(System4)
Functions
Compresses and adjusts the prompt for the agent's write session by summarizing and incorporating memory messages optionally.