Skip to main content

MuninnDB-backed memory provider plugin for Hermes Agent

Project description

MuninnDB memory provider for Hermes Agent

Bottom line:

  • This is a standalone Hermes memory-provider plugin backed by MuninnDB.
  • It uses MuninnDB's MCP endpoint for recall, explicit writes, and health/status checks.
  • It adds deliberate memory tools plus automatic recall/capture hooks.

Quick install for Hermes users

git clone https://github.com/aditzel/hermes-muninndb-plugin.git ~/.hermes/plugins/muninndb
git -C ~/.hermes/plugins/muninndb checkout <release-tag>  # for example: v0.2.1
mkdir -p ~/.hermes/hermes-agent/plugins/memory
ln -sfn ~/.hermes/plugins/muninndb ~/.hermes/hermes-agent/plugins/memory/muninndb
hermes config set memory.provider muninndb
hermes memory setup
  • Updating an existing install:
git -C ~/.hermes/plugins/muninndb fetch --tags
git -C ~/.hermes/plugins/muninndb checkout <release-tag>  # or: git -C ~/.hermes/plugins/muninndb pull --ff-only
hermes config set memory.provider muninndb
  • pip install hermes-muninndb-plugin publishes the Python package successfully, but Hermes still needs the plugin files in ~/.hermes/plugins/muninndb until external memory-provider discovery is fully landed upstream.

What it does

  • Automatic recall before turns via muninn_recall
  • Durable SQLite write-behind turn capture via muninn_remember
  • Replays pending writes after crashes or restarts
  • Mirrors built-in Hermes memory writes into MuninnDB
  • Reuses the existing Muninn MCP server config from config.yaml when available, including its bearer token
  • Exposes namespaced tools to the model:
    • muninndb_recall
    • muninndb_remember
    • muninndb_forget
    • muninndb_entity
    • muninndb_status
  • Adds CLI helpers:
    • hermes muninndb status
    • hermes muninndb ping

Files

  • __init__.py — Hermes plugin entrypoint wrapper
  • cli.py — Hermes CLI wrapper
  • src/hermes_muninndb_plugin/__init__.py — actual provider implementation
  • src/hermes_muninndb_plugin/cli.py — actual CLI implementation
  • plugin.yaml — Hermes plugin manifest
  • pyproject.toml — packaging and test metadata
  • .github/workflows/ci.yml — CI for tests/build
  • tests/test_muninndb_plugin.py — unit tests

Installation

  1. Put the plugin where Hermes can discover it.

Preferred layout when your Hermes version supports user-installed memory providers:

mkdir -p ~/.hermes/plugins/muninndb
rsync -a --delete /path/to/hermes-muninndb-plugin/ ~/.hermes/plugins/muninndb/

If your Hermes build still only scans bundled plugins/memory/ directories, symlink it into the Hermes source tree instead:

ln -s /path/to/hermes-muninndb-plugin ~/.hermes/hermes-agent/plugins/memory/muninndb
  1. Configure Hermes to use the provider.
hermes config set memory.provider muninndb
hermes memory setup
  1. Or write the config directly.

$HERMES_HOME/muninndb.json

{
  "endpoint": "http://127.0.0.1:8750/mcp",
  "vault": "default",
  "auto_recall": true,
  "auto_capture": true,
  "mirror_builtin_memory": true,
  "capture_assistant_turns": true,
  "recall_mode": "balanced",
  "recall_limit": 6,
  "recall_threshold": 0.45,
  "timeout": 10.0,
  "flush_timeout": 5.0,
  "max_turn_chars": 4000
}

Optional secret in $HERMES_HOME/.env:

MUNINN_MCP_TOKEN=your-token-here

You can also avoid duplicating the token entirely if Hermes already has a Muninn MCP server configured in config.yaml; the plugin will reuse that Authorization: Bearer ... header automatically.

You can also override config with env vars:

  • MUNINN_MCP_URL
  • MUNINN_ENDPOINT
  • MUNINN_MCP_TOKEN
  • MUNINN_VAULT

Behaviour mapping

Hermes lifecycle -> MuninnDB action

  • prefetch(query) -> muninn_recall
  • queue_prefetch(query) -> background muninn_recall
  • sync_turn(user, assistant) -> background muninn_remember
  • on_memory_write(add|replace, target, content) -> background muninn_remember
  • on_session_end(messages) -> drain queued writes

Tool behaviour

muninndb_recall

  • Purpose: deliberate recall when automatic injection is not enough
  • Input: query, optional limit, mode, threshold
  • Backend call: muninn_recall

muninndb_remember

  • Purpose: explicit durable write
  • Input: content, optional concept, type, summary, confidence, tags
  • Backend call: muninn_remember

muninndb_forget

  • Purpose: explicit cleanup/delete by memory id
  • Input: id
  • Backend call: muninn_forget

muninndb_entity

  • Purpose: inspect an entity and its connected memories
  • Input: name, optional limit
  • Backend call: muninn_entity

muninndb_status

  • Purpose: health/capacity snapshot
  • Backend call: muninn_status

CLI

hermes muninndb status
hermes muninndb ping

Testing

make test
make smoke
make build

Equivalent direct commands:

python3 -m pytest tests/test_muninndb_plugin.py -q
python3 -m py_compile __init__.py cli.py src/hermes_muninndb_plugin/__init__.py src/hermes_muninndb_plugin/cli.py
python3 -m build

Design notes

  • Uses stdlib HTTP (urllib) rather than third-party dependencies.
  • Uses a durable SQLite async queue for write-behind persistence and crash recovery.
  • Scopes recall and writes with platform, identity, session, and user tags.
  • Falls back to the existing Hermes Muninn MCP server config in config.yaml so one source of truth can supply the token.
  • For subagents/cron/flush contexts, write-back is disabled; recall still works.

Caveats

  • Recall is semantic, so immediate exact-string lookups are not guaranteed to rank first without enough signal. Use muninndb_entity or Muninn's direct muninn_read/muninn_recall tools when you need forensic precision.
  • This plugin talks to MuninnDB's MCP endpoint. If you prefer REST for some operations, that is a sensible follow-up, but MCP keeps the surface aligned with Muninn's richest toolset.
  • The Hermes IDE plugin registry at hermes-hq/plugins is a different plugin system. Useful reference for packaging style, not the runtime contract used here.

Why this shape

  • Minimal moving parts
  • Good enough defaults
  • No dependence on Muninn-specific Python SDKs that may shift underfoot
  • Easy to inspect, patch, and extend without ritual sacrifice

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_muninndb_plugin-0.2.1.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_muninndb_plugin-0.2.1-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file hermes_muninndb_plugin-0.2.1.tar.gz.

File metadata

  • Download URL: hermes_muninndb_plugin-0.2.1.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hermes_muninndb_plugin-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1390aeff8e3bac89d2ce1ee7b2f2dce21d1ba3d436b7a5f27a3d90f6b6f46f1d
MD5 706f375f38e3831bfdf5071096fe8fc8
BLAKE2b-256 a8bbf0701e0cc8d738f97bf342484e45a0b2bd937a602b0b129f550391dfc682

See more details on using hashes here.

Provenance

The following attestation bundles were made for hermes_muninndb_plugin-0.2.1.tar.gz:

Publisher: publish.yml on aditzel/hermes-muninndb-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hermes_muninndb_plugin-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hermes_muninndb_plugin-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cbb99547e67c6c8a189c49b3ba5bff54d8eab142d48626be9d009e5a36c64159
MD5 ab20eceda9d2f3346348ffbe452f1a8e
BLAKE2b-256 2d8ad876f45415807bf5ad653576b48743743be37fe8f72e43f990847a3f4dfd

See more details on using hashes here.

Provenance

The following attestation bundles were made for hermes_muninndb_plugin-0.2.1-py3-none-any.whl:

Publisher: publish.yml on aditzel/hermes-muninndb-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page