Persistent cross-session memory for Hermes Agent, powered by mem9.
Conversations are automatically extracted into facts, recalled semantically each turn, and available across sessions and agents.
- Hermes Agent installed and working (
hermes versionshould print version info) - An internet connection (the plugin talks to the mem9 REST API)
Review the script first if you prefer, then run:
curl -fsSL https://raw.githubusercontent.com/mem9-ai/mem9-hermes-plugin/main/install.sh | bashThis single command:
- Installs the plugin via
hermes plugins install - Creates a symlink at
plugins/memory/mem9inside the Hermes repo - Obtains an API key — reuses an existing
MEM9_API_KEY(with a connectivity check), or creates a new one if none exists - Saves credentials to
HERMES_HOME/.envand config tomem9.json - Activates
memory.provider=mem9(skipped if the connectivity check failed)
If activation succeeds, start a new Hermes session — mem9 is active. If the script reports a connectivity failure, run hermes memory setup to reconfigure.
# 1. Install the plugin files
hermes plugins install mem9-ai/mem9-hermes-plugin
# 2. Link into the Hermes memory provider directory
bash "${HERMES_HOME:-$HOME/.hermes}/plugins/mem9/scripts/link-memory-provider.sh"
# 3. Run the interactive setup (API key + activation)
hermes memory setup # select "mem9" in the pickerDuring hermes memory setup you can auto-provision a free API key or enter an existing one. The setup flow tests the connection before saving.
hermes plugins update mem9This runs git pull inside the installed plugin directory. Start a new Hermes session to pick up the changes. Your .env and mem9.json are not touched.
If the symlink is missing after an upgrade (e.g. Hermes was reinstalled), re-run:
bash "${HERMES_HOME:-$HOME/.hermes}/plugins/mem9/scripts/link-memory-provider.sh"hermes memory statusYou should see mem9 listed as the active memory provider.
All files live under ${HERMES_HOME:-$HOME/.hermes}/.
.env — credentials and optional overrides (env vars take precedence over mem9.json):
| Variable | Description |
|---|---|
MEM9_API_KEY |
API key (required; also doubles as tenant ID) |
MEM9_API_URL |
Server URL override (default: https://api.mem9.ai) |
MEM9_AGENT_ID |
Agent identifier override (default: hermes) |
mem9.json — provider config:
| Key | Description |
|---|---|
api_url |
Server URL (default: https://api.mem9.ai) |
agent_id |
Agent identifier (default: hermes) |
default_timeout_seconds |
General request timeout (default: 8) |
search_timeout_seconds |
Search/recall timeout (default: 15) |
# Remove the symlink and plugin files
rm -f "$(hermes version 2>/dev/null | awk '/Project:/{print $2}')/plugins/memory/mem9"
hermes plugins remove mem9
# Switch to another provider or disable memory
hermes config set memory.provider ""| Symptom | Fix |
|---|---|
hermes memory status doesn't show mem9 |
Run link-memory-provider.sh — the symlink may be missing |
| "mem9 is not configured" during chat | Check that MEM9_API_KEY is set in HERMES_HOME/.env |
| Memories not appearing | Check hermes memory status and agent.log for errors; recall runs every turn including the first |
| Connection errors | Verify MEM9_API_URL and check HERMES_HOME/logs/agent.log with logging.level: DEBUG in config.yaml |