AgentsOpen SourceFreeActiveMachine-verified· intermediate · ~10 min setup

Hermes + Mnemosyne: give the cheap agent a local memory

Wire Mnemosyne into Hermes as an MCP server so a budget model stops re-stuffing the same context every session, validated config + a real remember→recall round-trip.

by Shilpa Mitra· verified today· v1.0.0

Run this workflow

CI-verified, 3/3 fixtures passing.

Build this with your agent

One copy-paste hands Claude Code, Codex, or Cursor the full recipe, steps included, nothing to fetch.

Intended Use

Hermes users who want persistent local memory for a budget agent. CI validates the mcp_servers.mnemosyne block (command 'mnemosyne', args ['mcp']) parses, then installs Mnemosyne and runs a real remember-then-recall round-trip in offline keyword mode, no key. Semantic recall calls an embedding model (the [all] extra), so it is fenced.

Not for

  • Semantic recall without the embedding extra, keyword mode is the offline fallback CI checks
  • Multi-user server deployments, Mnemosyne is a local-first store

The Stack

Tested Against

hermes-agent cli-config.yaml.example (2026-06)mnemosyne-memory@latestpython@3.12

Side effects & data flow

Network
PyPI, install only
Writes
./.venv/, ./config.yaml, the SQLite memory file
Credentials
none required

Prerequisites

  • Hermes Agent installed
  • Python 3.10+
  • pip

Steps

  1. 1

    Register Mnemosyne as a Hermes MCP server, then prove the round-trip

    Add an mcp_servers.mnemosyne block to config.yaml (command: mnemosyne, args: [mcp]) so Hermes launches it. Then install Mnemosyne and run a real remember → recall round-trip; without the embedding extra it falls back to FTS5 keyword retrieval, which is fully offline. CI runs exactly this, no key. (Confirm the launch command against the repo's Hermes integration doc, since entrypoints can change between versions.)

    python3 -m venv .venv
    .venv/bin/pip install -q mnemosyne-memory pyyaml
    cat > config.yaml <<'YAML'
    mcp_servers:
      mnemosyne:
        command: mnemosyne
        args: ["mcp"]
    YAML
    .venv/bin/python - <<'EOF'
    import yaml
    cfg = yaml.safe_load(open("config.yaml"))
    srv = cfg["mcp_servers"]["mnemosyne"]
    assert srv["command"] == "mnemosyne", f"bad command {srv.get('command')}"
    assert srv["args"] == ["mcp"], f"bad args {srv.get('args')}"
    print("config OK: mcp_servers.mnemosyne -> command 'mnemosyne' args ['mcp']")
    
    from mnemosyne import remember, recall
    remember("User prefers dark mode interfaces", importance=0.9, source="preference")
    results = recall("interface preferences", top_k=3)
    text = " ".join(str(r) for r in results)
    assert "dark mode" in text, f"recall missed the stored fact: {text!r}"
    print("mnemosyne round-trip OK: recalled the stored fact in keyword mode")
    EOF
  2. 2

    Turn on semantic recall (the model step, not checked by CI)

    Install the embedding extra (pip install "mnemosyne-memory[all]") for semantic search and sleep-cycle consolidation. Those run embeddings, which are non-deterministic, so CI never claims them.

Eval, 3 fixtures

Last passed: verified today
  • config-okcontainstimeout 600s · max $0

    Expected: config OK: mcp_servers.mnemosyne -> command 'mnemosyne' args ['mcp']

  • round-tripcontainstimeout 600s · max $0

    Expected: mnemosyne round-trip OK: recalled the stored fact in keyword mode

  • clean-exitexit_codetimeout 600s · max $0

    Expected: 0

Results

On a cheap model the win is double: the agent stays coherent across days, and you stop paying to re-feed the same background into context each session. Mnemosyne is local-first (one SQLite file, no external service).

Did this work for you?

Our CI checks the setup runs. You tell us if the whole thing worked. Tell us straight.

Liked this workflow?

Get new verified workflows in WebAfterAI, three issues a week (Tue, Thu, Sat).