hermes-lcm: A DAG-Based Lossless Context Plugin for Hermes Agent
Lossless Context Management plugin for Hermes Agent, DAG-based context engine that never loses a message.
At a glance
- What is it?
- hermes-lcm is a Python plugin for Hermes Agent that replaces one-shot active-context compression with a SQLite-backed DAG engine. It keeps every raw message recoverable, condenses older history into hierarchical summary nodes, and gives the agent tools to drill back into compacted content without flooding the active prompt.
- Who is it for?
- hermes-lcm is worth adopting for Hermes Agent users who work on long, complex sessions where Hermes's built-in compression is dropping context that the agent later needs to retrieve. The DAG-based approach, SQLite persistence, and recall tools together make old content recoverable rather than permanently summarized away.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 15 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 25, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What hermes-lcm Solves and Who Needs It
Hermes Agent's built-in compression handles context overflow by pruning older tool results, asking an auxiliary model to summarize the older conversation, and rebuilding the active prompt from that summary plus a protected recent tail. The original session rows can persist in Hermes's state.db and remain searchable through host-level tools, but the active context no longer contains compacted turns verbatim. There is no structured path from the summary back to the specific detail it condensed.
hermes-lcm takes a different approach. It keeps the live prompt bounded while making the compacted content retrievable on demand. The plugin stores raw messages in its own SQLite store before any compaction happens, builds a summary DAG over time, and exposes agent tools that can search, page through, and expand the compacted history without dumping it all back into the active prompt at once.
The target users are engineers running Hermes Agent on sessions where historical detail matters: long debugging sessions where an earlier error trace becomes relevant again hours later, or research sessions where the agent needs to compare two decisions made in different parts of the conversation. The plugin is based on the LCM paper by Ehrlich and Blackman published by Voltropy PBC in February 2026.
How the DAG-Based Context Engine Works
The engine operates in five steps on every compaction cycle. First, it persists raw messages to a plugin-local SQLite store with full-text search metadata before the messages leave the active prompt. Second, it compacts the oldest portion of the active context into depth-aware summary nodes. Third, it condenses accumulated summaries into a hierarchical DAG as they build up. Fourth, it assembles the active context from the system prompt, the highest-value summaries from the DAG, and the protected fresh tail of recent messages. Fifth, it provides recall tools the agent can invoke to search, inspect, and expand compacted material when it becomes relevant.
The DAG structure preserves source lineage: each summary node records which raw messages it was derived from. This means a drill-down path always exists from a summary back to the original content, bounded by paging rather than a full dump. Oversized payloads, such as large tool results or base64 media content, are externalized to stable references rather than stored inline in SQLite.
This design is explicitly different from what the README calls Hermes core's approach. The README instructs integrators to position LCM around retrieval quality, drill-down behavior, and autonomy, and not to claim that Hermes core keeps no persistent history.
Installing hermes-lcm as a Hermes Plugin
The canonical installation path clones the repository into the Hermes global plugin directory:
git clone https://github.com/stephenschoettler/hermes-lcm \
~/.hermes/plugins/hermes-lcmFor a profile-specific install that applies only to a named Hermes profile:
git clone https://github.com/stephenschoettler/hermes-lcm \
~/.hermes/profiles/myprofile/plugins/hermes-lcmAfter cloning, run the installer script even when the checkout already lives at the canonical path. The script exposes the bundled hermes-lcm skill in the matching skills/ directory and preflights both the global and profile paths:
./scripts/install.shFor a profile-aware install:
HERMES_PROFILE=myprofile ./scripts/install.shPrerequisites are Hermes Agent and Python 3.11 or later. The plugin has no required third-party runtime dependencies at install time. The tiktoken library is used for accurate token counting if present; without it, hermes-lcm falls back to character-based estimates. The regex library provides timeout-guarded pattern matching for session ignore filters; without it, message-level regex filtering is disabled with a warning rather than running potentially unbounded stdlib re matches.
The Agent Tools: Recall, Search, and Diagnostics
hermes-lcm exposes fourteen agent tools that the Hermes Agent can invoke during a session. The recall family covers the core use cases: lcm_recall retrieves content by topic or time range, lcm_grep performs keyword or semantic search across the SQLite store, lcm_recent surfaces temporally organized history through natural-time queries, and lcm_retrieve fetches a specific compacted block by reference.
The inspection tools allow the agent to understand what is in the store without flooding the active context. lcm_describe gives a high-level summary of what a compacted block contains, lcm_expand pages through its raw content or child summaries, lcm_expand_query combines expansion with a targeted search, and lcm_inspect examines a specific stored item's metadata and source lineage.
The state and evidence tools serve more specialized needs. lcm_query_state checks the current context assembly, lcm_compute and lcm_compile_evidence support building structured evidence packs, and lcm_evidence_pack assembles them into a shareable artifact. lcm_load_session loads a previous session's context into the current one.
Finally, two operational tools handle housekeeping. lcm_status reports the runtime health of the plugin, including database statistics and active configuration. lcm_doctor runs a full diagnostic, checks the database integrity, and can trigger backup-first repair or rotation paths.
Three Optional Feature Families That Extend LCM
Beyond the core compression loop, hermes-lcm includes three opt-in feature families that are disabled by default. Each adds capability at the cost of additional configuration or compute.
The first is large-output externalization and context-budget controls. Giant tool results move to recoverable references instead of occupying space in the active prompt or inline in SQLite. This is particularly relevant for sessions that invoke tools returning large JSON payloads, image data as base64, or multi-page document text. The context-budget controls let operators set limits on how much of the prompt is occupied by any single category of content.
The second is temporal memory. This adds day, week, and month rollup summaries on top of the core DAG, plus natural-time recall through the lcm_recent tool. The lcm_recent tool accepts queries phrased in relative time terms rather than requiring exact session identifiers, which makes it useful for multi-day projects where the agent might need to recall what happened yesterday or last week.
The third is semantic retrieval. This enables embedding-backed modes for lcm_grep, allowing hybrid keyword and semantic search across the stored history. The README lists free-tier cloud providers and fully-local embedding options. Semantic retrieval requires a configured embedding provider and adds per-query compute cost, which is why it is off by default.
Limitations and the Relationship to Hermes Core Compression
hermes-lcm is a plugin for a specific agent, Hermes Agent. It is not a standalone tool and has no application outside of that agent. Engineers using a different agentic framework, such as LangChain or Microsoft AutoGen, cannot use this plugin without either switching to Hermes Agent or adapting the plugin's architecture to another host.
The README's own guidance on positioning is worth noting directly: it says to position LCM around retrieval quality, autonomy, and drill-down behavior, and to not claim that Hermes core compression has no persisted history. This means hermes-lcm and Hermes core compression serve different tradeoffs rather than one being simply better. Hermes core compression is simpler, requires no plugin setup, and may be sufficient for sessions where the agent rarely needs to retrieve specific early details. hermes-lcm is appropriate when drill-down retrieval quality matters and the developer is willing to manage plugin configuration.
The plugin's pyproject.toml intentionally declares no build system or project metadata: it is not installable via pip. Installation is via the git clone and install.sh path only. The last push was on 2026-09-14, and the repository shows a recent release cadence with v1.0.0-rc.1 tagged on 2026-09-04.
Editorial conclusion
hermes-lcm is worth adopting for Hermes Agent users who work on long, complex sessions where Hermes's built-in compression is dropping context that the agent later needs to retrieve. The DAG-based approach, SQLite persistence, and recall tools together make old content recoverable rather than permanently summarized away. The tradeoff is setup complexity: the plugin requires Python 3.11 or later, must be cloned to the Hermes plugin path, and the optional semantic retrieval family requires a separate embedding provider. Before adopting it, run the lcm_doctor tool after installation to verify the plugin health, and review the Feature overview documentation to decide which of the three optional feature families your session type actually needs.
Frequently asked questions
What is hermes-lcm?
hermes-lcm is a Python plugin for Hermes Agent that implements Lossless Context Management. It keeps raw messages in a SQLite store, builds a hierarchical DAG of summary nodes over compacted history, and provides agent tools for searching and recovering specific historical detail without overflowing the active prompt.
Does hermes-lcm require third-party Python packages?
No required dependencies exist at runtime. The tiktoken library improves token count accuracy if installed; without it, the plugin uses character-based estimates. The regex library enables timeout-guarded session ignore patterns; without it, message-level regex filtering is disabled with a warning.
How do I verify that hermes-lcm installed correctly?
Run the lcm_doctor agent tool after installation. It checks database integrity, reports runtime health, and surfaces configuration issues. It can also trigger backup-first repair paths if the database has a problem.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/stephenschoettler-hermes-lcm)