This is an early release preview. You may encounter bugs.
Hermes-LCM logo
Unclaimed

Tool memory

Hermes-LCM

Hermes Agent plugin that swaps lossy context compression for a SQLite-backed summary DAG with exact-recall tools

B 79/100 GitHub score ? This grade is derived from GitHub signals, not user votes. Open for the full breakdown.
No votes yet

01 / About

What Hermes-LCM is.

Hermes-LCM is a context-engine plugin for Hermes Agent that replaces one-shot prompt compression with a SQLite-backed, directed-acyclic-graph context store. Raw messages are persisted with full-text-search metadata before compaction, older material is compacted into depth-aware summary nodes, those summaries are condensed into a hierarchy as they accumulate, and the active prompt is assembled from the system prompt, the highest-value summaries, and a protected fresh tail.

The point of keeping the graph is recall. Agent tools let a session search and drill back into compacted material in bounded pages instead of reloading everything: lcmgrep searches current-session raw messages and summaries, lcmrecall searches across all conversations by meaning using fused full-text, summary-vector, and chunk-vector arms, lcmexpand recovers source messages, child summaries, or externalized payloads, and lcmstatus, lcminspect, and lcmdoctor report health, lineage, and diagnostics. Summaries retain source lineage, so retrieval can be filtered by descendant sources.

Installation is a clone into the Hermes plugin directory, or a symlink from an existing checkout; the plugin must then be listed under plugins.enabled and selected as context.engine: lcm. It targets Python 3.11 and later with no required third-party runtime dependencies — tiktoken and regex are used when present, with character-based token estimates and disabled message-regex filtering as fallbacks. When LCM is the active engine for a session it registers one prellmcall hook that injects a recall policy into the user-message context rather than the system prompt, preserving the cache prefix.

Behaviour is tuned through environment variables: the compaction threshold as a fraction of the context window, the protected fresh-tail message count and optional token cap, condensation depth, leaf chunk sizes, database path, and summarization model, fallbacks, timeouts, and circuit breaker. Three opt-in, default-off families extend it further — large-output externalization with context-budget controls, temporal memory with day, week, and month rollups reachable through lcm_recent, and embedding-backed semantic and hybrid retrieval with cloud or fully local providers. Optional named redaction can strip API keys, bearer tokens, passwords, and private keys before storage, which is deliberately not lossless for the matched values.

Features

  • SQLite message store: raw messages persist with FTS metadata before any compaction
  • Summary DAG: depth-aware leaf summaries condensed into higher-depth nodes as history accumulates
  • Bounded recovery: raw messages, child summaries, and externalized payloads page back in rather than flooding the prompt
  • Recall tools: 15 lcm_* tools covering search, expansion, evidence compilation, computation, status, inspection, and diagnostics
  • Cross-conversation recall: lcm_recall fuses full-text, summary-vector, and chunk-vector arms with reciprocal rank fusion and a recency prior
  • Source lineage filtering: raw rows and summaries can be filtered by descendant source lineage
  • Recall policy hook: a deterministic prellmcall hook injects routing policy into the user-message context, keeping the system-prompt cache prefix stable
  • Large-payload controls: oversized tool, media, and raw payloads move to externalized refs with stable handles
  • Temporal memory: day, week, and month rollups with natural-time recall through lcm_recent
  • Semantic retrieval: opt-in embedding-backed semantic and hybrid grep modes with cloud or fully local providers
  • Sensitive-pattern redaction: optional named redaction of API keys, bearer tokens, passwords, and private keys before storage
  • Session controls: glob patterns ignore noisy sessions or keep them read-only, and OpenClaw history can be backfilled from a database or JSONL exports

02 / Discussion CREDIBILITY-GATED

Discussion

Reading is open to everyone. Posting and voting need a verified identity or a GitHub grade of B or higher.

  • No discussions yet.

03 / Build

Build with Hermes-LCM.

Browse the catalogue for frameworks, tools, and harnesses, each scored on real GitHub credibility.

Get Hermes-LCM →

Browse the catalogue