memtomem for Hermes Agent
Markdown-first long-term memory shared across your coding agents. This package starts a
local memtomem MCP server and adds six memory workflow skills: search, recall, status,
remember, index, and setup. Notes saved here are searchable from Claude Code, Codex CLI,
Kimi Code and any other client that uses the same ~/.memtomem store. The project
workflows of the other plugins (handoff, brief, update) need a project root, which
Hermes does not start the server in; see
Project workflows for where they ship.
mcp.json, plugin.json and skills/ are generated by tools/render_plugin_assets.py
from packages/memtomem-plugin-assets/; edit the sources there, not the files here.
Requirements
- Hermes Agent 0.21.5 or later (the version this package was verified against), installed
with MCP support: themcpPython package in Hermes's environment, which the
hermes-agent[mcp]extra provides and the official install scripts normally include.
Without it Hermes loads the six skills but starts no MCP server, so the memory tools are
missing, and it logs why only at debug level ("mcp package not installed"). Add themcp
extra to Hermes's environment to fix it. - Git on
PATH, for the commit lookup under Install. uvonPATH. The server is started with
uvx --python 3.12 --from 'memtomem[onnx]==0.7.12' --with 'huggingface-hub>=1.20' memtomem-server.
Withoutuvthe plugin still installs and enables, and the server fails at start with
missing executable 'uvx'.- Python 3.12. uv uses a 3.12 it can find; if there is none, it downloads one (about 70 MiB)
on first start. If that is not possible — offline, or uv's Python downloads turned off —
the server does not start and$HERMES_HOME/logs/mcp-stderr.log(default
~/.hermes/logs/) shows uv's error; runuv python install 3.12once to fix it.
Install
Install from this repository, pinned to the commit of a memtomem release tag. Hermes
(0.21.5) takes a full 40-character commit SHA for --ref and refuses a tag name such as
v<version>, so look the commit up first:
git ls-remote --exit-code https://github.com/memtomem/memtomem "refs/tags/v<version>" "refs/tags/v<version>^{}"
<version> is a memtomem release that includes this directory and is listed on
PyPI. The command prints one line for a
lightweight tag and two for an annotated one; no output and exit status 2 mean there is no
such tag. Copy the SHA at the start of the line that ends in ^{} if there is one,
otherwise of the only line, and install at it:
hermes plugins install "https://github.com/memtomem/memtomem#packages/memtomem-hermes-plugin" --ref <commit-sha> --enable
At a release commit, mcp.json pins that same memtomem version, so the server installs
the release you picked. Hermes marks a direct Git install as a custom (unreviewed) source.
This package's own version, in plugin.json, can change between memtomem releases, so a
commit on main that no release tag points at can carry a newer package than the latest
tag does. Such a commit installs the same way, with its 40-character SHA. Check first that
the memtomem release its mcp.json pins is listed on PyPI: the server does not start
until it is.
Hermes records that commit as the plugin's pin. To move to a later release, look up its
commit the same way and reinstall with --force --ref <new-commit-sha>. A --force
reinstall without --ref installs the pinned commit again, and hermes plugins update memtomem refuses to move a pinned plugin.
An install without --ref takes the tip of main, unless Hermes still holds a pin for this
source from an earlier install; then it installs that pinned commit, even if the plugin
directory was deleted. Use main only for development: right after a version bump is
merged, main can pin a memtomem version that is not published yet, and the server then
fails to start until it is.
memtomem is also listed in the Hermes plugin catalog, so hermes plugins install memtomem
installs without a commit lookup. It installs the commit the catalog pins, which moves only
when the catalog entry is updated and can trail the newest memtomem release; to install a
later release, use the commit lookup above.
First run
Start a new Hermes session. No separate setup is needed: on a machine where memtomem
has never been configured, the server uses its defaults (SQLite store in
~/.memtomem/memtomem.db, notes in ~/.memtomem/memories, BM25 search). If memtomem is
already set up for your other agents through ~/.memtomem/config.json, the server reads
that configuration and shares the same store — provided the storage and memory paths in it
are absolute or start with ~. A relative path resolves against this server's working
directory (the plugin directory), so it would open a different store. Ask Hermes for memtomem status and check
the reported DB path before relying on sharing.
Settings from your shell environment do not carry over. Hermes passes only a small
allowlist of environment variables to MCP servers (plus any variables supplied by an
external secret source you configured in Hermes), so a MEMTOMEM_* variable exported in
your shell (for example MEMTOMEM_STORAGE__SQLITE_PATH) does not reach this server, and
it opens the store from config.json or the defaults instead. If you configure memtomem
that way, add your own mcp_servers.memtomem entry with those variables under env: (see
"Scope" below; it takes precedence over this package).
A .env file does not configure this server either. This package's server entry sets
PYTHON_DOTENV_DISABLED=1, which turns off the .env loading memtomem otherwise does at
startup (it searches upward from its installed location inside uv's cache, so the file it
finds is normally ~/.env). Hermes's plugin catalog rules say a plugin never reads .env
files directly. An entry of your own without that variable restores the search, so the
example below sets it. Before this package's 0.1.15, the nearest .env was read and its
MEMTOMEM_* keys were applied.
A saved Hugging Face login is not used. memtomem downloads a model or a tokenizer from
Hugging Face when its configuration uses one hosted there, as ONNX embedding and the local
reranker do. This package's server entry
sets HF_HUB_DISABLE_IMPLICIT_TOKEN=1 and holds huggingface-hub at 1.20 or later
(--with in its launch line), so those downloads do not open the login that
hf auth login saved (normally ~/.cache/huggingface/token) and use neither it nor an
HF_TOKEN variable. Hermes's plugin catalog rules say a plugin never reads another
tool's login. The floor is part of it: huggingface-hub 1.19 and older read the saved
login even with the variable set. For a gated or private model, add your own
mcp_servers.memtomem entry (see "Scope" below) without that variable and with HF_TOKEN
under env:. Before this package's 0.1.23, a saved login was sent with model downloads.
Korean keyword search
This package starts memtomem with the onnx extra only, not the korean one, so its
server has no Kiwi morphological tokenizer. If your store is set to
search.tokenizer: kiwipiepy (the mm init Korean-optimized preset sets it), this server
falls back to unicode61 and keeps indexing. One keyword index then holds two token
forms, and a Korean query with a particle or an ending, such as 예산을 or 결정했다,
misses the notes that were indexed the other way. A bare stem such as 예산 still finds
both, so a quick test can look fine. Ask Hermes for memtomem status: a
tokenizer_fallback warning means this server is affected.
The steps below are for a store that is already set to kiwipiepy: memtomem status shows
search.tokenizer: kiwipiepy. They do not switch a unicode61 store, and the rebuild
in step 2 is not saved to config.json, so on a unicode61 store the servers go back to
unicode61 at their next start and mix the index again.
Keep this package enabled for its skills and add your own server entry with the same name
to config.yaml. Hermes uses your entry instead of this package's:
mcp_servers:
memtomem:
command: uvx
args: ["--python", "3.12", "--from", "memtomem[onnx,korean]==0.7.12", "--with", "huggingface-hub>=1.20", "memtomem-server"]
env:
MEMTOMEM_TOOL_MODE: core
MEMTOMEM_EXTRA_TOOLS: mem_update_coverage
ORT_DISABLE_TELEMETRY: "1"
PYTHON_DOTENV_DISABLED: "1"
HF_HUB_DISABLE_IMPLICIT_TOKEN: "1"
cwd: /absolute/path/outside/your/projects
Without cwd, the server starts in Hermes's working directory, so a project registered
there gets project scope (see "Scope" below). Point cwd at a directory outside your
projects to keep the user scope this package runs at. The env: rules after the example
in "Scope" below apply here too.
Then repair the index, in this order:
- Give the
koreanextra to every memtomem process that opens this store, including the
ones you only search from: a search tokenizes the query the same way, and every server
andmm webre-indexes the files it sees change. That means this entry, your other
agents' memtomem plugins, which leave thekoreanextra out as well, and anymm
install you use with this store. Then restart the servers, Hermes included. Ask for
memtomem status: thetokenizer_fallbackwarning should be gone. It does not report
notes that were indexed during the fallback, which is why the next step is needed. - Ask Hermes to rebuild the keyword index through the server, so that it is the store
and the tokenizer the server uses:
mem_do(action="config", params={"key": "search.tokenizer", "value": "kiwipiepy"}).
It rebuilds even when the value is alreadykiwipiepy, and its reply includes
FTS index rebuilt with <tokenizer> (N chunks).The tokenizer it names is the one
the rows were built with: a server without Kiwi reportsunicode61there, plus a
warning that the rebuild fell back. That fallback still rewrites every note as
unicode61, so do this only once step 1 shows no warning.
Scope
This package runs memtomem at user scope. The server starts in the plugin directory,
so it starts with no project context: there is no per-project (project_local) memory,
and a relative path given to indexing resolves against the plugin directory, so give
absolute paths. Notes are shared with your other agents
through the user-scope store. The six skills are written for that scope, and the handoff
workflow of the other memtomem plugins is not included, because it needs a project.
The server does accept one explicit binding, which the skills never use:
mem_do(action="project_bind", params={"project_root": "/absolute/path"}) binds it, once
per server process, to a project whose .memtomem tier is registered. Project-scoped
memory then resolves against that project, so a model that calls it on request reads and
writes that project's memory from this server.
Indexing a whole project directory also reads any project memory inside it
(<project>/.memtomem/memories*). What happens to those files depends on memtomem's
configuration, not on this package:
- Registered project memory (listed in memtomem's project memory directories) keeps
its project scope. It is indexed, but user-scope searches from this package do not
return it. - Unregistered project memory is indexed as ordinary user-scope notes and does show up
in searches here and in your other agents.
Search visibility is not the same as not indexing: to keep a directory out of the index
entirely, index a narrower path.
If you need project scope, use the manual integration instead: disable this package
(hermes plugins disable memtomem — its skills are written for user scope only) and add
your own server entry to config.yaml:
mcp_servers:
memtomem:
command: uvx
args: ["--python", "3.12", "--from", "memtomem[onnx]==0.7.12", "--with", "huggingface-hub>=1.20", "memtomem-server"]
env:
MEMTOMEM_TOOL_MODE: core
MEMTOMEM_EXTRA_TOOLS: mem_update_coverage
ORT_DISABLE_TELEMETRY: "1"
PYTHON_DOTENV_DISABLED: "1"
HF_HUB_DISABLE_IMPLICIT_TOKEN: "1"
# copy any MEMTOMEM_* settings you rely on here
cwd: /path/to/project
Keep the quotes around "1": Hermes accepts only string values under env: and does not
start a server whose value is the number 1. Without PYTHON_DOTENV_DISABLED, memtomem
reads the nearest .env again (see "First run" above). Without
HF_HUB_DISABLE_IMPLICIT_TOKEN, model downloads use a saved Hugging Face login or
HF_TOKEN again; without the --with floor, uv can resolve an older huggingface-hub,
which reads the saved login even with the variable set.
Files outside memtomem's own data
The server is not confined to ~/.memtomem or to the directories you ask it to index. It
runs as your user, and some of its mem_do actions read and write files wherever you can:
- The context-gateway actions keep other coding agents' instruction files, skills,
sub-agents, commands, hook settings and MCP server lists in step with a canonical copy
under.memtomem/, in projects and in the agents' own configuration, for example
~/.claude.json,~/.claude/,~/.codex/,~/.gemini/and~/.kimi-code/. In
memtomem 0.7.12, the version this package runs, only the two reads aremem_doactions:
context_detectandcontext_diff. The writes (context_init,context_generate,
context_sync,context_pull,context_version,context_promote,
context_memory_migrate,context_artifact_migrateandcontext_artifact_transfer)
run from themm contextCLI and are not on MCP; 0.7.8 and earlier also offered them as
mem_doactions. - Actions that take a path from the caller, such as indexing,
ingest(which imports other
agents' instruction files and native memory) and import, read that path. Export takes a
file name, not a path, and writes it to~/.memtomem/exports/. dedup_removetakes two chunk ids, not paths. It re-reads both chunks' whole source
files, including a kept file that was indexed from outside the configured memory
directories, and when both still match what was indexed, removes the duplicate's lines from
its own file, which must be one memtomem manages, and re-indexes it.- While the server runs, a file watcher watches memtomem's configured index roots (its
memory directories and registered project memory directories) and re-indexes files that
change there, and an existing configuration can enable scheduled maintenance jobs.
With lifecycle policies enabled (policy.enabled), they run on a timer without a tool
call, and anauto_consolidatepolicy sends the chunks it summarizes to the configured
LLM provider when one is set.
Those files can hold other tools' credentials, and hooks are commands those agents run.
Some of these actions ask for confirmation through a parameter (confirm_project_shared)
before certain writes; the model sets that parameter itself, and this package adds no limit
of its own.
The six skills call none of the context-gateway actions or ingest; they run only when the
model passes them to mem_do.
Network
Memory is stored locally in ~/.memtomem. The server is downloaded from PyPI on first
start, and uv downloads Python 3.12 then too if it cannot find one. With a fresh BM25-only
configuration nothing else leaves the machine on its own, and two calls reach the network
on request there; the skills make neither: mem_do(action="fetch", params={"url": ...})
downloads the page at the URL it is given and indexes it, and turning reranking on with
mem_do(action="config", params={"key": "rerank.enabled", "value": "true"}) loads the
configured reranker at once, so the default local reranker downloads its model from Hugging
Face then when it is not cached. An existing memtomem configuration may enable its own
network paths: model downloads from Hugging Face (ONNX embedding or local
reranker; a saved Hugging Face login and HF_TOKEN are not used, see "First run"), a
remote embedding or LLM provider (which mem_do actions such as auto_tag and
policy_run then send chunk text to), Cohere reranking (sends the query and
candidate chunks), or search webhooks (send events including the query).
License
Apache-2.0.
README from the reviewed commit 6de8869; it updates when the author re-pins.

memtomem