stephenschoettler/hermes-lcm

Lossless Context Management plugin for Hermes Agent — DAG-based context engine that never loses a message

What it solves

hermes-lcm is a Lossless Context Management plugin for the Hermes Agent. It solves the problem of "lossy" context compression—where older parts of a conversation are summarized and the original raw details are removed from the model's active prompt—by ensuring that no information is ever permanently lost. It allows an agent to maintain a bounded active context window while retaining the full, raw history of the conversation for precise recovery.

How it works

Instead of simple one-shot compression, the plugin uses a hierarchical approach to memory:

  1. SQLite Storage: All raw messages are persisted in a local SQLite database with Full-Text Search (FTS) metadata.
  2. Summary DAG: As context grows, older messages are compacted into "depth-aware" summary nodes. These summaries are further condensed into a Directed Acyclic Graph (DAG), creating a hierarchy of summaries.
  3. Bounded Active Context: The active prompt is assembled from the system prompt, the most high-value summaries from the DAG, and a protected "fresh tail" of recent messages.
  4. Recall Tools: The agent is provided with a suite of tools (e.g., lcm_grep, lcm_recall, lcm_expand) to search, inspect, and retrieve the exact raw messages or specific summary nodes when detailed information is needed.

Who it’s for

Users of the Hermes Agent who need their AI agents to have "unbounded memory"—the ability to recall exact details from very long conversations or multiple sessions without flooding the LLM's context window with irrelevant data.

Highlights

  • Lossless Architecture: Raw messages are always preserved in SQLite, regardless of how many times the context is summarized.
  • Hierarchical Summarization: Uses a DAG to organize summaries, allowing the agent to drill down from high-level overviews to specific details.
  • Extensive Toolset: Includes 15 specialized tools for searching, recalling, expanding, and diagnosing memory state.
  • Source-Aware Retrieval: Maintains lineage so the agent knows exactly which raw messages contributed to a specific summary.
  • Advanced Memory Features: Optional support for semantic retrieval (embeddings), temporal memory (time-based rollups), and externalization of oversized payloads to prevent prompt crowding.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project