Hermes Plugin

First-class integration with the Hermes agent framework.

Installation

Activate the Hermes venv, install the package, then register:

source ~/.hermes/hermes-agent/venv/bin/activate

# If your venv was created with python -m venv or virtualenv
pip install mnemosyne-memory

# If your venv was created with uv venv (pip is not included)
uv pip install mnemosyne-memory

python -m mnemosyne.install
uv venv does not include pip

If you created the Hermes venv with uv venv, running pip install will fail with "command not found." This is by design — uv replaces pip with uv pip. Always use uv pip install in uv-created environments.

Or add to hermes.yaml:

plugins:
- name: mnemosyne-memory
  source: pip
  config:
    db_path: ./memory.db
    embedding_model: text-embedding-3-small
    auto_context: true
    context_injection:
      enabled: true
      max_memories: 5
      min_relevance: 0.7

Auto-Context Injection

When enabled, Mnemosyne automatically injects relevant memories into agent context:


flowchart LR
  U[User Input] -->|query| M[Mnemosyne]
  M -->|recall| C[Context Assembly]
  C -->|inject| A[Agent Prompt]
  A -->|respond| R[Response]
  R -->|remember| M

Plugin Hooks

Mnemosyne registers the following Hermes hooks:

HookTimingAction
pre_llm_callBefore LLM callInject relevant memories
on_session_startSession startStore conversation
post_tool_callAfter tool executionStore tool results

Tool Schema

Mnemosyne exposes these tools to agents:

{
"name": "mnemosyne_remember",
"description": "Store information in long-term memory. Use for facts, preferences, decisions, and observations.",
"parameters": {
  "type": "object",
  "required": ["content"],
  "properties": {
    "content": { "type": "string", "description": "Information to store" },
    "source": { "type": "string", "description": "Origin of the memory (e.g., 'conversation', 'tool')" },
    "importance": { "type": "number", "minimum": 0, "maximum": 1, "description": "0.0 = transient, 1.0 = critical" },
    "valid_until": { "type": "string", "description": "ISO 8601 timestamp for automatic expiry" },
    "scope": { "type": "string", "enum": ["session", "global"], "description": "Visibility scope" },
    "extract_entities": { "type": "boolean", "description": "Auto-extract named entities into triples" },
    "extract": { "type": "boolean", "description": "Auto-extract factual statements into triples" },
  }
}
}

{
"name": "mnemosyne_recall",
"description": "Retrieve relevant memories from long-term storage.",
"parameters": {
  "type": "object",
  "required": ["query"],
  "properties": {
    "query": { "type": "string", "description": "Natural language search query" },
    "top_k": { "type": "integer", "default": 5, "description": "Max memories to return" },
    "author_id": { "type": "string", "description": "Filter by author" },
    "author_type": { "type": "string", "enum": ["human", "agent", "system"] },
    "channel_id": { "type": "string", "description": "Filter by channel" },
    "temporal_weight": { "type": "number", "description": "Weight for recency in scoring" },
    "query_time": { "type": "string", "description": "Point-in-time query (ISO 8601)" },
    "temporal_halflife": { "type": "number", "description": "Recency decay half-life in hours" },
    "vec_weight": { "type": "number", "description": "Vector similarity weight" },
    "fts_weight": { "type": "number", "description": "Full-text search weight" },
    "importance_weight": { "type": "number", "description": "Importance score weight" }
  }
}
}

{
"name": "mnemosyne_stats",
"description": "Get memory system statistics: entry counts, database size, consolidation status.",
"parameters": {
  "type": "object",
  "properties": {}
}
}

{
"name": "mnemosyne_triple_add",
"description": "Store a structured fact as a knowledge graph triple.",
"parameters": {
  "type": "object",
  "required": ["subject", "predicate", "object"],
  "properties": {
    "subject": { "type": "string", "description": "The entity the fact is about" },
    "predicate": { "type": "string", "description": "The relationship or property" },
    "object": { "type": "string", "description": "The value or target entity" },
    "valid_from": { "type": "string", "description": "ISO 8601 timestamp when this fact became true" },
    "source": { "type": "string", "description": "Origin of the triple (e.g., 'extraction', 'manual', 'inference')" },
    "confidence": { "type": "number", "minimum": 0, "maximum": 1, "description": "Confidence score for this fact" }
  }
}
}

{
"name": "mnemosyne_triple_query",
"description": "Query the knowledge graph for structured facts.",
"parameters": {
  "type": "object",
  "properties": {
    "subject": { "type": "string", "description": "Filter by subject entity" },
    "predicate": { "type": "string", "description": "Filter by relationship type" },
    "object": { "type": "string", "description": "Filter by value or target" }
  }
}
}

{
"name": "mnemosyne_sleep",
"description": "Run consolidation cycle: promote Working Memory entries to Episodic, run tiered degradation.",
"parameters": {
  "type": "object",
  "properties": {
    "dry_run": { "type": "boolean", "description": "If true, preview what would happen without making changes" }
  }
}
}

{
"name": "mnemosyne_scratchpad_write",
"description": "Write to the temporary scratchpad workspace for chain-of-thought and planning.",
"parameters": {
  "type": "object",
  "required": ["content"],
  "properties": {
    "content": { "type": "string", "description": "Content to write to the scratchpad" }
  }
}
}

{
"name": "mnemosyne_scratchpad_read",
"description": "Read all entries from the temporary scratchpad workspace.",
"parameters": {
  "type": "object",
  "properties": {}
}
}

{
"name": "mnemosyne_scratchpad_clear",
"description": "Clear all entries from the scratchpad workspace.",
"parameters": {
  "type": "object",
  "properties": {}
}
}

{
"name": "mnemosyne_invalidate",
"description": "Mark a memory as invalid (soft delete). Use when information is outdated or incorrect.",
"parameters": {
  "type": "object",
  "required": ["memory_id"],
  "properties": {
    "memory_id": { "type": "string", "description": "Memory ID to invalidate" },
    "replacement_id": { "type": "string", "description": "Optional replacement memory ID" }
  }
}
}

{
"name": "mnemosyne_export",
"description": "Export memories to a file for backup or migration.",
"parameters": {
  "type": "object",
  "required": ["output_path"],
  "properties": {
    "output_path": { "type": "string", "description": "File path for export (JSON format)" }
  }
}
}

{
"name": "mnemosyne_import",
"description": "Import memories from a previously exported file.",
"parameters": {
  "type": "object",
  "required": ["input_path"],
  "properties": {
    "input_path": { "type": "string", "description": "File path to import from (JSON format)" }
  }
}
}

{
"name": "mnemosyne_update",
"description": "Update an existing memory's content, importance, or metadata.",
"parameters": {
  "type": "object",
  "required": ["memory_id"],
  "properties": {
    "memory_id": { "type": "string", "description": "Memory ID to update" },
    "content": { "type": "string", "description": "New content" },
    "importance": { "type": "number", "minimum": 0, "maximum": 1, "description": "Updated importance score" }
  }
}
}

{
"name": "mnemosyne_forget",
"description": "Permanently delete a memory by ID.",
"parameters": {
  "type": "object",
  "required": ["memory_id"],
  "properties": {
    "memory_id": { "type": "string", "description": "Memory ID to permanently delete" }
  }
}
}

{
"name": "mnemosyne_diagnose",
"description": "Run diagnostic checks on the memory system: database integrity, index health, storage stats.",
"parameters": {
  "type": "object",
  "properties": {}
}
}

Troubleshooting

Plugin not loading

hermes plugins list
# Verify mnemosyne appears

hermes mnemosyne stats
# Check memory statistics

Context not injected

Verify auto_context is enabled and memories exist:

hermes plugins list
hermes mnemosyne stats
Hermes Version

Requires Hermes v2.0 or higher. The plugin API changed significantly in v2 — older Hermes versions are not supported.