Chunked

data class Chunked(val chunkSize: Int) : HistoryCompressionStrategy(source)

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.

The intent of this class is to manage long conversation histories by compressing them into smaller, summarized chunks, preserving memory and usability for LLM interactions.

Constructors

Link copied to clipboard
constructor(chunkSize: Int)

Properties

Link copied to clipboard

The size of chunks into which the prompt messages are divided.

Functions

Link copied to clipboard
open suspend override fun compress(llmSession: AIAgentLLMWriteSession, preserveMemory: Boolean, memoryMessages: List<Message>)

Compresses the conversation history into a summarized form (TLDR) using chunked processing.