Skip to main content
The Async Context Compression Filter (async_context_compression) is a mAItion Filter, not a Workspace Tool. It runs automatically on every message, summarizing and trimming older parts of a long conversation once the token count crosses a threshold, so the model keeps receiving requests it can handle without losing the conversation’s context.

Valves

All 9 valves in the table above can be edited after install from the filter’s settings in mAItion. compression_threshold_tokens, max_context_tokens, max_summary_tokens, enable_tool_output_trimming, and tool_trim_threshold_chars are additionally set at install time from the env vars below; the other 4 valves start at the filter’s own coded default and have no env var.

Enabling via ENV

The filter can be enabled via ENV. Set in .env:
FUNCTION_ASYNC_CONTEXT_COMPRESSION_ENABLED=True is the only required condition to install. Optionally, set any of the following to override the defaults shown in the Valves table above:
Any of these left unset falls back to the default shown in the Valves table above. The database user mAItion connects with needs permission to create tables for this filter’s summaries to persist between requests.
This installs only during first-start initialization — the setup that runs only once, the first time the container boots, gated on a marker file. Setting FUNCTION_ASYNC_CONTEXT_COMPRESSION_ENABLED=True on an already-running instance does not install it retroactively.