|
Entropic 2.3.8
Local-first agentic inference engine
|
Manages automatic context compaction. More...
#include <entropic/core/compaction.h>

Public Member Functions | |
| CompactionManager (const CompactionConfig &config, TokenCounter &counter) | |
| Construct a compaction manager. | |
| CompactionResult | check_and_compact (std::vector< Message > &messages, bool force=false, const std::string &conversation_id="") |
| Check if compaction is needed and perform if so. | |
| CompactionResult | compact_messages (const std::vector< Message > &messages) |
| Compact messages using the value-density strategy. | |
| void | set_storage (const struct StorageInterface *storage) |
| Set storage interface for compaction snapshots. | |
Public Attributes | |
| CompactionConfig | config |
| Compaction configuration. | |
| TokenCounter & | counter |
| Shared token counter. | |
Manages automatic context compaction.
Monitors token usage and triggers deterministic summarization when approaching the context limit. No model inference — uses structured extraction only.
Definition at line 113 of file compaction.h.
| entropic::CompactionManager::CompactionManager | ( | const CompactionConfig & | config, |
| TokenCounter & | counter | ||
| ) |
Construct a compaction manager.
| config | Compaction config (copied by value). |
| counter | Token counter instance (shared reference). |
| config | Compaction configuration. |
| counter | Token counter (shared reference). |
Definition at line 111 of file compaction.cpp.
| CompactionResult entropic::CompactionManager::check_and_compact | ( | std::vector< Message > & | messages, |
| bool | force = false, |
||
| const std::string & | conversation_id = "" |
||
| ) |
Check if compaction is needed and perform if so.
Check and perform compaction if over threshold.
| messages | Current message list (modified in place if compacted). |
| force | Bypass threshold check and compact immediately. |
| conversation_id | Conversation ID for snapshot (empty = skip). |
| messages | Message list (modified in place if compacted). |
| force | Bypass threshold. |
Definition at line 124 of file compaction.cpp.
| CompactionResult entropic::CompactionManager::compact_messages | ( | const std::vector< Message > & | messages | ) |
Compact messages using the value-density strategy.
Compact messages using value-density strategy.
Public entry point for the default compaction algorithm. Used by CompactorRegistry to wrap the built-in strategy as a compactor. Does NOT check thresholds — callers are responsible for that.
| messages | Messages to compact. |
Public wrapper around the private compact() method. Returns a fully-populated CompactionResult including the compacted message list. Does not check thresholds.
| messages | Messages to compact. |
Definition at line 428 of file compaction.cpp.
| void entropic::CompactionManager::set_storage | ( | const struct StorageInterface * | storage | ) |
Set storage interface for compaction snapshots.
| storage | Storage callbacks (nullable). |
| storage | Storage callbacks (nullable). |
Definition at line 458 of file compaction.cpp.
| CompactionConfig entropic::CompactionManager::config |
Compaction configuration.
Definition at line 157 of file compaction.h.
| TokenCounter& entropic::CompactionManager::counter |
Shared token counter.
Definition at line 158 of file compaction.h.