- Platform mode (default): managed Mem0 Cloud. Add your API key and you are ready.
- Self-hosted server mode: point the plugin at a Mem0 server you run yourself (the Docker-shipped server). The plugin only talks HTTP to your server.
- OSS mode: run Mem0 in-process with your own LLM, embedder, and vector store. No Mem0 server required.
How It Works
Hermes runs a built-in memory system (file-basedMEMORY.md and USER.md) alongside one external provider. When Mem0 is active, it works additively with the built-in system at two points in every conversation turn.
1. Current-turn recall (bounded wait)
When you send a message, Hermes searches your stored memories for the current question and waits up to 3 seconds for results. If they arrive in time, they are injected into the system prompt so the model can see them. If the backend is slower, Hermes skips the injection and the model can still callmem0_search itself after the bounded recall wait.
2. Background fact extraction (sync)
Once the model finishes, the plugin sends the user message and assistant response to Mem0 in a background thread for fact extraction. Each write includes the agent identifier and gateway channel.Automatic capture truncates each message to 450 characters by default in every mode, preferring a sentence boundary. Adjust
sync_max_chars for your model’s context limit. Capture is best effort: if the previous sync is still running after a five-second wait, the next turn is skipped. Use mem0_add to store specific text verbatim.Agent Tools
When Mem0 is active, the model gets four tools it can call during a conversation:Installation
Install Hermes Agent with memory-provider plugin support and Python 3.11 or later. Once the plugin directory is available on Mem0’s main branch, install it from the repository subdirectory:mem0ai>=2.0.10,<3 and httpx>=0.27,<1 from the plugin’s pyproject.toml. Older hosts such as Hermes v0.21.3 require those packages to be installed explicitly into the Hermes Python environment. The OSS setup flow installs additional provider packages as needed.
Hermes versions that still bundle Mem0 prefer the bundled provider. The standalone copy takes over after the bundled copy is removed. Existing users should keep their current configuration; see Migration for existing users.
Platform Setup
Platform mode uses managed Mem0 Cloud and is the fastest way to start.Option 1: Interactive wizard (recommended)
$HERMES_HOME/mem0.json and keeps the key in that profile’s .env. The default Hermes home is ~/.hermes; named profiles use their own home directory.
Get your API key from app.mem0.ai.
Option 2: Manual Configuration
.env:
memory.provider: mem0 in the profile’s config.yaml. Restart Hermes and check hermes memory status.
Self-Hosted Server Setup
Run the Mem0 server (FastAPI + pgvector) from its Docker image and point the plugin at it. Unlike OSS mode, the plugin just talks HTTP to your server.Interactive
With flags
With environment variables
Set these values in the active profile’s.env and select mem0 with hermes config set memory.provider mem0:
mem0.json override environment defaults. If switching from another mode, use the wizard to update that file too.
Then start a fresh Hermes session and call mem0_search — it connects to your server. The plugin authenticates with X-API-Key and uses the server’s /search and /memories routes. The API key is optional only for servers running with AUTH_DISABLED.
Setting
host routes to the self-hosted server automatically. Don’t combine it with mode: oss — OSS takes precedence and ignores host.OSS (Self-Hosted) Setup
OSS mode runs the Mem0 SDK in the Hermes process with your chosen LLM, embedder, and vector store. It does not use Mem0 Cloud or require a Mem0 API key. Data goes to the model services you configure; use local Ollama models and local storage for a fully local setup.Interactive
With flags
Supported providers
Flag reference
Switching Modes
You can move between the three modes at any time. Run the setup command again, or edit$HERMES_HOME/mem0.json directly. Switching backends does not transfer memories between them. When returning to Platform, also remove any stale MEM0_HOST setting from your environment and profile .env.
$HERMES_HOME/mem0.json can look like this (use your existing storage path when migrating):
Configuration
Settings live in$HERMES_HOME/mem0.json and are written by hermes memory setup. API keys normally live in that profile’s .env; distinct OpenAI LLM/embedder keys and database credentials are stored in the OSS configuration. Setup writes these files atomically with owner-only permissions.
MEM0_MODE, MEM0_HOST, MEM0_USER_ID, and MEM0_AGENT_ID supply environment defaults. Non-empty values in mem0.json take precedence. MEM0_API_KEY supplies the Cloud or server key unless api_key is set in the file.
Cross-channel memories
Hermes can run from the CLI and from gateways like Telegram, Slack, and Discord. Theuser_id setting controls how memories are scoped across them:
- Set a
user_idother thanhermes-userand it applies to every gateway, so one person gets a single merged memory store no matter where they talk to the agent. - Leave it unset (or at the default
hermes-user) and each gateway uses its own native ID when available, falling back tohermes-user.
metadata.channel (for example telegram or cli). Plugin searches filter by user identity across sessions; they do not restrict recall to the current channel or session.
Migration for Existing Users
Keepmemory.provider: mem0, mem0.json, MEM0_* settings, user identity, and OSS database paths unchanged. Moving from the bundled provider to this standalone plugin does not require rerunning setup or moving stored memories.
Automatic migration depends on Hermes rollout as well as this repository:
- Users need a Hermes build containing PR #114569.
- Hermes maintainers must approve a catalog entry named
mem0withrepo: https://github.com/mem0ai/mem0,subdir: integrations/hermes-plugin-mem0, and a reviewed full commit SHA. - The bundled Mem0 provider must be removed so the standalone provider can load.
hermes update across profiles or at agent startup. Startup installation respects security.allow_lazy_installs. Offline or disabled installation needs manual action; merging the plugin directory alone does not complete automatic migration.
CLI setup and status are supported. This plugin does not ship a Desktop configuration panel or provider-specific CLI commands.
Reliability
- Circuit breaker: five consecutive backend failures pause calls for two minutes. The agent can continue without memory during that window. Expected update/delete errors such as a missing memory do not trip the breaker.
- Bounded waits: recall waits up to three seconds. Capture runs in the background, but an overlapping turn may wait up to five seconds for the previous sync before being skipped.
- Best-effort capture: there is no durable queue. Shutdown waits briefly for workers; pending writes are not guaranteed to finish before exit.
- OSS data protection: an embedding dimension mismatch fails initialization without deleting the existing collection or table.
Troubleshooting
”Mem0 temporarily unavailable”
The circuit breaker tripped after five consecutive failures and resets after two minutes.- Platform mode: check your API key and internet connection.
- Self-hosted server mode: check that the server is running and reachable at the configured
hostURL. - OSS mode: make sure your vector store (Qdrant or PGVector) is running and reachable.
OSS: vector store connection refused
OSS: Ollama not reachable
Memories not appearing
mem0_addstores text verbatim with no extraction. Ordinary conversation turns are extracted automatically by the background sync.- Search is semantic, so try a broader query.
- Confirm
user_idis the same across sessions (check$HERMES_HOME/mem0.json). - Check
sync_max_chars: facts beyond the per-message limit are not sent for extraction.
OSS: embedding dimension mismatch
Restore the embedding model and dimensions that created the existing collection, or choose a new collection and migrate data explicitly. The plugin leaves the original collection intact when dimensions differ.OpenClaw Integration
Add memory to OpenClaw agents with auto-recall and auto-capture
Mem0 Platform
Get your API key and explore the Mem0 dashboard
Using Mem0? Star us on GitHub to help more developers discover memory for AI apps.