RetrieveFactsFromHistory
A history compression strategy for retrieving and incorporating factual knowledge about specific concepts from past session activity or stored memory.
This class leverages a list of Concept
objects, each encapsulating a specific domain or unit of knowledge, to extract and organize related facts within the session history. These facts are structured into messages for inclusion in the session prompt.
Parameters
concepts
A list of Concept
objects that define the domains of knowledge for which facts need to be retrieved.
Functions
Link copied to clipboard
open suspend override fun compress(llmSession: AIAgentLLMWriteSession, preserveMemory: Boolean, memoryMessages: List<Message>)
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.