yantrikdb-hermes-plugin makes YantrikDB, a cognitive memory database, the memory provider for Hermes. It is a standalone Python plugin registered with a Hermes installation rather than a provider merged upstream, and since v0.2.0 its default backend runs in-process with no separate server, token, or GPU. An alternative HTTP backend targets a YantrikDB server for high-availability clusters.
The plugin addresses two failure modes of plain vector memory in long-running agents: context compression silently dropping earlier constraints, and newer facts being outranked by stale ones. Its on_pre_compress hook injects the highest-salience memories before Hermes compresses the context, and recency-aware ranking keeps fresh facts above superseded ones without deleting history. After a write, a maintenance pass (think()) canonicalizes duplicate facts and surfaces contradictions as triggers the agent can acknowledge, dismiss, or act on, and relate() adds graph edges so related memories boost each other on recall. Every recall() result carries a why_retrieved list of scoring reasons.
Twelve tools are exposed by default (remember, recall, forget, think, conflicts, resolve conflict, relate, stats, and four trigger-lifecycle tools), with a default core tool profile of 7 tools (about 1,700 tokens per turn) and a full profile of 18. Every tool response carries the same status envelope so a failure cannot be summarized away as success. Five lifecycle hooks consolidate at session end, preserve memories through compression, mirror Hermes's built-in memory-file writes, adapt the prompt budget to the context window remaining, and persist what delegated sub-agents found. For always-on deployments that rarely reach a session boundary, consolidation also runs on a turn cadence.
Since v0.8 the memory is self-directing: it records recall demand it could not answer as knowledge gaps, queues them as durable tasks, and hands the agent an agenda at the next session, closing each gap once answered. Opt-in skills store agent-authored procedural patterns with an outcome ledger, kept separate from Hermes's own human-authored filesystem skills. Further opt-in features cover owner scoping (a memory namespace per person when several people share one agent over Telegram, WhatsApp, or Discord), a fleet mode where each agent gets its own namespace with a shared team namespace and a read-only fleet view, standing rules injected ahead of recalled memory and never trimmed, sealed and signed knowledge packs that mount and unmount without changing the agent's own memory, idempotent writes, and proactive hygiene scans.
The bundled embedder is a static model2vec model (potion-base-2M, about 8 MB), with larger potion tiers, multilingual model2vec, and sentence-transformers loaders available. A reproducible recall benchmark over a 40-memory, 37-query corpus reports recall@3 and recall@5 of 1.000 and MRR 0.928 with the bundled embedder, and CI asserts floors against regression. In the embedded backend, p50 latency is 0.60 ms for a write and 2.58 ms for a recall. A 1,000-fact probe against other Hermes memory providers on an unmodified Hermes install records precision@5 of 0.80 for yantrikdb, with each table cell backed by captured findings files.
Features
- Hermes memory provider: installs as a standalone plugin and is selected through Hermes's memory setup, with an in-process default backend and an HTTP backend for clusters
- Contradiction tracking: conflicts() surfaces superseded or conflicting claims and resolve_conflict() closes them instead of silently overwriting
- Explainable recall: every result carries a why_retrieved list of scoring reasons (semantic, keyword, importance, recency) in the standard response shape
- Self-maintaining substrate: think() canonicalizes duplicates and raises triggers for redundancies, conflicts, and cross-domain connections, which the agent acknowledges, dismisses, or acts on
- Compression survival: the on_pre_compress hook injects the highest-salience memories before Hermes compresses context, and a verbatim recent-turns buffer survives compression
- Self-directing loop: knowledge gaps from unanswered recall become durable tasks and an agenda handed to the agent, closed when the gap is answered, on by default since v0.10.0
- Agent-authored skills: opt-in skill_define, skill_search, and skill_outcome tools store procedural patterns with an append-only outcome ledger
- Owner scoping and fleets: per-person namespaces for shared agents, per-agent namespaces for fleets with an optional shared team namespace and read-only fleet view
- Standing rules and knowledge packs: a constitution file injected ahead of recalled memory and never trimmed, plus sealed, signed packs that mount for a task and unmount without altering the agent's own memory
- Tool-surface control: a core profile of 7 tools (about 1,700 tokens per turn) or full with 18, and a uniform status envelope on every tool response
- Pluggable embedders: bundled potion-base-2M static embeddings with larger potion tiers, multilingual model2vec, sentence-transformers, or a custom Python class
- Benchmarked recall: a reproducible recall@k and MRR benchmark with CI-guarded floors, and a published 1,000-fact comparison probe against other Hermes memory providers




