Skip to content

@moxxy/plugin-memory is moxxy's persistent memory layer. Each memory is one Markdown file with YAML frontmatter under ~/.moxxy/memory/, indexed by MEMORY.md. Short-term selectors fold the session's event log into context-friendly summaries.

Install

sh
pnpm add @moxxy/plugin-memory

Build

ts
import { buildMemoryPlugin } from '@moxxy/plugin-memory';

const { plugin, store } = buildMemoryPlugin({
  // dir: '~/.moxxy/memory'   (default)
  // embedder: openaiEmbedder  (optional: enables vector recall mode)
});
session.pluginHost.registerStatic(plugin);

Tools

ToolPermissionPurpose
memory_savepromptPersist a memory (name + type + description + body).
memory_recallautoSearch by free-text query. Modes: auto (TF-IDF, vector if available), vector, keyword.
memory_listautoNames + descriptions, no body.
memory_forgetpromptDelete by name.
memory_updatepromptUpdate in place (preserves createdAt).

Memory types

note, preference, fact, decision, lesson — drives folder placement and filtering.

Short-term helpers

  • recentExchanges(log, n) — last N user/assistant pairs.
  • summarizeSession(log) — coarse fold over the whole log.

Used by the compactor and the discovery skill.

Vector recall

Pair with an embedder plugin:

  • @moxxy/plugin-embeddings-openaitext-embedding-3-small/large.
  • @moxxy/plugin-embeddings-transformers — local CPU via @huggingface/transformers.

Both wrap automatically in @moxxy/sdk's CachedEmbeddingProvider (disk cache at ~/.moxxy/memory/.embeddings/).

Consolidation

planConsolidation(entries) proposes merges for overlapping memories. buildMemoryConsolidatePlugin(...) ships a periodic consolidation turn. See packages/plugin-memory/src/consolidate.ts.

See also

Open source · Self-hosted · Block-based