FactRetrieval

A strategy for compressing history by extracting structured facts about predefined concepts from the current conversation history using an LLM, then replacing the full history with a compact assistant message that contains those extracted facts.

This strategy preserves all system messages as well as the first user message (if present) and memory messages (if provided), then appends a single assistant message summarising the extracted facts and the approximate number of tool interactions that occurred.

System, User, Assistant, ToolCall, ToolResult, Assistant -> [System, User, Memory, Assistant(CONTEXT RESTORATION facts about configured concepts)]

Parameters

concepts

The list of Concept objects that define which topics to extract facts about.


A strategy for compressing history by extracting structured facts about predefined concepts fro m the current conversation history using an LLM, then replacing the full history with a compact assistant message that contains those extracted facts.

This strategy preserves all system messages as well as the first user message (if present) and memory messages (if provided), then appends a single assistant message summarising the extracted facts and the approximate number of tool interactions that occurred.

System, User, Assistant, ToolCall, ToolResult, Assistant -> [System, User, Memory, Assistant(CONTEXT RESTORATION facts about configured concepts)]

Return

A HistoryCompressionStrategy configured for fact-based history compression.

Parameters

concepts

A variable number of Concept objects that define the topics for which facts are to be extracted from the conversation history.