Persistent memory for Hermes Agent
Persistent conversational memory for Nous Research Hermes Agent, powered by MemoryRouter. Your agent can remember what you told it yesterday across sessions, without you manually curating every useful detail into a memory file. Hermes already has persistent MEMORY.md and USER.md files. This native memory provider adds automatic capture of conversational exchanges and relevant recall from your MemoryRouter vault.
Tested against hermes-agent==0.19.0, the current PyPI release on September 8, 2026, with Python 3.12. Hermes 0.19.0 requires Python 3.11 through 3.13. Python 3.14 can silently resolve an older Hermes release, so use a supported Python version.
30-second install
Requires a working Hermes Agent install. Use the same Python environment as Hermes. Create a MemoryRouter account and get your key, then export MEMORYROUTER_API_KEY in the shell where you run Hermes.
pip install hermes-memoryrouter
hermes-memoryrouter install
hermes config set memory.provider memoryrouter
The installer copies the packaged provider into ${HERMES_HOME:-~/.hermes}/plugins/memoryrouter/. Hermes 0.19.0 discovers memory providers from this directory, not from pip entry points. Re-run the install command after upgrading the package.
The package also declares hermes_agent.memory_providers with memoryrouter = "hermes_memoryrouter:register" for Hermes versions that support memory-provider entry points. On those versions, pip install plus the config command is sufficient. The directory install remains a fallback.
Manual equivalent if you do not want to use the helper:
export HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"
mkdir -p "$HERMES_HOME/plugins/memoryrouter"
cp -R "$(python -c 'import hermes_memoryrouter,pathlib; print(pathlib.Path(hermes_memoryrouter.__file__).parent)')/." "$HERMES_HOME/plugins/memoryrouter/"
hermes config set memory.provider memoryrouter
API key
The plugin never reads the macOS Keychain. Key lookup order:
MEMORYROUTER_API_KEYin the environmentMEMORYROUTER_API_KEY_FILEpointing to a mode-0600 file$HERMES_HOME/memoryrouter.key(mode 0600)MEMORYROUTER_API_KEY=inside$HERMES_HOME/.env
Without a key the provider is idle. To use a file instead of an environment variable:
export HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"
umask 077
printf '%s\n' 'YOUR_MEMORYROUTER_KEY' > "$HERMES_HOME/memoryrouter.key"
chmod 600 "$HERMES_HOME/memoryrouter.key"
hermes memory status
hermes memory setup is also available for interactive configuration. Keep your model provider and model key as configured in Hermes. This plugin supplies memory, not model inference.
How it works
- Capture: stores clean user messages and final assistant replies after completed turns.
- Recall: retrieves relevant past conversation context before each turn, bounded by a 2.5-second default timeout and a 24,000-character cap.
- Filter: excludes tool results, tool calls, thinking blocks, system text, and recalled-memory wrappers from capture.
- Fail open: memory errors do not crash a conversation. Recall can delay a turn up to its timeout; capture runs in the background.
This is a native Hermes MemoryProvider, not OpenClaw's mr-memory plugin. Completed conversational exchanges are sent to the MemoryRouter account behind your key. Only configure it for conversations you want stored there.
Configuration
Non-secret settings live in $HERMES_HOME/memoryrouter.json. The setup wizard only asks for the key.
| Option | Default | Description |
|---|---|---|
base_url |
https://api.memoryrouter.ai |
API endpoint. Also MEMORYROUTER_BASE_URL. |
density |
default |
Retrieval density: low / default / high / xhigh. |
vault |
core |
core shares memories across sessions. session isolates each conversation via X-Session-ID. |
auto_recall |
true |
Inject relevant memories before each turn. |
auto_capture |
true |
Store completed exchanges. |
include_subagents |
false |
Also store subagent turns. |
recall_limit |
0 |
Explicit chunk-count override (0 = server default). |
recall_max_chars |
24000 |
Hard bound on the injected recall block. |
store_max_chars |
8000 |
Per-side bound on stored text. |
store_timeout |
10 |
Seconds per store attempt. |
recall_timeout |
2.5 |
Max seconds recall may delay a turn. |
debug |
false |
Verbose logging. |
How capture works
Hermes calls sync_turn(user, assistant, messages=...) after each completed turn. The plugin:
- Takes the user and assistant strings Hermes already split out.
- Strips
<system-reminder>,<memory_context>, thinking tags, and tool-call XML. - Drops slash commands (
/new,/status, …) and trivial prompts (ok,thanks,hi). - If either side is empty, falls back to the last clean user/assistant pair in
messages, ignoring tool and system roles. - Truncates each side and POSTs
{messages:[{role:user},{role:assistant}]}to/v1/memory/ingeston a daemon thread.
Recall uses /v1/memory/prepare with the current user text as the query. Results are wrapped in <memoryrouter-context> so they cannot be re-ingested.
By default (vault: core) exchanges go to the key's core vault, so session B can recall what session A stored. That is the point of persistent memory.
CLI
When memory.provider is memoryrouter:
hermes memoryrouter status
hermes memoryrouter config
Development
python -m pytest -q
Unit tests are offline (local HTTP mock). The release gate also runs actual Hermes conversations in two separate Python processes with GPT-4.1 mini and no enabled toolsets. A unique token taught in session A must appear exactly in session B, whose prompt does not contain the token. The gate is repeated from a fresh PyPI install after publishing. scripts/live_cross_session.py is a separate lower-level provider smoke test.
License
MIT © John Rood · memoryrouter.ai
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_memoryrouter-0.1.1.tar.gz.
File metadata
- Download URL: hermes_memoryrouter-0.1.1.tar.gz
- Upload date:
- Size: 23.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a11f4cff110ba3c02b7dd294757fc02bf61d3feb1ad71c467da507a328dca4a
|
|
| MD5 |
cc75d2ca266799fae23bcfa6844dfc2e
|
|
| BLAKE2b-256 |
8789baa4874ef0121aab599bbd33d162a91a45275c48801f9e3bf6a781a4785a
|
File details
Details for the file hermes_memoryrouter-0.1.1-py3-none-any.whl.
File metadata
- Download URL: hermes_memoryrouter-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fee25ae4bf3f1a8a815c4fd4d75205e5bf21b900d789c680ff29ffeb795facb
|
|
| MD5 |
3b4c41854182f759f1d83e8f46da9237
|
|
| BLAKE2b-256 |
7aed516e922a08633d7234affcf3c73d5d8ee19b9f600fbc64e5be11df249f70
|