Skip to main content
Mythos

A **pluggable context engine** in 📝Hermes Agent is a plugin that replaces the built-in ContextCompressor, taking over how the agent tracks token usage and compacts conversation context as it nears the limit.

Every engine implements the ContextEngine abstract base class in agent/context_engine.py, of which the built-in compressor is the default implementation. Required members are a name and the methods update_from_response(), should_compress() and compress(), which returns a compacted, possibly shorter message list. Optional hooks cover session start and end, agent-callable engine tools, and select_context(), which can replace the messages sent in a single request without altering stored history. The docs' example is a Lossless Context Management engine that builds a knowledge DAG instead of lossy summarization.

Only one engine is active at a time. It is chosen by context.engine in config.yaml, which defaults to compressor, either by editing the file or through hermes plugins under Provider Plugins, and a plugin engine is never activated automatically. Engines live in plugins/context_engine/<name>/ or in the user's ~/.hermes/plugins/ directory, and a general plugin can register one with ctx.register_context_engine(); a second registration is rejected with a warning.

Hermes classes context engines and memory providers together as provider plugins, each limited to one active selection. The docs advise that a plugin which only needs to observe or index finished turns should be a memory provider instead, because a context engine takes ownership of the session's compaction policy. The general practice of shaping what a model receives is described in 📝Context Engineering.

Contexts

MythOS is a product of Cooperating Citizens of One, Inc.

TermsPrivacyRefundsContact

© 2026 Cooperating Citizens of One, Inc. · MythOS since 2017 · Not affiliated with Anthropic.