Back to Browse

Open Memex MCP Server

Developer ToolsModerate5.2MCP RegistryLocal
Free

Server data from the Official MCP Registry

Local-first memory for AI coding agents — Markdown + SQLite FTS5, shared across editors via MCP.

About

Local-first memory for AI coding agents — Markdown + SQLite FTS5, shared across editors via MCP.

Security Report

5.2
Moderate5.2Moderate Risk

open-memex is a local-first memory server that stores Markdown files and a SQLite index on the user's machine, and the reviewed code shows no exfiltration, hardcoded secrets, or shell injection. The main items are a postinstall script that was not provided for review and the truncated remainder of the codebase, including the MCP server and GitHub integration, which could not be fully audited. Permissions (local file I/O, SQLite, and git subprocesses) match the server's stated purpose. Supply chain analysis found 11 known vulnerabilities in dependencies (0 critical, 7 high severity). Package verification found 1 issue.

3 files analyzed · 15 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

File System Write

Writes or modifies files on your machine. Check that this is expected for the tool.

database

Check that this permission is expected for this type of plugin.

process_spawn

Check that this permission is expected for this type of plugin.

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "open-memex": {
      "command": "npx",
      "args": [
        "-y",
        "open-memex@0.10.0"
      ]
    }
  }
}

Some servers take additional arguments. See the repository for details.

Documentation

View on GitHub

From the project's GitHub README.

open-memex

Persistent memory for your AI coding agents — on your machine, in plain Markdown, shared by every tool you code with.

npm version License open-memex MCP server – quality and maintenance score on Glama

中文文档

Every AI coding session starts from zero: you re-explain the project, the agent rediscovers the same gotchas, and yesterday's decisions vanish when the chat ends. open-memex gives your agents a memory that survives the session. Say "remember: we deploy on Fridays" once, and next week Copilot, Cursor, opencode, or Claude Code already knows — because they all read and write the same local memory on your machine.

  • Free and open source (Apache-2.0). No account, no cloud, no telemetry — everything lives on your machine, in files you can open and edit.
  • Local-first: memories are plain Markdown files (the source of truth) with a rebuildable SQLite keyword index. Nothing leaves your machine unless you explicitly share it.
  • One memory, every agent: wire up several editors with one command; they share the same memory instead of keeping separate silos.
  • Precise synonym search: ship finds deploy, 单点登录 finds SSO — a curated multilingual map of equivalents is indexed with every memory at write time, so no related wording misses the right answer. Deterministic and auditable, no embedding model required.
  • A map, not just search: a derived knowledge graph connects your project memories — supersedes chains, shared tags, explicit mentions — and injects a compiled outline at session start, so the agent sees what's in memory without searching. Structural edges only, no LLM.

Terminal demo: two memories saved on Monday, recalled by search in a fresh session on Friday

New here? This README takes you from install to a working memory in about a minute. The concept guide explains the mental model in depth once you're up and running.

Contents

Quick start

You need Node.js ≥ 22.14 (check with node -v). Then:

npm install -g open-memex
open-memex init

init detects the editors you have installed (VS Code, Cursor, opencode, and Visual Studio when your project has a solution file) and connects each one to open-memex. Restart your editor afterwards.

See it work (30 seconds):

open-memex add "This project deploys on Fridays"

Now open a new chat in your editor and ask your agent: "When does this project deploy?" It already knows — no re-explaining. That round trip, capture once and recall forever, is the whole product. Everything below is detail.

Optional but recommended — check everything is wired up:

open-memex doctor

Core concepts

Four ideas explain almost everything open-memex does.

open-memex architecture: your editors share one local memory — Markdown files as the source of truth, an SQLite FTS5 index for search, personal scope that never leaves the machine, and project scope shared through git PRs

1. Two scopes: project and personal. Every memory belongs to one of two places:

  • project — knowledge about one codebase (decisions, constraints, lessons). Scoped to the current repo automatically; you never set this up by hand.
  • personal — knowledge about you (preferences, habits) that applies in every project. It lives only on this machine and can never be shared into a repo.

Facts about you ("I prefer concise diffs") go to personal; everything else defaults to the current project.

2. Capture → recall. Memories are saved as small Markdown files, one fact each. On the first turn of every new session, open-memex hands your agent the most relevant ones automatically, so it starts the session already knowing them. The agent can also search the full memory on demand. You never have to "load" anything yourself.

3. Your files, your rules. The Markdown files are the source of truth — open them, edit them, delete them, grep them. The SQLite index next to them is just a search accelerator and rebuilds from the files at any time (open-memex reindex). Team sharing, when you want it, goes through the same review flow as code: nothing is shared automatically (see Team workflow).

4. Knowledge stays current. Facts change: decisions get reversed, tools get replaced, yesterday's gotcha gets fixed. open-memex doesn't let the old version quietly linger — memory_supersede replaces a memory with its newer version and keeps the chain, so retrieval serves the current fact while the history stays auditable. Merely stale memories can be deprecated, and open-memex audit reports duplicates, stale entries, and broken chains. Pruning is a feature, not housekeeping: shared memory rots without it.

Which editors, which features

open-memex talks to editors two ways: a native opencode plugin, and a standard MCP server that any MCP-capable editor can use. (MCP — Model Context Protocol — is the open standard editors use to give agents extra tools; open-memex appears in your editor as a set of memory_* tools.) What you get depends on which path an editor uses:

EditorSetupToolsSession-start recallKeyword auto-capture
opencode (native plugin, recommended)open-memex init --client opencode --global6 core toolsBuilt in — first turn of every sessionYes — remember …, 记住…
VS Code (Copilot)open-memex init --client vscodeAll 12 via MCPVia MCP guidance*No — the agent saves when you ask
Cursoropen-memex init --client cursorAll 12 via MCPVia MCP guidance*No — the agent saves when you ask
Claude Codeclaude mcp add open-memex -- open-memex mcpAll 12 via MCPVia MCP guidance*No — the agent saves when you ask
Visual Studio 2022 17.14+ / 2026open-memex init --client visualstudioAll 12 via MCPVia MCP guidance*No — the agent saves when you ask
Codex and other MCP clientsopen-memex mcp --print-configAll 12 via MCPVia MCP guidance*No — the agent saves when you ask

* MCP has no hard session-start hook, so open-memex sends the agent guidance in the MCP handshake (including how many drafts are waiting) and init writes the fuller version into the editor's instruction files. In practice agents follow it; the opencode plugin is the only path with true built-in first-turn injection. The Tools section lists the 6 core tools and the 6 extra workflow tools, so the "6 vs 12" split is explicit.

All editors on the same machine read and write the same memory — a constraint captured in VS Code is respected in opencode; a lesson learned in Cursor shows up in Claude Code. (Different machines do not sync automatically; see the FAQ.)

init also installs an Agent Skill (a short instruction file that teaches skill-aware agents to use the CLI) for VS Code and Cursor, and for opencode in per-project MCP mode. With the opencode native plugin wired, no skill is installed there — the plugin already provides the memory tools, and a second instruction set only made agents chatty.

How it compares

open-memexInstruction files (CLAUDE.md, AGENTS.md, …)Cloud memory servicesChat history
Where it livesYour machine + your reposIn the repoVendor serversGone when the chat ends
Who maintains itCaptured as you work; you reviewYou write and update by handThe service—
When facts changeSuperseded, not silently stale — retrieval serves the current version, chain preservedYou hand-edit; stale copies lingerVaries; often silently stale—
Works across AI toolsYes — any MCP client (same machine)One file per tool conventionPer-integrationNo
Review before sharingYes — outbox + pull requestYes — it's just filesVariesNo
Human-readablePlain Markdown filesYesDashboard / APINo

Instruction files are great for a handful of standing rules — keep using them (open-memex can even draft one from your memories; see distill-agents below). open-memex covers the growing pile of decisions, lessons, and preferences that no one remembers to write down.

Installation

Requirements

  • Node.js ≥ 22.14 (open-memex doctor verifies this for you). The floor is the SQLite driver's: better-sqlite3 13 is built against Node-API 10, which Node gained in 22.14.0 — older Node segfaults on the first database open.

Install the CLI

npm install -g open-memex

That's the stable release. Installing the package may print a reminder to run open-memex init — the editor wiring is a separate step (see Setting up your editor), so don't worry if you don't see the reminder; just run init next.

Two alternatives:

  • No install — run via npx: npx -y open-memex <command> runs any command without installing (e.g. npx -y open-memex init --client vscode). Slower to start, nothing to uninstall.
  • Alpha builds (newest features, rougher edges, for testers): npm install -g open-memex@alpha. Check what's published with npm view open-memex version (stable) and npm view open-memex@alpha version (alpha).

If open-memex isn't found after installing, your PATH needs attention — see Troubleshooting.

From source (for contributors)

git clone -b main https://github.com/stoneskin/open-memex.git
cd open-memex
npm install
node --experimental-strip-types src/cli.ts <command>

Setting up your editor

Run init from your project root (the top folder of the repo you're working in) so the project scope resolves to that repo:

open-memex init --yes
# …or without installing the package first:
npx -y open-memex init --yes

--yes accepts the recommended defaults for everything init asks about (editors to wire, auto-capture, first-turn recall). Leave it off if you want to answer each question. With no --client, init detects your installed editors and wires them all — one init covers every project. Prefer a single editor? Pass --client:

VS Code (Copilot):

open-memex init --client vscode

Writes the MCP server entry; reload the window afterwards and confirm the open-memex server is started in Copilot Chat's MCP panel. By default this writes a project-level .vscode/mcp.json (an interactive run asks which level you want); add --global for VS Code's user-level config instead — one setup that works in every project.

Cursor:

open-memex init --client cursor

Same shape as VS Code: project-level .cursor/mcp.json by default, user-level MCP config with --global, plus Copilot-style instructions.

opencode (native plugin — recommended):

open-memex init --client opencode --global --yes

Merges the native plugin into your user-level ~/.config/opencode/opencode.json (or opencode.jsonc if that's the file you already have) — one-time, every project picks it up, no per-project init. You get the 6 core tools, keyword auto-capture, and first-turn context injection. (A config file with comments is left untouched — init prints the line to add by hand.)

Both opencode generations are supported from the same install: init writes the opencode 1 spelling ("plugin") and the opencode 2 spelling ("plugins") — each host reads its own key. Opencode 1 needs version 1.18.29 or newer for this. open-memex doctor tells you if the wiring and the installed host version don't match.

opencode (as a plain MCP consumer):

open-memex init --client opencode

Writes a project-level opencode.jsonc with the MCP server. Only needed if you prefer plain MCP over the native plugin — you give up keyword capture and built-in injection.

Claude Code (from your project root):

claude mcp add open-memex -- open-memex mcp
# …or print the config snippet: open-memex mcp --print-config claude

Visual Studio (from your solution directory):

open-memex init --client visualstudio

Writes solution-level .mcp.json. Requires Visual Studio 2022 17.14+ or Visual Studio 2026 (Windows-only). Visual Studio also auto-discovers .vscode/mcp.json and .cursor/mcp.json, so the VS Code setup above works too.

Codex: no init client yet — add the server manually via open-memex mcp --print-config as a starting point ([mcp_servers] in config.toml, or codex mcp add).

One-time setup for all projects (VS Code / Cursor)

open-memex init --client vscode --global --yes

Two different "globals" — don't mix them up.

  • npm install -g open-memex installs the package globally: it puts the open-memex command on your PATH.
  • init --global writes the editor config at user level instead of the project: init once, the wiring works in every project. It works the same whether the package was installed globally or run via npx.

The --global form writes the server entry to the editor's user-level MCP config (%APPDATA%\Code\User\mcp.json on Windows, ~/Library/Application Support/Code/User/mcp.json on macOS, ~/.config/Code/User/mcp.json on Linux; ~/.cursor/mcp.json for Cursor) instead of the project — init once, the server starts in every project. A per-project .vscode/mcp.json still wins if a project defines its own. If the user-level file has comments in it (editors accept JSONC), init leaves the file untouched and prints the exact snippet to paste in by hand.

init behavior notes

  • Existing config files are merged, never overwritten — re-running init is safe. --force rewrites our entries.
  • With no durable open-memex on PATH (e.g. one-shot npx), init writes an npx -y open-memex mcp server command into the config so the setup keeps working. npm i -g open-memex + open-memex init --force switches to the faster direct command later.
  • On an interactive terminal, init shows the detected editors and asks you to confirm; scripts and CI never prompt and wire every detected editor.
  • If you run bare open-memex on a machine where init never completed, it offers to run it for you (interactive terminals only).

Remove the wiring

open-memex uninstall --yes

Reverses init — removes the MCP server entry, the opencode plugin line, the Agent Skill, and the open-memex section of the editor instructions. With no --client it cleans up every detected editor; --global limits the cleanup to user-level wiring. Your memories are never touched.

What init changes on your machine

Everything init writes, in one place:

  • Memory data (created on first use, not by init itself): %APPDATA%\open-memex\ on Windows, ~/.local/share/open-memex/ on macOS/Linux — your memory files and the search index. Nothing here is ever modified by uninstall.
  • Editor wiring (removed by open-memex uninstall):
    • opencode: a "plugin" entry (opencode 1) and a "plugins" entry (opencode 2) merged into ~/.config/opencode/opencode.json (or .jsonc). Stale my-o-memory entries from before the rename are removed at the same time.
    • VS Code / Cursor: an open-memex server entry in the user-level or project-level MCP config, plus an open-memex section in the Copilot instructions (user-level ~/.copilot/copilot-instructions.md by default; --instructions project writes .github/copilot-instructions.md in the repo instead, for teams where everyone uses open-memex).
    • Visual Studio: .mcp.json next to your solution.
    • Agent Skill: a skills/open-memex/ folder for VS Code (~/.copilot/skills/), Cursor (~/.cursor/skills/), or opencode in per-project MCP mode (~/.config/opencode/skills/).
  • Your repo: nothing. Files only appear in a repo when you explicitly run submit (see Team workflow) — a local commit, never an automatic push.

Files with comments (JSONC) are never rewritten: init prints the exact snippet to paste instead.

Capture: how memories get saved

Three ways memories get in:

  • Keyword triggers (opencode native plugin only): say remember …, note that …, don't forget: …, TIL …, save this … — or in Chinese 记住… / 记一下… / 记录一下… / 别忘了:… — and the sentence is captured without any tool call. Captures land in the current project by default; phrases that signal "this is about me" — remember for me …, help me remember: …, 记住我…, 替我记…, 帮我记…, 我觉得…, 我喜欢… — go to personal instead, and team-context phrases (我们决定…, 帮我们记住…) stay in project. Two rules keep the noise down (D67): a trigger must be a statement to the store, so the narration forms 记得… / remind me to… / 别忘了带伞 / don't forget the wifi password never fire (add a separator — 别忘了:…, don't forget: … — or that to make it an instruction); and a captured body under 3 characters is rejected as a fragment rather than saved — capture --dry-run says so instead of dropping it silently. A trigger also owns its own sentence: the plugin tells the agent what it just stored, and a memory_add that re-saves the same words within the next few minutes is refused with the stored id (D73) — one thing you said is one memory, not three copies of it. A keyword match over the 2000-character hard cap is dropped, never truncated into a memory — the agent is told in its session context (D94) and can re-save a shortened version.
  • The agent saves it: in any editor, ask your agent to remember something (or it saves on its own when you state a fact worth keeping) — it calls memory_add. The routing above is a heuristic; you can always say "save this to my personal memory" or use the CLI with --scope to be explicit. Long bodies are never refused: over 500 characters the save proceeds and the result just carries a soft hint that shorter, self-contained statements retrieve better (D94).
  • Checkpoint proposals: when a task wraps up, the agent proposes 1–3 short candidate memories distilled from the session — decisions and their reasons, conventions, gotchas, approaches tried and abandoned — and saves only the ones you approve. Nothing is written silently: no draft is created behind your back.
  • The CLI: open-memex add "…" with optional --scope / --tag / --type / --aliases.

Aliases. Each saved memory can carry up to 4 alternate phrasings (synonyms, another language's equivalent) that are indexed with it, so a question worded differently still finds the memory — "vacation days" finds the holiday policy. Always on — the agent may attach up to 4 per memory, and you can pass your own via open-memex add --aliases.

Three ways to add them: open-memex add "text" --aliases "phrase one; phrase two" (semicolon-separated, up to 4); ask the agent ("remember: Fluffy is my AI agent, alias it as Momo"); or edit the memory's aliases: frontmatter directly — Markdown is the source of truth and sync picks it up.

Separately, a curated synonym/translation map is expanded into the index automatically at write time (D80) — ship finds deploy even with no aliases on the memory. Personal nicknames belong in aliases; shared dev-domain vocabulary belongs in the curated map. See Retrieval: how memories come back.

Redaction. Wrap anything sensitive in <private>…</private> and it is stripped before saving. Recognized secrets (API keys, tokens, high-entropy credentials) are masked in place — the first 4 characters are kept so you can tell which key it was, the rest is replaced — and the memory is still saved. Preview exactly what a message would capture, safely, any time:

open-memex capture --dry-run "…"

If a secret slips through anyway, open-memex forget <id> deletes the memory.

Tools the agent gets

The MCP server exposes thirteen tools; the opencode native plugin exposes the seven core ones (marked ●). The other six are the team-review workflow tools — they only matter once you share memories through Git.

ToolWhat it does
● memory_addSave a fact, preference, decision, note
● memory_searchKeyword search (BM25) across project + personal memories
● memory_listList memories in a scope (project, personal, or both) as a numbered inventory; include=all is the audit view
● memory_supersedeReplace a memory with a newer version (keeps a supersede chain)
● memory_forgetDelete a memory by id (soft=true hides it instead — retracted, one-way)
● memory_workingstateRead/write/clear the per-project working-state note (§3.6, D89) — resumes an interrupted task; scratch state, never a memory
● memory_usefulMark a memory as useful (D77) — explicit confirmation only; exposure is counted separately as retrieved_count
memory_statusShow the sync queue (outbox drafts, repo review states, uncommitted files) plus the D77 reuse report
memory_submitCurate deterministic fixes, then move named drafts into the repo memory dir (local branch + commit)
memory_proposeCopy personal memories into the project scope as review candidates
memory_promoteAdvance proposed → approved → published (or reject / resubmit)
memory_resolveList conflicted memory files / 3-way-merge one of them
memory_pr_statusMap the branch PR's GitHub state onto each memory's review state

So an MCP-connected editor always has the full set; opencode's plugin covers capture and recall, and anything workflow-shaped goes through the CLI or an MCP-connected editor.

Usefulness is measured by reuse, not storage (D77). Every memory carries local counters: retrieved_count — how often it was actually handed to the agent (search results, lists, the session-start injection) — and useful counts, split into useful_self (personal memories, unpublished project drafts) and useful_team (approved/published project memories). Only explicit signals raise the useful side: memory_useful when a person confirms it paid off, a human approval at review, or a supersede. Passive exposure never counts as useful — a memory that merely showed up in results has shown nothing yet. Same-side CLI surface: open-memex useful <id...>. Counters live in the local SQLite index only (never in the Markdown files, never off this machine). The report rides memory_status (and open-memex sync-status): per-scope retrieved/useful rates with the self/team split shown separately, the most-reused memories, and the "zombies" — retrieved but never confirmed useful, i.e. the decay/prune candidates (D77-L3). Superseded/deprecated entries stay visible as reuse history but carry a lifecycle tag, never presented as current guidance.

Memory types

Every memory has a type (what it is) and tags (what it's about). Eleven types are built in:

TypeCaptures
factA stable true statement about the project or world
preferenceHow someone likes things done
decisionA choice that was made — the why and the trade-off
constraintA rule that must not be violated
todoA commitment to do something later
knowledgeDurable domain or architecture knowledge
howtoA procedure that worked
gotchaA trap to avoid
lessonWhat an incident or mistake taught us
observationSomething noticed, not yet a conclusion
referenceA pointer to the authoritative doc (no copying)

--type accepts any string, but sticking to the built-in set keeps session-start labels, search, and distill-agents output predictable.

Team workflow: sharing memories through Git

Working solo? You can skip this section — everything above is the whole product for one person. Nothing below ever happens automatically.

Personal notes stay private. Project knowledge, when you choose to share it, follows an explicit, reviewable pipeline shaped like code review:

capture → outbox (draft, local) → submit → repo (.ai/open-memex/) → PR review → published → recall
  1. Capture — save decisions, gotchas, lessons as drafts during normal work.
  2. Review — drafts wait in a local outbox (on your machine, invisible to git); open-memex sync-status — or just saying "sync memory" in chat — shows what's pending.
  3. Submit — you name the memories; they move into <repo>/.ai/open-memex/ with a local commit on your current branch. Before copying, submit prints a report-only graph lint and auto-applies only deterministic cleanup: exact duplicates are merged through the supersede chain, empty bodies are archived, and ragged first-line titles are normalized. Near-duplicates stay report-only; semantic merge/split needs a human. Every change prints its undo command, and --no-curate skips the cleanup while keeping the lint report. open-memex never pushes on its own; it prints the push + PR commands, and an agent holding your explicit yes can carry them out.
  4. PR review — memories are plain Markdown; reviewers approve, request changes, or reject through the normal branch/PR process.
  5. Recall — published memories are injected at session start and searchable on demand, for humans and agents alike.

Whoever tends the shared memory follows the curator convention: what to approve, what to send back, and the hygiene rules that keep shared memory from rotting.

Retrieval: how memories come back

On the first turn of every session, open-memex injects an [OPEN-MEMEX] block into the agent's context with the most recent project memories (default: top 8) and your personal preferences (default: top 5). It looks like this:

[OPEN-MEMEX]

User profile / preferences:
- I prefer concise diffs

Project knowledge (my-repo):
- [decision] We deploy on Fridays; the release train leaves at 10:00

Use the `memory_search` tool to look up more. Use `memory_add` to save new facts.
Do not mention this block to the user unless asked.

It's a snapshot, not the whole memory — the agent can call memory_search any time for the rest. Both top-N counts are configurable (see Config). For MCP clients this block is delivered as handshake guidance the agent follows; the opencode plugin injects it directly on the first turn.

The session-start ritual (wake)

open-memex sessions start from what is already in context, not from questions:

  1. Read the [OPEN-MEMEX] block injected at session start (opencode) — or the equivalent guidance in the MCP handshake instructions. It carries the top project memories, your preferences, the working-state note from a previous session (if any), and the compiled memory map.
  2. If the block is empty or doesn't cover the current task, call memory_search once with the task's keywords (try 2–3 phrasings, both scopes) before concluding anything is missing.
  3. Don't ask the user to re-explain what memory already holds — repeated "didn't we decide X?" questions are the failure mode open-memex exists to prevent. Ask only about what neither the block nor search can answer.

The block is injected once per session, not once per turn — mid-session, open-memex adds nothing to the context unless a tool is called. The same ritual is written into the bundled open-memex Agent Skill and the MCP handshake instructions, so an agent that reads only one of the three still behaves the same way.

What this costs in context (tokens)

Measured, not asserted (D94, inspired by OptMem's published "426-token prompt"). On the checked-in fixture in scripts/token-cost.ts — 8 project memories + 5 personal + the compiled graph outline, default config — with tokens estimated as characters ÷ 4 (the rough ratio for English prose; a deliberately tokenizer-free method, no new dependency):

SurfaceCharacters≈ TokensWhen
Session-start injection block2,125~530once per session (not per turn)
All 13 MCP tool descriptions8,814~2,200once per session, at the MCP handshake
Total10,939~2,700

These are approximations and they move with your memory sizes and config — re-run node --experimental-strip-types scripts/token-cost.ts to measure your own numbers and to regenerate the fixture's. (The script's output and this table must agree; update both together, never by hand.)

Retrieval evaluation

We measure recall on a checked-in synthetic fixture instead of asserting it: 60 memories + 47 queries (exact terms, paraphrases, synonyms, Chinese, cross-language hard cases, synonym-only queries, D81 user-defined alias queries, and a D79 reuse-signal slice) — reproduce with node --experimental-strip-types scripts/retrieval-eval.ts. Current baseline, with index-time synonym/translation expansion (D80) and query-time user alias expansion (D81), feedback weighting off by default: recall@1 0.66, recall@5 0.98, MRR 0.80. Small synthetic corpus, so read it as a regression guard and a starting point, not a real-world claim.

Optional feedback weighting (D79, first slice, off by default) breaks near-ties among BM25 hits using the D77 reuse counters: a memory with at least 3 recorded retrievals and a higher reuse_rate moves ahead inside the same 25%-score band. It never edits the BM25 score, never crosses a review tier, never reorders hits with too little telemetry (new memories keep their exact BM25 slot), and usefulness still comes only from explicit signals — passive retrieval exposure never counts. Enable with open-memex config set feedbackWeighting true; search --explain shows every promotion.

Three layers, each covering what the others miss: BM25 keyword search (SQLite FTS5 — exact words, fast, explainable via search --explain); synonym expansion in two halves — (a) index-time (D80: a curated, checked-in map of dev-domain equivalents and EN↔ZH translation pairs expanded into the index at write time, so ship finds deploy and bug finds defect in a plain single-round query; deterministic, no model download); (b) query-time user aliases (D81: an alias memory carrying alias:/target: frontmatter defines your vocabulary once per scope — e.g. Banana Plan → payment system refactor project — and a query mentioning either side triggers a second round on the other side, both directions, merged evenly with round one so alias hits are never down-weighted; no reindex when the alias changes); and semantic vectors as an opt-in experiment (local multilingual embeddings measured at R@5 92.7% on the cross-lingual fixture slice — see docs/retrieval-ablation-study.md §4.7; no embedding model is ever downloaded without your explicit opt-in).

External check on public data: the same pipeline scores recall@5 97.0% / MRR 0.909 on LongMemEval-S (470 questions, retrieval stage only — no answer generation, no judge model; this is not the official LongMemEval score). For reference, agentmemory's published numbers on the same protocol are 86.2% / 0.715 (BM25-only) and 95.2% / 0.882 (BM25+vector). A 22k-memory pooled stress run drops recall@5 to 40.6% — the lexical ceiling, measured rather than asserted. Reproduce with node --experimental-strip-types scripts/bench-longmemeval.ts --data <path> (dataset: xiaowu0162/longmemeval-cleaned, MIT).

Security & data

  • Local-first: everything lives on your machine (%APPDATA%\open-memex on Windows, ~/.local/share/open-memex on macOS/Linux) plus the repos you choose. Zero cloud calls, zero accounts, zero third-party APIs, zero telemetry.
  • Secrets stay out: <private>…</private> spans are stripped; detected API keys/tokens are masked in place before saving. Preview with open-memex capture --dry-run "…".
  • Personal never syncs: the personal scope is this machine only — excluded from export by default and can never enter a repo.
  • Auditable sharing: team memories move only by explicit submit, travel through branch/PR review, and every promote transition is appended to the memory's review_history (who / when / why).
  • You own the files: Markdown is the source of truth — inspect, edit, or delete anything by hand; the SQLite index rebuilds from the files.

Limitations

Honest edges, so nothing surprises you:

  • Keyword search, not semantic. Retrieval is BM25 keyword matching, plus a curated synonym map expanded into the index at write time (ship finds deploy, bug finds defect). Paraphrases outside the curated map don't match — that's what the opt-in semantic layer is for. (Plain questions are fine — "how do we…" / "请问…" wording is filtered out before matching, so asking naturally doesn't dilute the results.) No embedding model is ever downloaded without your explicit opt-in. (Synonym expansions live in their own index column, separate from your own aliases — but a query matching only via an expansion can still rank below direct matches; that's inherent BM25 length-norm behaviour, not a bug.)
  • One machine. Editors on the same machine share memory; there is no cross-machine sync. export / import bundles (below) move memory between machines manually.
  • A snapshot, not everything. Session-start recall is a top-N snapshot (8 project + 5 personal by default); older memories are one memory_search away, but they are not all in context at once.
  • MCP guidance is advisory. Outside opencode, proactive capture and recall depend on the agent following the handshake instructions — there is no hard session-start hook in MCP. The tools themselves always work when called.
  • Capture routing is a heuristic. Personal-signal phrases (remember for me …, 我喜欢…) go to personal; everything else defaults to the current project. When it guesses wrong, say the scope out loud or use --scope in the CLI.

Upgrading

npm install -g open-memex@latest   # or @alpha

Your editor configs point at the installed open-memex command, so upgrades need no re-wiring. After a major upgrade, run open-memex init --force once to refresh the installed Agent Skill and instruction files with the latest wording. If you installed from source or moved the package, --force also re-points the opencode plugin path.

What changed in each version: see the CHANGELOG.

Storage layout

%APPDATA%\open-memex\               (Windows)
~/.local/share/open-memex/          (macOS/Linux; $XDG_DATA_HOME if set)
├── index.db                         # SQLite FTS5 index (rebuildable)
└── memories/
    ├── personal/
    │   └── <id>.md
    └── project__<name>__<hash12>/
        └── <id>.md

Each .md file is one memory: YAML frontmatter (id, scope, type, tags, created_at, schema_version, …) followed by the content. You can edit them by hand — the index re-syncs from the files, and Markdown is always the source of truth (open-memex reindex rebuilds the index from scratch).

Once you submit, project memories also live as Markdown files under <repo>/.ai/open-memex/ (configurable via memoryDir), where they travel with branches and PRs like any other file.

Config

Settings live in ~/.config/opencode/open-memex.jsonc — the opencode in the path is historical; this one file is shared by every client. Override the config path with OPEN_MEMEX_CONFIG and the storage root with OPEN_MEMEX_HOME (the pre-rename MY_O_MEMORY_CONFIG / MY_O_MEMORY_HOME names are still honored as fallbacks).

Defaults:

{
  "maxProjectMemories": 8,    // top-N project memories injected on first turn
  "maxProfileItems": 5,       // top-N personal items injected on first turn
  "injectOnFirstTurn": true,  // [OPEN-MEMEX] system-prompt block
  "keywordCaptureEnabled": true,
  "logLevel": "info",          // info | debug
  "graphOutline": true,        // inject the compiled graph outline at session start
  "graphOutlineLines": 10,     // outline length cap (max 30)
  "feedbackWeighting": false,  // D79: reorder near-tied hits by reuse_rate (opt-in)
  "memoryDir": ".ai/open-memex" // in-repo project-memory dir, relative to repo root
}

open-memex config prints the effective config (defaults + file). Change a setting after install:

open-memex config set keywordCaptureEnabled false
open-memex config set maxProjectMemories 12
open-memex config set sync.autoPull true   # best-effort pull at MCP session start
open-memex config set graphOutline false   # stop injecting the graph outline
open-memex config set feedbackWeighting true  # D79: let reuse signal break near-ties

Settable keys: maxProjectMemories, maxProfileItems, injectOnFirstTurn, keywordCaptureEnabled, captureAliases, logLevel, memoryDir, graphOutline, graphOutlineLines, feedbackWeighting, and sync.autoPull (a dotted key that writes into the nested sync object). Full design: docs/V2-DESIGN.md.

CLI reference

Setup & health:

open-memex init [--client vscode|cursor|opencode|visualstudio]
              [--instructions personal|project] [--global] [--force] [--yes]
open-memex uninstall [--client vscode|cursor|opencode|visualstudio] [--global] [--yes]
open-memex config                                  # print effective config
open-memex config set <key> <value>                # change a setting
open-memex doctor                                  # environment health check (incl. plugin entry)
open-memex audit                                   # memory health check (duplicates, stale, broken chains)
open-memex capture --dry-run "remember that I like concise answers"  # preview keyword capture
open-memex mcp --print-config vscode|cursor|claude|opencode|visualstudio
open-memex --help      # this reference
open-memex <command> --help  # help for one command
open-memex --version   # installed version

Memory operations:

Documentation truncated — see the full README on GitHub.

Reviews

No reviews yet

Be the first to review this server!