calute.agents.auto_compact_agent#

Auto-compaction config holder for CortexAgent.

class calute.agents.auto_compact_agent.AutoCompactAgent(llm_client: Any = None, model: str = '', auto_compact: bool = True, compact_threshold: float = 0.8, compact_target: float = 0.5, max_context_tokens: int = 8000, compaction_strategy: str = 'summarize', preserve_system_prompt: bool = True, preserve_recent_messages: int = 5, **_kwargs: Any)[source]#

Bases: object

Holds compaction configuration and exposes it to CortexAgent.

This is not an agent — it’s a config object that CortexAgent reads during its execution loop to decide when and how to compact context.

check_usage() dict[str, Any][source]#
get_statistics() dict[str, Any][source]#
record_compaction(tokens_before: int, tokens_after: int) None[source]#