Skip to content

LTM CLI Reference

The mm command is installed with the memtomem package. It provides setup, search, indexing, session tracking, and cross-project context sync. Run mm --help for the full command list or mm --version to print the installed version (the mm version subcommand also works).

This page targets memtomem v0.7.13. Commands are grouped by function, but it’s a single reference — scan top to bottom.

The current top-level surface is preserved here in full. Detailed task flows follow below; use mm <command> --help for the option types accepted by the installed 0.7.13 binary.

GroupCommands
Setup / datainit, config, add, index, ingest, mem, memory
Retrieval / UIsearch, recall, tags, pinned, shell, web, serve
Runtime contextcontext, wiki, sync-doctor
Collaborationsession, activity, agent, review
Evaluation / operationsstatus, doctor, quality, warmup, watchdog, schedule, daemon
Lifecyclegc, embedding-reset, purge, reset, upgrade, uninstall, version

All command-group subcommands are mirrored below.

GroupSubcommands
activitylog
agentdebug-resolve, list, migrate, register, search, share
configset, show, unset
contextadopt, copy, detect, diff, export, generate, import, init, install, memory-migrate, migrate, move, projects, pull, rescan, seed-validation, settings-copy, settings-doctor, settings-migrate, status, sync, update, version
context projectsadd, list, pause, remove, resume
context versioncreate, delete-label, enable, list, promote
daemonstatus, stop
gcorphan-projects, orphan-sources
ingestclaude-memory, codex-memory, gemini-memory
memdoctor, init, rescan, rescan-files
memorydoctor, init, rescan, rescan-files
pinnedcompose, delete, get, list, set
qualitycases, compare, experiment, export, gate, import, promote, replay, show, status
reviewapprove, evidence, list, recover, reject, scan, show
scheduleadd, delete, list, run-now
sessionend, events, list, start, wrap
tagsdelete, list, merge, rename
watchdoghistory, run, status
webstatus, stop
wikiagent, command, init, list, pull, push, remote, skill
wiki agent/command/skillcommit, diff, lint, new, override, promote

Bare mm web launches the UI; status and stop manage it.

Terminal window
mm doctor --json
mm doctor --mcp-client claude
mm doctor --mcp-client claude --reconcile keep-manual
mm doctor --mcp-client claude --reconcile keep-manual --apply
mm agent debug-resolve --agent-id alice
mm review evidence CANDIDATE_ID --top-k 5
mm context seed-validation --help
mm context version --help
mm context settings-doctor --json

doctor diagnoses runtime configuration and lists the memtomem server processes on the machine. With --mcp-client claude, agy or codex it checks registrations instead: whether a manual MCP registration and that client’s memtomem plugin would start two servers (--claude-mcp remains an alias for the Claude check). In that mode it exits 0 on a pass, 1 on a duplicate risk and 2 when the inspection is incomplete. --reconcile keep-manual keeps the manual registration and the plugin’s skills and suppresses the plugin’s bundled server; --reconcile keep-plugin removes the manual entry instead. Both only preview, so a preview can exit 1 while proposing a valid repair. --apply makes the edit: it backs up the original file beside it as <filename>.mm-backup-* with private permissions (the backup can contain credentials), replaces that one file atomically and runs the check again. Close every Claude session before applying a Claude edit, and rerun the check after updating or reinstalling a plugin, which can restore its bundled server. Malformed or shadowed configurations, several manual registrations and managed policies are reported for manual review and never edited. agent debug-resolve explains search scope. review evidence compares a candidate with indexed memories but never approves it. BM25-only or unindexed dense stores may report evidence unavailable. seed-validation writes validation context assets; inspect its help before choosing to run it. settings-doctor --json reports the highest-ranking status of duplicates, malformed, incomplete, advisory, clean. advisory means the only findings are hook commands that may not run on another machine; clean means every axis is empty. duplicates and malformed exit 1; the others exit 0, so a script that passes only on clean should accept advisory too or read the findings. A settings file in a directory memtomem cannot search is skipped and listed as unreadable; with no duplicates or malformed matchers the status is then incomplete.

In v0.7.13, -y is accepted but ignored. Scripts must pass --non-interactive explicitly. Embedding reset deletes vectors but retains file hashes, so recovery requires mm index --force <path>.

Run the interactive setup wizard. Configures embedding provider, database path, tokenizer, reranker, and default namespace.

At startup, the setup wizard offers a preset picker (Minimal / English (Recommended) / Korean-optimized) that applies a curated bundle of embedding, tokenizer, and namespace defaults. Pressing Enter picks what the environment can finish: the preset prompt defaults to Minimal unless the onnx extra is importable, and the MCP registration prompt defaults to Skip when the claude CLI is not on PATH (0.7.8). Configuring a remote inference endpoint surfaces a notice that memory text and queries are sent to that endpoint (0.7.6). No preset turns on a reranker: add one with mm config set rerank.enabled true or the Advanced wizard’s reranker step. Rerunning mm init with a preset leaves an existing rerank section in config.json as it is. Pass --preset <name> --non-interactive to run without prompts, or --advanced to force the full 10-step wizard.

Terminal window
mm init # interactive setup with preset picker
mm init --non-interactive # auto-accept; behaves as `--preset minimal --non-interactive`
mm init --preset korean --non-interactive # apply Korean preset non-interactively
mm init --preset english --non-interactive # English preset, no prompts
mm init --advanced # skip picker, run full 10-step wizard
mm init --fresh # bulk-clean accumulated config, then re-run wizard

On a reinstall path, mm init compares the embedding provider / model / dimension stored in the existing ~/.memtomem/memtomem.db against the new preset. On mismatch, the interactive wizard offers an in-place rebuild of the vector index (chunks_vec); under --non-interactive, it prints a recovery hint pointing at mm embedding-reset --mode apply-current. The chunks table itself is preserved, so re-running mm index --force <path> afterwards restores the working set.

--fresh resets wizard-untouched canonical settings to built-in defaults. It preserves custom keys, credentials, endpoints and user-curated lists; a backup is written only when keys are actually dropped.

memtomem’s MCP server ships as the memtomem-server console script. You normally don’t launch it by hand — your MCP client (Claude Desktop, Claude Code, Cursor, etc.) starts it automatically from its config file. See Connect an AI Client for the per-client registration steps.

To filter which tools the server advertises, set MEMTOMEM_TOOL_MODE (core / standard / full) in the client’s MCP config. The default is core (8 core tools + the mem_do router, 9 total); full exposes 94 current tools without deprecated aliases. See the MCP Tools page for modes and tool catalogs.

Since v0.1.25, an MCP handshake alone no longer creates ~/.memtomem/memtomem.db — the DB opens on the first tool call, and the server pid/flock file moved to $XDG_RUNTIME_DIR/memtomem/server.pid (or $TMPDIR/memtomem-$UID/ on platforms without one). A client that connects but never calls a tool leaves the home directory untouched.

memtomem-server --shared NAME (0.7.11, POSIX, opt-in) lets several client sessions share one engine. The first session that asks for NAME starts a background daemon, and later sessions that ask for the same name join it; each client’s memtomem-server then only passes messages to the daemon. Add the option to the arguments your client already launches. mm serve --shared NAME does the same for a client that launches mm serve. --shared is stdio only. Without it nothing changes.

A session joins only when the daemon matches it on the MEMTOMEM_* and LANGFUSE_* variables after .env is applied (by name, value and order), the tool mode and extra tools, HOME, the store path and the installed package. A session that does not match, uses a relative configured path or a store that cannot be shared, or runs on Windows is served as a standalone server, and its mem_status shows Shared daemon: NAME not joined (<reason>). A joined session uses the daemon’s live configuration. The daemon exits after 600 seconds with no session. memtomem-server --daemon NAME [--idle-timeout S] runs one in the foreground with that shell’s environment, and --idle-timeout 0 keeps it running.

Terminal window
mm daemon status # every daemon; exit 0 if one runs (or cannot be verified), 3 if none, 1 if they cannot be listed
mm daemon status main --json # {"daemons": [...], "count": N}
mm daemon stop main # SIGTERM, then SIGKILL if still running after --grace seconds (default 5)
mm daemon stop # every running daemon

Stopping a daemon, or a daemon crash, ends every session connected to it: its memtomem-server exits with status 1, and whether the client starts a new one or needs a reconnect or restart depends on the client. mm doctor adds a shared-daemons check. Join reasons, what has to match, and limits are in the upstream shared daemon guide.

mm config show displays the current configuration with API keys masked. --json (or --format json) emits the full config as machine-readable JSON. mm config set <key> <value> writes a user override on top of built-in defaults; mm config unset <keys...> removes those overrides so the field reverts to its built-in default (or whatever a config.d/*.json fragment resolves to).

Terminal window
mm config show # human-readable table
mm config show --json # JSON for scripting
mm config set search.default_top_k 20
mm config set rerank.model bge-reranker-base
mm config unset indexing.memory_dirs
mm config unset rerank.model search.default_top_k

mm config unset is idempotent — removing a key that isn’t there is a silent no-op. Useful for clearing stale cross-machine paths in indexing.memory_dirs, or a single field that’s shadowing a config.d fragment.

Search the knowledge base from the command line.

Terminal window
mm search "how does the auth middleware work"
mm search "deployment config" --namespace project-x --top-k 5

--top-k / -k caps results (default 10). Other filters: --source-filter / -s, --tag-filter / -t, --namespace / -n, --as-of (point-in-time bound, YYYY-MM-DD / YYYY-QN), and --format (table / json / plain / context / smart); --json is shorthand for --format json. In JSON rows, content holds the whole chunk and content_preview its first 200 characters.

Curate the tags on your chunks — the CLI equivalent of the Web UI Tags tab. Every mutating subcommand is a dry-run by default; pass --apply to actually write.

Terminal window
mm tags list # tags in use and how often
mm tags rename ops infra # dry-run preview
mm tags rename ops infra --apply # perform the rename
mm tags delete deprecated --apply # drop a tag (chunks stay indexed)
mm tags merge py python --into python --apply # fold several tags into one

Without --apply, each command first shows the affected chunk count and samples. delete only strips the tag — the chunks themselves stay in the index.

Browse recent memory chunks chronologically. Unlike mm search, no query needed — filter by date range, source path, or namespace instead.

Terminal window
mm recall # most recent 20 chunks (default table)
mm recall --since 2026-04 --limit 50
mm recall --source-filter "postmortems/" --format json
mm recall --namespace project-x --format plain

--format picks table (default, human), json (scripting), or plain (text pipe); --json is shorthand for --format json. JSON rows carry id, source, content (the whole chunk), content_preview (its first 200 characters) and created_at. Date arguments accept YYYY, YYYY-MM, YYYY-MM-DD, and ISO datetimes.

Launch the Web UI dashboard for browser-based search and memory management.

On launch, mm web opens the dashboard at http://127.0.0.1:8080. Simple mode shows Home, Search, Sources, Gateway, Index, and Settings. Gateway contains Overview, Projects, Skills, Commands, Subagents, MCP Servers, Hooks, and Wiki; rows use Push and preview-first Pull actions. Settings contains Config, Namespaces, and Reset Database.

The header’s Advanced toggle reveals Tags and Timeline plus Dedup, Age-out, and Export/Import settings. Pass --dev (or set MEMTOMEM_WEB__MODE=dev) to add maintainer pages: Sessions, Search Runs, Quality Lab, Working Memory, Procedures, Health Report, Redaction.

Since 0.7.9, /api/* refuses browser requests from another origin — including another loopback port — returning 403 on both GET reads and writes. Non-browser tools that send no Origin or Referer header pass this check. Since 0.7.10, such a tool’s GET /api/search still returns results but is not recorded (no access count, search history, or query_run_id for feedback) and runs outside the result and query-expansion caches unless it sends the csrf value from GET /api/session in the X-Memtomem-CSRF header. --trusted-origin <hostname> takes a hostname (not a port) and allows requests from any port on that host (for example mm web --trusted-origin localhost).

Terminal window
mm web # default: http://localhost:8080 (prod tier)
mm web --port 9000
mm web --open # also open the URL in your default browser
mm web --dev # shortcut for --mode dev
mm web --mode dev # expose opt-in maintainer pages

Start an interactive REPL — search, add, recall, tag counts, and index stats all from a single prompt. Handy for browsing memory from a terminal without an MCP client, or for a quick post-install feel-check of the DB.

Terminal window
mm shell
mm> search deployment checklist
mm> ask summarize last week's migration rollback decision
mm> add "new fact I just learned"
mm> stats
mm> quit

Bare text (no command) is treated as an implicit search. Exit with Ctrl+D or quit / exit / q.

Add a memory entry and index it. Without --file, the content is appended to today’s day file under ~/.memtomem/memories/: <today-UTC>.md for the default namespace, or <today-UTC>--<slug>-<digest>.md for any other namespace.

Terminal window
mm add "apply tree-sitter AST parser to hallway-door PR"
mm add "API timeout policy" --title "API timeout" --tags "ops,api"
mm add "postmortem summary" --file postmortems/2026-04-auth.md

Tags passed via --tags are merged onto the appended file’s chunk metadata right after indexing — the chunker doesn’t parse tag text from the body, so the merge is explicit. --file only accepts paths relative to the active scope’s memory directory and rejects .. components; since 0.7.9 it also refuses a path that resolves into another registered memory tier (such as a project_shared tier nested inside ~/.memtomem/memories/), even with --confirm-project-shared — write to that tier from its project with --scope instead. An append is refused when the target already holds entries in another namespace, or, since 0.7.5, when its name is a non-default day-file name that decodes to another namespace; --allow-namespace-mix overrides. A name that does not decode, such as one with a truncated slug, routes as before.

One-shot command that seeds the index with files already on disk. Re-runs are safe — chunks are content-hashed, so unchanged files are skipped.

Terminal window
mm index . # index current directory
mm index ~/docs/architecture # index a specific directory
mm index README.md # index a single file

Paths listed in indexing.memory_dirs are watched by the long-running memtomem-server process, but the watcher is reactive only. It reindexes modify/create/move events after startup; pre-existing files are not scanned automatically. Each start does check the files already indexed once, and hides the chunks of a file that has since been replaced by a symlink; it indexes nothing new. Seed once with mm index <dir> (or mem_index(path="<dir>")), then let the MCP server watcher handle later edits. MEMTOMEM_INDEXING__STARTUP_BACKFILL=true is an opt-in one-shot backfill for the Web UI startup path.

With watchdog 7.0 (the version a fresh install resolves), on the native Linux backend and the polling backend (the macOS default), a change of permissions or ownership alone reaches the indexer like an edit, so chmod 000 on an indexed note holds it out of search. If the watcher cannot start (for example, a native FSEvents stream that fails to open), the server keeps answering tool calls without live file events: the startup check of indexed files still runs, and mem_status shows a watcher_unavailable warning with the error and a fix: set indexing.watcher_backend to "polling" (or close other memtomem-server sessions), then restart the server. mm status runs no watcher, so it never shows this warning.

Consolidate memories from other AI tools into memtomem. The --source path is required; re-runs are incremental via content-hash matching.

Terminal window
mm ingest claude-memory --source ~/.claude/projects/ # import Claude Code memories
mm ingest gemini-memory --source ~/.gemini/GEMINI.md # import Antigravity CLI GEMINI.md
mm ingest codex-memory --source ~/.codex/memories/ # import Codex CLI memories

Manage the explicit project-memory trust gate and audit already-stored material without writing new memory.

Terminal window
mm mem init --scope project_local
mm mem init --scope project_shared --confirm-project-shared
mm mem rescan --scope user [--source PATH] [--json] [--quiet]
mm mem rescan-files --json

init requires a real project marker and registers the chosen memory tier atomically. rescan is read-only and exits 1 on a privacy finding; the scope is always explicit. rescan-files audits historical imported, fetched, and session files.

mm context keeps canonical agents, skills, commands, and MCP server definitions in a Store and syncs them to each AI runtime. Tiers are addressed with --scope user, --scope project_shared, or --scope project_local. See the Context Gateway guide for tier rules and workflows, and the complete option index for every option.

Terminal window
mm context detect # runtime files memtomem can see
mm context init --scope project_shared --confirm-project-shared # seed the Store from runtime files
mm context sync --scope project_shared # push Store copies out to runtimes
mm context diff --scope project_shared # compare Store and runtime copies
mm context pull skills reviewer --from claude --diff # preview one runtime artifact entering the Store
mm context copy skills my-skill --to-project ~/work/other-app # transfer across projects or tiers (preview)
mm context move commands deploy --to project_shared --confirm-project-shared --apply
mm context projects add ~/work/app-a # register a project (also list / pause / resume / remove)
mm context sync --all-projects # sync Project (shared) in every registered project
mm context status --all-projects # read-only: which projects drifted
mm context export skills deploy-check --out deploy-check.json # pack a bundle for another machine
mm context import deploy-check.json --to user # land a bundle (preview)

pull, move, copy, and import preview by default; pass --apply to write. Applying a pull, move or copy into Project (shared) asks for confirmation; in non-interactive runs pass --confirm-project-shared, because --yes alone is refused. mm context sync also asks before writing settings files outside the project and before an --all-projects push; --yes skips those prompts.

Collect canonical versions of your skills, agents, and commands in a host-global wiki (~/.memtomem-wiki/) and install them into projects on demand. The wiki is a normal git repo, so changes are recorded as isolated commits and backed up / synced across machines via remote/push/pull — no separate sync tooling needed.

Terminal window
mm wiki init # create ~/.memtomem-wiki/ (skills/ agents/ commands/)
mm wiki init --from git@host:me/wiki # clone an existing wiki from a git URL
mm wiki list # list the skills / agents / commands you hold
mm wiki list --type skills
mm wiki remote git@host:me/wiki # configure the backup remote (origin)
mm wiki push # back up to the remote
mm wiki pull # restore on another machine

Each artifact kind (skill / agent / command) has a subgroup to seed per-runtime overrides and to diff, lint, and commit them. The Commit button in the dev-mode browser does the same, so no raw git is required.

Terminal window
mm wiki skill override my-skill --vendor claude --editor # seed an override from canonical content
mm wiki skill diff my-skill --vendor claude # diff against the canonical render
mm wiki skill lint my-skill # validate it is installable (usable as a CI gate)
mm wiki skill commit my-skill --vendor claude # record as an isolated commit

Install an artifact you’ve collected with mm context install <type> <name>.

Manage durable Pinned Context blocks that compose ahead of retrieved memory. The complete group is list, get, set, delete, and compose.

Terminal window
mm pinned list
mm pinned get <key>
mm pinned set <key> --content "Keep reviews evidence-first"
mm pinned delete <key>
mm pinned compose

See Pinned Context for exact scope, shadowing, idempotency, and composition rules.

Generate and adjudicate review-first memory candidates. Nothing becomes durable until approval.

Terminal window
mm review scan <session-id>
mm review list --status pending
mm review show <candidate-id>
mm review approve <candidate-id> --reviewer alice
mm review reject <candidate-id> --reviewer alice --reason "not durable"
mm review recover --stale-after-minutes 15 --actor alice

Manage agent sessions — start, end, list, events, and wrap. Sessions group activity events and tie them to an agent runtime.

Terminal window
mm session start --agent-id claude-code --title "refactor auth"
mm session list --json # scriptable list output
mm session events <session-id> --json # event timeline as JSON
mm session wrap -- <command...> # auto start/end around a command
mm session end --auto --json # summarize from events, print a JSON ack

mm session end --json prints {"ok": true, "session_id": ..., "summary": ..., "event_count": N} on success, and {"ok": false, "reason": ...} with exit code 1 when there is no active session or storage fails. mm session events --json with no session prints {"error": "no_session"} and also exits 1.

The current session ID is stored in ~/.memtomem/.current_session, so mm activity log and other commands pick it up automatically.

Log an activity event (tool call, decision, error, subagent lifecycle) to the current session. Silent by default so hook callers never fail; --json emits an ack shape for scripting.

Terminal window
mm activity log --type tool_call --content "ran tests"
mm activity log --type decision --content "picked strategy X" --meta '{"k":"v"}' --json

With --json, a successful write returns {"ok": true, ...} on stdout; a failure returns {"ok": false, "reason": ...}. No active session (no_active_session) is a no-op and exits 0; malformed --meta (invalid_meta) or a failed write (write_failed) exits 1. Without --json, a missing session or a failed write prints nothing on stdout and exits 0.

CLI mirrors of the MCP mem_agent_* tools — register agents, inspect the registry, and copy chunks between scopes.

Terminal window
mm agent register planner --description "Planning subagent" --color "#6c5ce7"
mm agent list # registered agents + the shared namespace
mm agent list --json
mm agent share <chunk-id> # copy into the shared namespace
mm agent share <chunk-id> --target agent-runtime:reviewer

mm agent register creates the agent-runtime:{agent_id} namespace; re-registering with the same id only updates metadata. agent_id must match [A-Za-z0-9._-] — IDs outside the allowed pattern are rejected.

--color takes # followed by 3, 4, 6 or 8 hex digits, and an empty string clears the color; a 5- or 7-digit value is rejected with an error and no namespace metadata is created or changed. --description is scanned by the write guard, with no --force-unsafe bypass. A description that puts : or = right after a credential name, such as api_key: see the vault, is not saved and the command exits non-zero, even though it holds no credential. The MCP tools mem_agent_register and mem_ns_update and the Web UI’s namespace editor apply the same checks; the Web UI answers a refused description with 403 redaction_blocked.

mm agent share is a copy, not a reference link. The new chunk gets a fresh UUID and source updates do not propagate; provenance is recorded only via a shared-from=<source-uuid> tag on the copy.

Terminal mirror of the MCP mem_status tool. Use it as a post-install sanity check: confirms the binary runs, the config parses, the DB is reachable, and the embedding config is in sync — without needing to launch an MCP client. Sits between mm config show (config only) and mm watchdog status (periodic snapshots).

Terminal window
mm status # indexing stats + config summary (same output as mem_status)
mm status --json # machine-readable, for scripts / `jq` pipelines

Added in v0.1.25; --json / --format json added in v0.3.4. Good fit for a one-liner “is the DB open and how many entries are in it” check before wiring an MCP client.

When search.tokenizer is kiwipiepy but the kiwipiepy package cannot be found, or the process has already fallen back to unicode61, both mm status and mem_status list a tokenizer_fallback warning. Rows indexed during the fallback are tokenized differently, so Korean keyword search can miss them. Install the korean extra wherever memtomem runs, restart its servers, then rebuild the keyword index. When a remote embedding, reranker, or LLM endpoint is configured, both surfaces also report the active remote endpoint with credentials stripped (0.7.6).

Run six read-only checks against the current private memory-sync repository. Failures exit non-zero; warnings do not.

Terminal window
mm sync-doctor

Preload the local embedder / reranker models so the first query doesn’t pay the one-time model load. Optional — without it the models load lazily on first use.

Terminal window
mm warmup # load models now (one-shot)

To warm up automatically when the MCP server starts, set MEMTOMEM_WARMUP__ENABLED=true. Remote providers (Ollama / OpenAI / Cohere) are skipped — there’s nothing local to preload.

Inspect memory-store consistency read-only — it reports 3-way drift between the notes folder on disk, the index file, and the searchable DB (e.g. files added while the server was off and never indexed, or dead index links). The default report is read-only and changes nothing.

Terminal window
mm memory doctor # inspect every memory_dir (read-only)
mm memory doctor ~/notes # scope to one configured memory_dir
mm memory doctor --fix # preview removal of broken index links (dry-run)
mm memory doctor --fix --apply # actually remove broken links

--fix only removes index pointer lines whose target is missing on disk, and it is a dry-run unless --apply is also passed. It exits 1 when any error-severity finding exists, so it works as a CI check. A held missing source is reported as held_source, a warning, so it exits 0 when held sources are the only finding. A missing source that indexing.retain_missing_dirs keeps searchable is reported as archived_source, at info severity.

dangling_wikilink is informational: it may be a deliberate forward reference or a stale name. It never fails the run and --fix never removes it.

Manage deterministic retrieval evaluation cases, replay them, compare reports, and enforce a quality gate. Search runs and labels are also available in the dev-mode Web UI’s Search Runs and Quality Lab pages.

Terminal window
mm quality cases
mm quality replay --out baseline.json
mm quality compare baseline.json candidate.json
mm quality gate baseline.json candidate.json --policy policy.json

mm quality gate requires --policy, a committed gate-policy JSON file. It exits 0 when the candidate passes, 1 on a policy violation (the verdict is still printed first), and 2 on invalid input.

Periodic health-check command group. Read back snapshots left by the background scheduler, or run every check once on demand.

Terminal window
mm watchdog status # latest results summary
mm watchdog status --json # JSON output
mm watchdog run # run all checks now
mm watchdog history db_size --hours 48 # 48h trend for a specific check

The scheduler only runs in the background when health_watchdog.enabled is on (the MCP server drives it). Even with the scheduler off, mm watchdog run works any time for a one-shot offline check.

Register cron-driven jobs (compaction, importance decay, dead-link cleanup, dedup scans, …) and inspect or run them.

Terminal window
mm schedule add --cron "0 3 * * *" --job dedup_scan
mm schedule add --cron "0 */6 * * *" --job importance_decay --params '{"max_age_days": 90}'
mm schedule list
mm schedule list --json
mm schedule run-now <sched-id> # fire immediately, out of band
mm schedule delete <sched-id>

--cron is a 5-field expression in UTC. --params is a JSON dict of job-specific parameters; since 0.7.9 registration refuses unknown parameter keys for the chosen job (or any key on a job that takes none). The dispatcher rides the health-watchdog loop, so registered jobs only fire when both scheduler.enabled and health_watchdog.enabled are on.

mm schedule list --json returns each schedule’s whole record. Besides last_run_status, last_run_error and last_run_result, it carries state (where the next run starts, for a job that continues between runs, which is dedup_scan; null for the others), params_error (why the stored params cannot be read, or null) and cron_error (null when the expression can be scheduled; otherwise why the dispatcher cannot schedule the row, which mm schedule list marks automatic runs blocked, or unchecked: … when the check reaches no verdict). mm schedule run-now still runs a row whose cron expression blocks automatic runs. A schedule whose stored params cannot be read never runs with the job’s defaults: every run of it, from the dispatcher or run-now, is recorded as error with invalid params: <reason> before the job starts. Since 0.7.11 a dedup_scan schedule walks the store: each run scans the pool after the one its last finished run scanned, and starts over after the end of the store.

Find indexed source records whose files no longer exist. Preview is the default; pass --apply to remove the orphaned source records and their chunks permanently. Orphans are grouped by the configured memory dir that owns them, plus one group for sources outside every root, and --apply deletes a group only after you confirm it; --yes skips those prompts. --under DIR (repeatable) considers only sources under the directories named, so --apply --yes deletes only there. A source matches by the path it was indexed under, so a file that has since become a symlink matches where the link sits; DIR itself is resolved.

The watcher, scheduled compaction and health maintenance never delete a missing source on their own: they hold it. A held source is hidden from search while its chunks are kept for recovery. To delete those chunks, review with mm gc orphan-sources, then run it with --apply. Over MCP, cleanup_orphans purges only when both dry_run=false and confirm_purge=true are passed, and takes under to narrow the scan. A missing source under both an index root and indexing.retain_missing_dirs is the exception: its absence hold is released, so it stays searchable (Archived: in mm status) and is not offered for purge. A source held for another reason, such as redaction_blocked or scan_unavailable, stays held. One case still deletes on its own: a path that now holds a directory or another non-regular file loses its chunks on the next event for it.

Terminal window
mm gc orphan-sources
mm gc orphan-sources --apply
mm gc orphan-sources --apply --under ~/notes

mm gc orphan-projects handles a separate case: chunks whose recorded project_root no longer exists. It previews by default; use --apply for per-root confirmation or --apply --yes for an explicitly non-interactive deletion. Review removable or temporarily unmounted roots before confirming.

Check or resolve mismatches between the embedding model/dimension stored in the DB and the current config (typically after swapping providers or following a reinstall). --mode selects the action.

Terminal window
mm embedding-reset # --mode status (default): compare DB vs. config
mm embedding-reset --mode apply-current # reset DB to current config (destructive — re-index required)
mm embedding-reset --mode revert-to-stored # switch runtime embedder to DB stored values (non-destructive)

apply-current rebuilds chunks_vec at the current config’s dimension. The chunks table itself is preserved, but all vectors are deleted — run mm index --force <path> afterwards to re-index. revert-to-stored only flips runtime state; to make it permanent, update the embedding fields in ~/.memtomem/config.json accordingly.

Remove already-indexed chunks whose source paths match the built-in credential denylist or your indexing.exclude_patterns. Runs as a dry-run by default — pass --apply to actually delete. A stored path that now resolves somewhere else (the file became a symlink after it was indexed) is neither judged nor deleted: it is skipped and listed on stderr, or with --json reported in moved and moved_sample.

Terminal window
mm purge --matching-excluded # dry-run — shows what would be removed
mm purge --matching-excluded --apply # perform the deletion

Delete all data (chunks, sessions, activity log, etc.) from the DB and reinitialize the schema. Embedding configuration is preserved — re-index to repopulate, no re-config needed. A confirmation prompt shows the row count; pass -y to skip.

Terminal window
mm reset # confirm, then delete
mm reset -y # skip prompt

Where mm embedding-reset --mode apply-current rebuilds vectors only, mm reset drops the whole index. It doesn’t touch the config file — for a full wipe, pair it with mm init --fresh or mm uninstall. It refuses while a shared daemon runs and names the command that stops it (mm daemon stop NAME).

Stop a running memtomem-server, then reinstall via uv tool. uv tool install --reinstall memtomem alone only swaps the on-disk bytes — a server already imported by an MCP client keeps running the previous version — so this adds the process-cleanup step around it. A running shared daemon is stopped the same way, which ends every session connected to it; the next session starts a daemon on the new version.

Terminal window
mm upgrade # reinstall to the latest version (extras auto-detected)
mm upgrade --version 0.7.13 # pin a specific version
mm upgrade --extras all # name the extras to install (default: auto-detect)
mm upgrade --dry-run # print the plan, change nothing

Extras are auto-detected from the current uv-tool install by default, so a memtomem[all] user keeps [all]. If uv’s install receipt is missing or unreadable, none are detected; check the Extras: line of --dry-run and pass --extras when it says none were found.

Checks after upgrading from an earlier release:

  • From before 0.6.9: run mm index over your memory directories once. It judges every file with the redaction guard, so content the memory tools stored without that check is reported as blocked and held until the file is cleaned and re-indexed. Chunks whose text and context are unchanged keep their vectors, so --force is not needed.
  • Private keys in PKCS#8 form (BEGIN PRIVATE KEY, BEGIN ENCRYPTED PRIVATE KEY) pass the write guard before 0.6.12, and upgrading does not rescan what is already stored. Run mm mem rescan --scope <tier> --json to list stored chunks that carry a key, take the key out of each reported file, and run mm index <dir>. Re-run the rescan: it should report nothing. A source it still reports was not reindexed: a file you deleted, an excluded path, a file over 10 MB, or a file whose mm index run reported an error. The advisory lists how to remove those chunks. Rotate any key that reached a hosted service or a git history.
  • From before 0.7.0: frontmatter in memory files, and in Context Gateway agent and command files, is read as YAML. After a re-index an unquoted # suffix is a comment and is dropped with a warning, and a key needs a space after its colon; quote a literal hash. Back up again after upgrading: export now writes bundle v4, and only 0.7.0 or later restores it fully, because an earlier import ignores the scope, project and validity fields v4 adds.
  • From before 0.7.1: namespace="!system" now selects every namespace except the system ones, so a namespace literally named !system (possible in 0.7.0 through mm index --namespace, namespace rules or a raw mem_add) can no longer be selected by that name. On mem_search, mem_recall, mm search and mm recall a comma list that includes it, such as "!system,work", is refused; drop it from saved filters. Find such a namespace with mem_do(action="ns_list"), move it with mem_do(action="ns_rename", params={"old": "!system", "new": "<name>"}), then change the rule or flag that produced it. On 0.7.1 a later re-index can write it again; from 0.7.2 the name is refused or skipped (next item).
  • From before 0.7.2: writes refuse a namespace that a search could not find by name: one that contains , or *, is !system, is whitespace only, or is an agent-runtime: name whose agent id the agent tools refuse (agent-runtime:foo:bar). An empty string still means no namespace was given. mem_add, mem_batch_add, mem_fetch, mem_index, mem_import, the Notion and Obsidian importers, mm index --namespace and the web add and index routes refuse such a name before writing. The check is narrower than the one mm add --namespace and the session and mem_ns_* tools apply, so rule-generated names such as claude:-Users-me-project keep working. The indexer skips such a name from a namespace rule, a folder name (enable_auto_ns) or default_namespace and moves on to the next rule, then enable_auto_ns, then default_namespace; a default_namespace that fails stores the chunks untagged (default). mm config set, mem_config, mm init --namespace and mem_policy_add refuse such a name. A value already in config.json or a config.d fragment still loads, but namespace.rules is written as a whole list, so fix such an entry before editing the rules through those surfaces. A lifecycle policy already stored with such a target moves nothing and reports an error when it runs. Rows already stored under such a name keep it, also on a plain or --force re-index: move them with mem_do(action="ns_rename", ...), which refuses an empty source name, or fix the rule and run mm index --reassign-namespaces.
  • From before 0.7.3: a hand-written MCP registration, or one an earlier mm init --mcp wrote, for a client that runs the update workflow needs MEMTOMEM_EXTRA_TOOLS=mem_update_coverage in its env (OpenCode: environment). Without it, update stops before writing whenever a coverage call is due: in incremental or full mode, once it has read at least one commit message in full. topic mode, and a server in full tool mode (which exposes the tool anyway), are unaffected. Re-running mm init --mcp kimi rewrites the Kimi Code entry with the variable; mm init --mcp claude (or json) leaves an existing Claude registration as it is, so add it there yourself (see the manual registrations). Claude plugin users who also keep a manual registration: the plugin released with 0.7.3 launches that release, so run mm doctor --claude-mcp, align the manual entry’s launch with the plugin’s or remove the entry, then reload and check /mcp.
  • From before 0.7.4: a MemtomemBaseStore moves its record files to <root>/records.v2/ the first time 0.7.4 or later opens the store. Stop every process that runs an older memtomem on that store before you upgrade. The move is not undone automatically, and an older memtomem does not read records.v2/; to go back, restore a copy of the store root taken before the upgrade.
  • From before 0.7.5: mem_edit and PATCH /api/chunks/{id} refuse an edit of indexed text that is not the chunk’s source, for example text with resolved wikilinks or merged sections. Instead of writing, they answer edit_base_mismatch with the chunk’s source text and a base_hash; send the edited source text back with that base_hash. An edit with base_hash replaces the source text verbatim, so keep every line of it you want to stay, heading and header included. GET /api/chunks/{id}/source returns the same source text and base_hash before an edit; the Web UI’s editors use it. Without base_hash, a body-only edit of an entry mem_add wrote keeps its heading and > created: / > tags: header as before. For an untagged entry, whose indexed text shows its > created: line, an edit that changes or moves that line, or whose new body starts with >, is refused the same way.
  • From before 0.7.5: a chunk’s created_at comes from its entry’s > created: line whenever the store creates the row, so editing an entry or rebuilding the index keeps the date the entry was written. Date-ranged recall (mm recall --since / --until, mem_recall’s since / until), newest-first ordering, the oldest-copy choice in dedup and age-based policies on created_at follow that date. Time decay reads updated_at and is unchanged. An edit without base_hash whose new content opens with its own ## heading replaces the whole entry and drops the header, so that entry is dated by the edit. The date is read only from a > created: line in the blockquote group that leads the section, and a value that does not parse as an ISO 8601 time is ignored. Rows already stored keep their created_at, and text without such a line is dated by the index run, as before.
  • From before 0.7.5: a file named like a non-default day file ({date}--{slug}-{digest}.md) whose name decodes belongs to the namespace the name encodes, whoever wrote it and whether or not it is empty; names that do not decode route as before. A write with no explicit namespace, no agent-session binding and no current namespace set with mem_ns_set into such a file with no stored rows lands in that namespace. A write under another namespace into it (mem_add(file=...), mm add --file, the Web UI’s add) is refused like any other namespace mix; allow_namespace_mix=true / --allow-namespace-mix overrides. Re-indexing such a file with no stored rows, after the database is gone or on another machine, puts it back in that namespace ahead of a session binding; stored rows, an explicit namespace and --reassign-namespaces still win. Namespace moves made after writing (mem_ns_rename, mem_ns_assign, archive and promote policies) live only in the database, so a rebuild returns those files to the namespace in their name: keep the database, or reapply the moves after a rebuild.
  • From before 0.7.9: the nine Context Gateway write tools (mem_context_init, generate, sync, pull, memory_migrate, artifact_migrate, artifact_transfer, version, promote) are removed from MCP; run them with mm context (init, generate, sync, pull, memory-migrate, migrate, copy / move, version). By-id edit and delete refuse chunks indexed from explicit paths outside managed memory roots, registered project tiers, and ~/.memtomem/uploads with source_unmanaged; project-scope mm pinned / mem_pinned_* writes and deletes refuse when .memtomem, the tier directory, pinned, or a directory below it is a symlink or junction; and mm web refuses cross-origin browser /api/* requests (403 on reads and writes; pass --trusted-origin <hostname> when needed). Existing environments also keep opentelemetry-api 1.45.1 until dependencies are resolved again (mm upgrade / uv tool upgrade memtomem, uv cache clean opentelemetry-api && uv cache prune for cached uvx launches, or pip install -U opentelemetry-api in virtual environments — verify 1.45.2 or later), keep an older filelock until pip install -U filelock, and on macOS/Linux keep the prior mode on an existing ~/.memtomem/cache/fastembed directory until chmod 700 ~/.memtomem/cache/fastembed.
  • From before 0.7.10: mem_export takes a bare file name and writes it to ~/.memtomem/exports/ (see Common Actions); a client, prompt, or workflow that passes a path gets Export refused: output_file must be a file name, not a path. mem_config no longer changes session_trace.*; use mm config set or the Web UI. mm context, mm mem init, and the Web UI’s sync refuse a project entry that is a symbolic link or junction (see Context Gateway). The write guard has six more rules and also reads titles, tags, and JSON-escaped text, so a write, index, or sync that passed before can be refused; content stored earlier is not re-scanned: audit stored memory chunks with mm mem rescan --scope <tier> and Context Gateway artifacts with mm context rescan --scope <tier>, once for each tier (each command covers only its own store). memtomem now requires opentelemetry-api>=1.45.2, so an environment that pins OpenTelemetry lower (including opentelemetry-sdk==1.45.1, which needs the API at exactly 1.45.1) no longer resolves until that pin moves. An MCP entry that pins an exact release (memtomem[...]==<version>) keeps serving that release until you move its pin; updating a plugin or the mm CLI does not touch it.
  • From before 0.7.11: an existing dedup_scan schedule starts walking the store (see mm schedule), and the first 0.7.11 or later process to open a store adds a job_state column to its schedules table; an older memtomem can keep using the database. Under the polling watcher (the macOS default), an edit made outside memtomem reaches the index about 10 to 15 s after the write instead of 5 to 6 s; to keep the old interval, set indexing.watcher_poll_interval_ms to 1000 and restart the server. A .env kept inside the installed package’s memtomem/server/ directory is no longer read; move it to memtomem/ or a directory above it.
  • From before 0.7.13: an MCP entry that runs uvx with a requirement naming an extra (memtomem[all]==…, memtomem[onnx]==…) and asks for no Python can stop before the server starts (No solution found) when uv picks a Python older than 3.12. When you move its pin, also put --python 3.12 right after uvx ("--python", "3.12" first in a JSON or TOML args array, right after "uvx" in OpenCode’s command array). Where uv is configured never to download Python, such an entry then needs a Python 3.12 on the machine. Claude plugin users who also keep a manual registration: the plugin now launches uvx --python 3.12 --from 'memtomem[onnx]==0.7.13' memtomem-server, so run mm doctor --claude-mcp and align the manual entry with it or remove the entry (see Claude Code).

Since 0.6.5 the database uses schema version 3. The first newer process to open it migrates it; an earlier binary then stops with This database has schema version 3, but this memtomem binary only supports up to 2 and exit code 1, without touching the data. Any client that launches its own server pinned to an earlier memtomem== version, such as an MCP entry, has to move too.

Clean up ~/.memtomem/ state (config, DB, fragments, backups, uploads) separately from removing the binary. Package-manager commands like uv tool uninstall memtomem only remove the executable, which leaves stale state behind on reinstall — since v0.1.23 this subcommand closes the gap.

Terminal window
mm uninstall # interactive, removes everything
mm uninstall -y # skip the confirmation prompt
mm uninstall --keep-config # preserve config.json + config.d/* + backups
mm uninstall --keep-data # preserve the SQLite DB + ~/.memtomem/memories/
mm uninstall --force # limited POSIX heuristics only; stop live writers first

Custom storage.sqlite_path values outside the default directory are included in the inventory. The command refuses to run while the MCP server or a shared daemon is alive (open WAL handles risk corruption); stop it first (mm daemon stop NAME for a daemon, which --force does not override). When it deletes state, it also removes a dead daemon’s log and stale session entries. --force cannot bypass live instance-registry evidence, the lifecycle barrier, untrusted registry state, or an open SQLite database on Windows. External editor MCP entries (~/.claude.json, ~/.codex/config.toml, etc.) are detected and reported, never modified. For Antigravity that covers the CLI’s ~/.gemini/config/mcp_config.json, the older ~/.gemini/antigravity-cli/mcp_config.json, the IDE’s ~/.gemini/antigravity/mcp_config.json, and its VS Code-side ~/Library/Application Support/Antigravity/User/mcp.json. At the end it prints the exact binary-removal command for your install context (uv tool uninstall memtomem, pip uninstall memtomem, etc.) so you can follow through.

See Quick Start for the full getting-started walkthrough.

Public long options from the pinned source. Short aliases and the common --help flag are omitted. Use each command’s --help for arguments, defaults, and constraints.

CommandOptions
mm--version
mm activity—
mm activity log--content, --json, --meta, --type
mm add--allow-namespace-mix, --confirm-project-shared, --file, --force-unsafe, --json, --namespace, --scope, --tags, --title, --yes
mm agent—
mm agent debug-resolve--agent-id, --current-agent-id, --current-namespace, --include-shared, --no-include-shared
mm agent list--json
mm agent migrate--dry-run, --yes
mm agent register--color, --description
mm agent search--agent-id, --format, --include-shared, --no-include-shared, --shared-namespace, --top-k
mm agent share--force-unsafe, --target
mm config—
mm config set—
mm config show--format, --json
mm config unset—
mm context—
mm context adopt—
mm context copy--apply, --as, --confirm-project-shared, --from, --to, --to-project, --yes
mm context detect--include
mm context diff--include, --scope
mm context export--from, --no-versions, --out
mm context generate--agent, --include, --label, --on-drop, --scope, --strict, --yes
mm context import--apply, --as, --confirm-project-shared, --force-unsafe-import, --to, --to-project, --yes
mm context init--confirm-project-shared, --force-unsafe-import, --include, --only, --overwrite, --scope
mm context install--all, --force, --yes
mm context memory-migrate--apply, --confirm-project-shared, --from, --to, --yes
mm context migrate--apply, --confirm-project-shared, --force, --from, --to, --yes
mm context move--apply, --confirm-project-shared, --from, --to, --to-project, --yes
mm context projects—
mm context projects add--label
mm context projects list--json
mm context projects pause—
mm context projects remove—
mm context projects resume—
mm context pull--apply, --confirm-project-shared, --diff, --force-unsafe-import, --from, --json, --overwrite, --scope, --yes
mm context rescan--json, --quiet, --scope
mm context seed-validation--force, --json
mm context settings-copy--apply, --confirm-project-shared, --event, --hook-command, --json, --matcher, --to, --to-project, --yes
mm context settings-doctor--json, --scope
mm context settings-migrate--apply, --confirm-project-shared, --from, --json, --to, --yes
mm context status--all-projects, --scope
mm context sync--all-projects, --force-unsafe, --include, --label, --on-drop, --runtime, --scope, --strict, --yes
mm context update--all, --dry-run, --force, --force-head, --yes
mm context version—
mm context version create--note, --scope
mm context version delete-label--scope
mm context version enable--scope
mm context version list--scope
mm context version promote--scope, --to, --version
mm daemon—
mm daemon status--json
mm daemon stop--grace
mm doctor--apply, --claude-mcp, --json, --mcp-client, --reconcile
mm embedding-reset--mode, --yes
mm gc—
mm gc orphan-projects--apply, --yes
mm gc orphan-sources--apply, --under, --yes
mm index--debounce-window, --flush, --force, --force-unsafe, --json, --namespace, --no-recursive, --reassign-namespaces, --recursive, --status
mm ingest—
mm ingest claude-memory--dry-run, --source
mm ingest codex-memory--dry-run, --source
mm ingest gemini-memory--dry-run, --source
mm init--advanced, --api-key, --auto-ns, --db-path, --decay, --fresh, --include-provider, --mcp, --memory-dir, --model, --namespace, --non-interactive, --preset, --provider, --tokenizer, --top-k
mm mem—
mm mem doctor--apply, --fix, --json
mm mem init--confirm-project-shared, --scope
mm mem rescan--json, --quiet, --scope, --source
mm mem rescan-files--json
mm memory—
mm memory doctor--apply, --fix, --json
mm memory init--confirm-project-shared, --scope
mm memory rescan--json, --quiet, --scope, --source
mm memory rescan-files--json
mm pinned—
mm pinned compose--agent, --agent-id, --max-chars, --no-rerank, --top-k
mm pinned delete--agent, --agent-id, --confirm-project-shared, --scope
mm pinned get--agent, --agent-id, --scope
mm pinned list--agent, --agent-id, --json
mm pinned set--agent, --agent-id, --confirm-project-shared, --content, --description, --file, --force-unsafe, --priority, --scope
mm purge--apply, --json, --matching-excluded, --sample
mm quality—
mm quality cases--format, --status
mm quality compare--fail-on-regression, --format, --out
mm quality experiment--as-of, --baseline, --case, --format, --out, --policy, --profile
mm quality export--case, --out
mm quality gate--comparison-out, --format, --out, --policy
mm quality import--replace
mm quality promote--allow-unreplayable-filters, --name
mm quality replay--as-of, --case, --format, --out
mm quality show—
mm quality status—
mm recall--format, --json, --limit, --namespace, --scope, --since, --source-filter, --tag-filter, --until
mm reset--backup, --force, --json, --yes
mm review—
mm review approve--reason, --reviewer
mm review evidence--top-k
mm review list--limit, --status
mm review recover--actor, --limit, --stale-after-minutes
mm review reject--reason, --reviewer
mm review scan—
mm review show—
mm schedule—
mm schedule add--cron, --job, --params
mm schedule delete—
mm schedule list--json
mm schedule run-now—
mm search--as-of, --format, --json, --namespace, --no-rerank, --scope, --source-filter, --tag-filter, --top-k
mm serve--shared
mm session—
mm session end--auto, --json, --summary
mm session events--json
mm session list--agent-id, --json, --limit, --since
mm session start--agent-id, --auto-end-stale, --idempotent, --json, --namespace, --title
mm session wrap--agent-id, --title
mm shell—
mm status--format, --json
mm sync-doctor—
mm tags—
mm tags delete--apply, --yes
mm tags list—
mm tags merge--apply, --into, --yes
mm tags rename--apply, --yes
mm uninstall--force, --keep-config, --keep-data, --yes
mm upgrade--dry-run, --extras, --grace, --json, --version, --yes
mm version—
mm warmup—
mm watchdog—
mm watchdog history--hours
mm watchdog run--json
mm watchdog status--json
mm web--allow-remote-ui, --background, --dev, --host, --log-file, --mode, --open, --port, --timeout, --trusted-host, --trusted-origin
mm web status—
mm web stop—
mm wiki—
mm wiki agent—
mm wiki agent commit--canonical, --message, --vendor
mm wiki agent diff--vendor
mm wiki agent lint--vendor
mm wiki agent new--editor
mm wiki agent override--editor, --force, --vendor
mm wiki agent promote--message, --project
mm wiki command—
mm wiki command commit--canonical, --message, --vendor
mm wiki command diff--vendor
mm wiki command lint--vendor
mm wiki command new--editor
mm wiki command override--editor, --force, --vendor
mm wiki command promote--message, --project
mm wiki init--from
mm wiki list--type
mm wiki pull—
mm wiki push—
mm wiki remote—
mm wiki skill—
mm wiki skill commit--canonical, --message, --vendor
mm wiki skill diff--vendor
mm wiki skill lint--vendor
mm wiki skill new--editor
mm wiki skill override--editor, --force, --vendor
mm wiki skill promote--message, --project