MemOS plugin for Claude Code
Local-first persistent memory for your agent. Installing this plugin registers
the MemOS MCP server (21 tools: store, search, retrieve, forget, revert,
graph, context packs, temporal search, trust, link, quarantine release,
fact extraction, diagnostics, reminders, …),
plus the /memos, /recall, /forget, /revert, and /timeline slash commands and
the memos-memory skill.
Install
/plugin marketplace add Markgatcha/memos
/plugin install memos@memos-marketplace
The MCP server runs via npx -y @mem-os/sdk mcp and stores everything in
~/.memos/memos.db on your machine — no cloud, no API keys.
Commands
/memos <fact>— store a durable fact/recall <query>— recall relevant memories/forget <what>— fuzzy-match a memory, confirm, delete it/revert <what>— revert a memory to its previous version ("that", "the last thing", "what I said about X"), confirm first/timeline [limit]— show what MemOS has learned recently, newest first
Hooks
- SessionStart — injects a compact summary of remembered context into new sessions.
- SessionEnd — session wrap-up bookkeeping.
- UserPromptSubmit (auto-capture) — notices explicit "remember this" /
"don't forget" phrasing in your prompts and stores the fact automatically,
no command needed. Conservative: only explicit requests trigger it, slash
commands are skipped (no double-store with
/memos), and anything shaped like a credential is never stored.
Skill
memos-memory teaches the agent when to store (preferences, decisions,
environment facts, corrections) and when to recall (memos_context_pack
before answering questions that may depend on prior sessions), plus
hygiene rules (supersede instead of duplicating, forget only on request).
The skill now also teaches contextual storage: pass context (topic,
date, and the previous turn) and metadata.sessionId / timestamp /
speaker on memos_store. The MCP manifest sets MEMOS_CONTEXTUAL=1, so
the session/date/speaker header is added to the embedding automatically.
On LoCoMo retrieval-only this moved Hit@10 from 69.2% to 80.1% and
all-evidence recall@10 from 59.6% to 71.5% (same embedder, fusion, top-10).
This works identically in Claude Code and Hermes — both consume the same
skills/memos-memory/SKILL.md and mcp.json.
Experimental: local reranking
An opt-in cross-encoder reranker re-scores the top fused candidates for sharper retrieval. Default off. Enable with:
{ "experimental": { "rerank": { "provider": "local" } } }
The default model is Xenova/bge-reranker-base (~278MB, downloaded on first
use). On a 120-question LongMemEval set it reached hit@5 1.0000 (120/120),
evidence recall 0.943, vs 0.958/0.862 for the fused baseline — clearing the
accuracy gate on every metric. Override with localModel or
MEMOS_RERANK_MODEL. Expect ~60s/question on CPU; a GPU or a /rerank
endpoint is recommended for interactive use.