Mnemory persistent memory plugin for Hermes Agent
Project description
Hermes Agent Plugin -- Mnemory
A Hermes Agent plugin that provides long-term semantic memory backed by a mnemory server.
Features
- Auto-Recall: Automatically fetches relevant memories and injects them into the system prompt before each agent turn
- Auto-Capture: Extracts and stores memories from conversations after each exchange (fire-and-forget)
- 16 Explicit Tools:
memory_search,memory_find,memory_ask,memory_add,memory_add_batch,memory_update,memory_delete,memory_delete_batch,memory_list,memory_categories,memory_recent,memory_save_artifact,memory_get_artifact,memory_get_artifact_url,memory_list_artifacts,memory_delete_artifact - Compaction-safe: Detects context compression and re-injects memories automatically
- Graceful degradation: If mnemory is offline, the agent continues working normally
Prerequisites
A running mnemory server accessible via HTTP.
Install
pip (recommended)
pip install hermes-mnemory
The plugin is auto-discovered via the hermes_agent.plugins entry point.
Directory install
Copy this directory to your Hermes plugins folder:
cp -r integrations/hermes ~/.hermes/plugins/mnemory
Configure
Add to your ~/.hermes/.env:
MNEMORY_URL=http://localhost:8050
MNEMORY_API_KEY=your-api-key # optional if auth is disabled
Environment Variables
| Variable | Default | Description |
|---|---|---|
MNEMORY_URL |
(required) | Mnemory server URL |
MNEMORY_API_KEY |
"" |
Bearer token for authentication |
MNEMORY_USER_ID |
"" |
User ID (required when API key is wildcard or auth disabled) |
MNEMORY_AGENT_PREFIX |
hermes |
Value sent as X-Agent-Id header |
MNEMORY_AUTO_RECALL |
true |
Auto-inject memories into context |
MNEMORY_AUTO_CAPTURE |
true |
Auto-extract memories from conversations |
MNEMORY_RECALL_FIND_FIRST |
true |
Use AI-powered search on first turn (higher quality, slower) |
MNEMORY_RECALL_SEARCH_MODE |
search |
Search mode for subsequent turns: find or search |
MNEMORY_SCORE_THRESHOLD |
0.5 |
Min relevance score for recalled memories (0.0-1.0) |
MNEMORY_INCLUDE_ASSISTANT |
true |
Send assistant messages for extraction |
MNEMORY_MANAGED |
true |
Include behavioural instructions in system prompt |
MNEMORY_TIMEOUT |
60 |
HTTP request timeout in seconds |
How It Works
on_session_start: Pre-fetches instructions and core memories from/api/recallin a background thread (non-blocking)pre_llm_call: Two-phase recall per turn:- Awaits the init recall (instructions + core memories) if still pending
- Sends the current user message as a search query to
/api/recallfor topical memories - First turn uses AI-powered
findmode (configurable viaMNEMORY_RECALL_FIND_FIRST), subsequent turns use fastsearchmode (configurable viaMNEMORY_RECALL_SEARCH_MODE) - Search results are replaced each turn (not accumulated) -- the server deduplicates via session tracking
- Returns context via
{"context": "..."}for injection into the system prompt
post_llm_call: Extracts the last user+assistant exchange and sends to/api/rememberfor background extractionon_session_end: Cleans up session state
Compaction handling
The plugin detects context compression by tracking conversation history length. When the history shrinks between turns (indicating Hermes compressed the context), the plugin resets its mnemory session and re-fetches core memories, ensuring memories survive compaction.
Built-in Memory Coexistence
This plugin does not disable Hermes's built-in memory system (MEMORY.md / USER.md). They can coexist -- mnemory provides richer semantic search and cross-session memory, while the built-in system provides a simple scratchpad.
To disable the built-in memory when using mnemory, set in ~/.hermes/config.yaml:
memory:
memory_enabled: false
user_profile_enabled: false
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hermes_mnemory-0.1.0.tar.gz.
File metadata
- Download URL: hermes_mnemory-0.1.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1df8ce952785a76aabe4abf98039e90a9f7905b2fc28d1834562d780dd40f0a7
|
|
| MD5 |
167fa987c11abb4d6044715d703ac339
|
|
| BLAKE2b-256 |
04269a7052f02bf76cd3f87bd31cb651482bcfdebacbf39d8797db8e55f88659
|
Provenance
The following attestation bundles were made for hermes_mnemory-0.1.0.tar.gz:
Publisher:
python-publish.yml on fpytloun/mnemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hermes_mnemory-0.1.0.tar.gz -
Subject digest:
1df8ce952785a76aabe4abf98039e90a9f7905b2fc28d1834562d780dd40f0a7 - Sigstore transparency entry: 1216970876
- Sigstore integration time:
-
Permalink:
fpytloun/mnemory@d96f3dd783e17b93130bd4f2be9393138c5220fe -
Branch / Tag:
refs/tags/hermes-v0.1.0 - Owner: https://github.com/fpytloun
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d96f3dd783e17b93130bd4f2be9393138c5220fe -
Trigger Event:
release
-
Statement type:
File details
Details for the file hermes_mnemory-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hermes_mnemory-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56d17b0b5842c7e3f1202239404ad76247c4913fc5546ccb917c43642a2c6acd
|
|
| MD5 |
cbc272f3f61ea7cda53d256a8062fbfe
|
|
| BLAKE2b-256 |
dc1b448060e3950e06ab377c54892d923b7151f3146004bf573bfb812e668107
|
Provenance
The following attestation bundles were made for hermes_mnemory-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on fpytloun/mnemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hermes_mnemory-0.1.0-py3-none-any.whl -
Subject digest:
56d17b0b5842c7e3f1202239404ad76247c4913fc5546ccb917c43642a2c6acd - Sigstore transparency entry: 1216970922
- Sigstore integration time:
-
Permalink:
fpytloun/mnemory@d96f3dd783e17b93130bd4f2be9393138c5220fe -
Branch / Tag:
refs/tags/hermes-v0.1.0 - Owner: https://github.com/fpytloun
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d96f3dd783e17b93130bd4f2be9393138c5220fe -
Trigger Event:
release
-
Statement type: