HistoryCompressionStrategy
Represents an abstract strategy for compressing the history of messages in a AIAgentLLMWriteSession
. Different implementations define specific approaches to reducing the context size while maintaining key information.
Example implementations:
Inheritors
Types
A concrete implementation of the HistoryCompressionStrategy
that splits the session's prompt into chunks of a predefined size and generates summaries (TL;DR) for each chunk.
A strategy for compressing history by retaining only the last n
messages in a session.
WholeHistory is a concrete implementation of the HistoryCompressionStrategy that encapsulates the logic for compressing entire conversation history into a succinct summary (TL;DR) and composing necessary messages to create a streamlined prompt suitable for language model interactions.