compress
open suspend override fun compress(llmSession: AIAgentLLMWriteSession, preserveMemory: Boolean, memoryMessages: List<Message>)(source)
Compresses historical memory and retrieves facts about predefined concepts to construct a prompt containing the relevant information. This method generates fact messages for each concept and appends them to the composed prompt.
Parameters
llmSession
The local LLM write session used to retrieve facts and manage prompts.
preserveMemory
A flag indicating whether to preserve existing memory-related messages in the session.
memoryMessages
A list of existing memory-related messages to be included in the prompt.