Skip to content
VrUaComPublic

About

MYMEM — a free, open-source memory layer over the Model Context Protocol (MCP) that lets any AI agent (Claude, Cursor, Codex, Windsurf...), on any device, read and write the same shared context instead of starting from zero every session.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

MyMeM

MYMEM — a free, open-source memory layer over the Model Context Protocol (MCP) that lets any AI agent (Claude, Cursor, Codex, Windsurf...), on any device, read and write the same shared context instead of starting from zero every session.

Why

Most AI coding tools keep memory local to one machine and one tool. Work done by an agent on one computer is invisible to an agent on another computer, or even to a different tool on the same computer. MyMeM is a small, self-hostable MCP server that any of those agents can call to remember and recall shared context — combined with a file-based store you sync between machines however you like (git, Syncthing, a synced cloud drive folder — MyMeM doesn't care).

Status

v0.6.0. Thirteen tools, file-backed storage, stdio transport. See Roadmap below.

Organization: wing / room / drawer

MyMeM's flat storage maps directly onto the real MemPalace's three-level organizing metaphor (researched in Wave 5, not invented fresh): a wing is one MYMEM_HOME deployment, a room is a memory's kind (fact/decision/preference/todo -- already a first-class filterable field, not a new one), and a drawer is one memory record (one JSON file, as it's always been). This is a reframing, not a new hierarchy or file format.

Tools

  • mymem_get_context — start here. The bounded primary entry point: one objective, one token budget, one call. Returns core memory (always included), ranked recall results filling the rest of the budget, and a separate associated_memories field (things linked by experience, not by matching your query). Mirrors the get_ai_context pattern from the sibling mcp-space-dmc-rengine server, so it needs no new mental model if you're already used to that workflow.
  • mymem_remember — store one memory (fact, decision, preference, or todo), tagged with which agent and device recorded it.
  • mymem_recall — ranked search over current (non-superseded) memories: lexical/TF-IDF similarity combined with decay-adjusted salience, so relevant and fresh (or reinforced) memories rank highest. Not neural embeddings — a dependency-free, zero-cost lexical layer; see Design notes.
  • mymem_reinforce — explicitly confirm a memory is still relevant, raising its salience and resetting its decay clock.
  • mymem_list_recent — "what changed since I last looked," optionally scoped to one device.
  • mymem_recall_as_of — bi-temporal query: "what did we believe as of <date>," not just what's true now. Walks each memory's supersede chain to the version valid at that timestamp.
  • mymem_supersede — correct a memory without deleting it; the original stays retrievable, linked to its replacement, and its validity window closes.
  • mymem_pin / mymem_unpin / mymem_core_memory — a small, agent-curated, always-included memory tier (Letta/MemGPT-style "core memory blocks"), separate from queried recall. Call mymem_core_memory at the start of a task alongside mymem_recall for things that should never depend on guessing the right query wording.
  • mymem_associate / mymem_associations — a stable, experience-based link layer, distinct from decay/salience: association weight does not fade with time, it only moves when reinforced or weakened (asymptotically — diminishing returns, never quite reaching certainty or zero). This is deliberately a level above the other stores, not a peer of them: an edge can connect any two nodes -- a memory, a core memory block, or a tracked access record (from_type/to_type, default memory for backward compatibility) -- the way human associative memory links related things regardless of which kind of memory they are. mymem_get_context uses this automatically: memories retrieved together gently reinforce their link, and the top hit's strongest associations surface separately from direct query matches (only memory-typed neighbors, since that field's shape is specifically a memory record).
  • mymem_track_access — hippocampal-style consolidation: signal that something was read again. If ref is an existing mymem memory id, this reinforces it directly (same mechanism as mymem_reinforce, just triggered by access instead of an explicit call). If ref is anything else (a file path, a URL — whatever a hook names), it's tracked as a standalone access record with its own decay-adjusted salience. Meant to be wired into a client-side hook (e.g. a Claude Code PostToolUse hook on Read) so frequently-revisited context gets naturally "stickier" without a manual mymem_remember every time. mymem_get_context also does this automatically now for every memory it actually returns, not just the single top hit — repeated retrieval strengthens a memory the same way repeated study strengthens a real memory (Ebbinghaus forgetting curve, Wave 4 research).

Nothing durable is ever silently deleted. A correction always supersedes, never erases — core memory blocks are the one exception (mymem_unpin is a real delete), since they're working state, not durable facts.

Design notes

MyMeM's recall/decay/core-memory design is a deliberate synthesis, not invented from scratch — each piece is ported from an existing, researched system rather than reinvented:

  • Decay + reinforcement — tiered hot/warm/cold formula ported from OpenMemory (CaviraOSS)'s published approach.
  • Core memory blocks — pattern from Letta/MemGPT's self-editing core-context model.
  • Bi-temporal recall — pattern from Zep/Graphiti's "what was true as of when" fact-versioning.
  • Associative layer — a "waypoint graph" (OpenMemory's term) of short, weighted paths between memories, kept deliberately separate from time-based decay: an association is meant to behave like human associative memory, strengthening with repeated exposure and otherwise just sitting there, rather than fading on a clock.
  • TF-IDF similarity — a plain, zero-dependency lexical layer (no model download, no paid API), chosen deliberately over a real embedding model until usage shows the gap actually matters. Honest about its limits: it catches shared-vocabulary paraphrase, not deep semantic meaning.

Install & run

git clone https://github.com/VrUaCom/MyMeM.git
cd MyMeM
npm install
npm run build
node dist/index.js

By default memories are stored under ~/.mymem/memories/. Override with MYMEM_HOME.

Tests

npm test

Unit tests cover decay.ts, similarity.ts, store.ts, and associations.ts directly; test/mcp-server.test.ts drives the built server over real stdio MCP transport to cover the tool layer itself (budget-fitting in mymem_get_context, cross-tool wiring between recall/associate/get_context).

Add to an MCP client (e.g. Claude Code / Claude Desktop)

{
  "mcpServers": {
    "mymem": {
      "command": "node",
      "args": ["/absolute/path/to/MyMeM/dist/index.js"],
      "env": { "MYMEM_HOME": "/absolute/path/to/shared/synced/folder" }
    }
  }
}

Point MYMEM_HOME at a folder that's synced between your devices (a git-tracked folder, a cloud-drive folder, whatever you already use) and every MCP client that connects to MyMeM on any of those devices shares the same memory.

Optional: wire mymem_track_access into a hook

mymem_track_access is never called by MyMeM on its own -- nothing in this repo runs unattended. If you want repeated file reads to reinforce memory automatically, wire it into your own client's hook config. For Claude Code, a PostToolUse hook on Read calling the MCP tool with the read file's path as ref is enough; this is entirely opt-in and lives in your own settings, not in MyMeM.

Roadmap

  • Phase 0 — sync MYMEM_HOME between machines via a git remote living in an already-synced cloud-drive folder (no new infrastructure).
  • Phase 1 — the four base tools, file-backed, no database. (done)
  • Phase 2 — ship an AGENTS.md convention alongside MyMeM so even non-MCP tools get baseline shared context.
  • Phase 3 (advanced recall) — decay+reinforcement ranking, core memory blocks, bi-temporal recall, lightweight TF-IDF similarity, mymem_get_context as the bounded entry point, and an associative "waypoint graph" layer. (done, v0.4.0)
  • Phase 4 (hippocampal-style consolidation) — repeated access strengthens a memory (widened mymem_get_context reinforcement, mymem_track_access for hook-driven signals on arbitrary refs), the wing/room/drawer reframing, and a generalized associative layer that spans all node types (memory/core/access), not just memory-to-memory. (current — this repo, v0.6.0)
  • Phase 3.1 / 4.1 (future, explicitly deferred) — a real embedding-based semantic layer (evaluate only once TF-IDF's limits are actually felt); a standalone background daemon that watches file access the way real MemPalace's daemon hook does (a first-of-its-kind architecture change for this repo — needs its own design pass, not started); desktop notifications on auto-capture. None of these are started; mymem_track_access today is only ever called explicitly (by an agent or a hook the owner configured), never by an unattended MyMeM-internal process.

License

MIT — see LICENSE. MyMeM is meant to be embedded anywhere with zero friction, including inside other people's hosted tools.

About

MYMEM — a free, open-source memory layer over the Model Context Protocol (MCP) that lets any AI agent (Claude, Cursor, Codex, Windsurf...), on any device, read and write the same shared context instead of starting from zero every session.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages