Expand description
TACO: self-evolving tool output compression.
The core abstraction is OutputCompressor, an async trait that post-processes
raw tool output before it is injected into the LLM context. When disabled, the
IdentityCompressor is wired in — its compress always returns Ok(None) and
is zero-cost beyond one virtual call per tool output.
§Architecture
OutputCompressor— core async trait.IdentityCompressor— default no-op.RuleBasedCompressor— regex rules loaded fromSQLite.CompressedExecutor— decorator wrapping the rootcrate::ToolExecutor.CompressionRuleStore— SQLite/Postgres-backed rule persistence.safe_compile— DoS-safe regex compilation with timeout.
§Invariants
- T1:
IdentityCompressoris the only compressor when[tools.compression] enabled = false. - T4: Audit logging happens inside individual tool implementations, not inside
CompressedExecutor. Because compression wraps outside the tool boundary, audit JSONL always records the raw pre-compression payload.
Re-exports§
pub use decorator::CompressedExecutor;
Modules§
- decorator
CompressedExecutor<E>— decorator that post-processes tool output through a compressor.
Structs§
- Compression
Rule - A single compression rule stored in the database.
- Compression
Rule Store - Persistence layer for TACO compression rules.
- Identity
Compressor - Pass-through compressor that never modifies tool output.
- Rule
Based Compressor - Regex-based compressor that applies operator- and LLM-evolved rules to tool output.
Enums§
- Compression
Error - Error variants for compression operations.
Traits§
- Output
Compressor - Core abstraction for tool output compression.
Functions§
- safe_
compile - Compile a regex pattern with
DoSprotection.