← all repositories
stephenschoettler/hermes-lcm

DAG-based context that refuses to lose a message

hermes-lcm replaces Hermes Agent's lossy prompt compression with a SQLite-backed DAG so agents can recover exact details after compaction.

★1.3k stars Python AgentsLLMOps · Eval
hermes-lcm
Not currently ranked — collecting fresh signals.
star history

What it does

hermes-lcm plugs into Hermes Agent and replaces the default context compressor. Instead of asking an auxiliary model to summarize and discard older turns, it persists raw messages in a local SQLite store, compacts them into depth-aware summary nodes, and assembles the active prompt from a bounded mix of system instructions, hierarchical summaries, and a protected fresh tail. If the agent needs a specific fact from a compacted turn, it uses built-in recall tools to pull exact excerpts back into scope.

The interesting bit

The clever part is the DAG structure: summaries retain source lineage and can be condensed further into higher-level nodes, creating a hierarchical memory the agent can navigate without dumping the entire conversation history into the prompt. It is essentially a lossy-on-the-surface, lossless-in-the-archive design that treats context window limits as a retrieval problem rather than a deletion event.

Key highlights

  • SQLite-backed message store with FTS metadata and optional semantic retrieval.
  • Hierarchical summary DAG that preserves lineage and supports drill-down.
  • 15 built-in agent tools for recall, search, state inspection, and diagnostics (lcm_grep, lcm_recall, lcm_expand, etc.).
  • Optional redaction of API keys and bearer tokens before storage.
  • No required third-party runtime dependencies; runs fully offline.

Caveats

  • The README notes this is a v0.21.0-rc2 release with additive schema changes; operators should back up lcm.db before updating.
  • Several advanced features—semantic retrieval, temporal memory, and assertion sidecars—are opt-in and default-off, so the out-of-box experience is intentionally narrower than the full feature set.
  • Requires Hermes Agent host and Python 3.11+; not a standalone context manager.

Verdict

Worth a look if you run Hermes Agent and are tired of watching your agent’s “memory” get creatively rewritten by summaries. Skip it if you are not using Hermes or if you prefer your context compression simple and irreversible.

Frequently asked

What is stephenschoettler/hermes-lcm?
hermes-lcm replaces Hermes Agent's lossy prompt compression with a SQLite-backed DAG so agents can recover exact details after compaction.
Is hermes-lcm open source?
Yes — stephenschoettler/hermes-lcm is open source, released under the MIT license.
What language is hermes-lcm written in?
stephenschoettler/hermes-lcm is primarily written in Python.
How popular is hermes-lcm?
stephenschoettler/hermes-lcm has 1.3k stars on GitHub.
Where can I find hermes-lcm?
stephenschoettler/hermes-lcm is on GitHub at https://github.com/stephenschoettler/hermes-lcm.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.