compressHistory

suspend fun AIAgentFunctionalContext.compressHistory(strategy: HistoryCompressionStrategy = HistoryCompressionStrategy.WholeHistory, preserveMemory: Boolean = true)(source)

Compresses the current LLM prompt (message history) into a summary, replacing messages with a TLDR.

Return

The input value, unchanged.

Parameters

strategy

Determines which messages to include in compression.

preserveMemory

Specifies whether to retain message memory after compression.