Memex

io.github.evan-moon由 GitHub 帳號 evan-moon 發布v0.5.0更新於 Oct 24, 2026

Local-first second brain with semantic search. Markdown notes indexed by a local ML model.

已驗證STDIO僅桌面檔案與儲存知識與記憶

概覽

AI 產生的概覽

本機優先的 Markdown 筆記庫,具備離線語意搜尋,讓助理把筆記當成長期記憶來儲存、檢索、讀取與更新。

可以做什麼
  • 依 past、state、rule 三種層級儲存筆記,並提示重複筆記與相關的舊筆記
  • 以語意搜尋筆記,支援標籤、資料夾與日期篩選,並列出最近筆記、標籤與資料夾
  • 讀取筆記全文與反向連結,更新標題或內容,刪除筆記
  • 檢視確定性訊號與已歸納的推論,並提交經確認的推論
適用情境
適合希望助理跨工作階段記住你自己的決策、計畫與背景,不必每次貼進對話,且偏好把筆記以純 Markdown 檔案保存在本機的情境。
執行需求
以本機程序執行,從 npm 套件 @evan-moon/memex 安裝(需要 Node.js)。首次執行會下載約 450MB 的嵌入模型到 ~/.memex/models/。筆記與 SQLite 資料庫存放在 ~/.memex/ 下。不需要 API 金鑰或帳號。
安裝前請注意
助理可以寫入、更新與刪除你筆記庫中的筆記,rule 層筆記會在每次對話時注入其指令。可選的自動召回會把筆記標題當成上下文注入每個提示。可選重排序以 MEMEX_RERANK=1 開啟。資料留在本機,不會傳送給第三方。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Memex,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[memex]

memex

Make Claude smarter about you.

[npm version] [License] [Node version]

npm install -g @evan-moon/memex

Make Claude smarter about you.

Local-first second brain that connects to Claude via MCP. Notes are stored as plain Markdown and indexed with a local ML model, fully offline, no API keys, nothing leaves your machine.


The problem

Claude is only as smart as what's in the conversation. Your decisions, your context, your thinking, invisible unless you paste them in every time.

You:    What did we decide about the auth approach last sprint?Claude: I don't have context from previous conversations...

The fix

You:    What did we decide about the auth approach last sprint?
Claude: [memex · search_notes · "auth approach decision"]
        Found 2 notes:
        Auth Architecture Decision  Apr 14  #auth #backend        ─────────────────────────────────────────────────────        Chose JWT + refresh tokens over sessions. Rationale:        stateless design fits horizontal scaling plan.
        Based on your April 14th note: you went with JWT +        refresh tokens. Tom also flagged keeping auth decoupled        from payment logic, separate bounded contexts.

Claude searches your notes before answering and saves insights at the end of every conversation, automatically, without being asked.


Install

bash
npm install -g @evan-moon/memex

Connect your apps:

bash
memex mcp install

This registers memex with every MCP client on this machine — Claude, Claude Code, Codex, Cursor — by writing each one's own config file. Restart the clients afterwards.

That's it. On first run, the embedding model (~450MB) downloads once to ~/.memex/models/.

Auto-recall (optional)

bash
memex recall install

Turns retrieval from something Claude has to decide to do into something that just happens. Every prompt you type is semantically searched against your notes, and the top 3 titles are injected as context before Claude answers — the same way native memory works. Claude then pulls full notes with get_note when a title looks relevant.

A background daemon keeps the embedding model warm (~/.memex/recall.sock), so a lookup costs ~30ms instead of the ~1.5s a cold CLI search spends loading the model. It idles out after 2 hours.

Cost: ~200MB resident while warm, plus up to 3 note titles of context per prompt. Remove with memex recall uninstall.


Features

  • Semantic search, finds notes by meaning, not just keywords. Multilingual (Korean + English), runs fully offline via multilingual-e5-base
  • Hybrid retrieval, vector search + BM25 full-text + tag matching, fused via Reciprocal Rank Fusion
  • Chunk-level embeddings, long notes are split into ~340-token passages and embedded individually, so an answer buried on page three is as findable as one in the opening paragraph. Search returns the passage that matched, not the note's first lines
  • Cross-encoder reranking (opt-in, MEMEX_RERANK=1), retrieves twice as many candidates and reorders them with bge-reranker-v2-m3. Worth ~+20pp hit@1 on the golden set, at ~1.8s per search — off by default because auto-recall and the CLI are built around instant lookups
  • Date filter, narrow search to a time range with --from / --to
  • Note layers, every note is past (immutable record), state (mutable plan), or rule (Claude behaviour guide). Past notes refuse updates; rule notes auto-inject into Claude's system prompt
  • Flashback, save and search automatically surface older notes from a different folder that are semantically related, "you wrote about this 124 days ago in a different context"
  • Inference engine, deterministic signals surface un-synthesized patterns (cross-year arcs, stale state notes, tag revivals); you promote good ones into inferences (hypotheses with provenance) that auto-invalidate when their source notes change. No LLM in the core
  • MCP server, Claude searches and saves automatically. No extra CLAUDE.md setup needed
  • Auto-recall, opt-in hook that searches your notes on every prompt and injects the hits before Claude answers, so recall never depends on Claude remembering to look
  • Duplicate detection, save_note warns when a semantically similar note already exists, nudging Claude to update rather than create
  • Backlinks, link notes with [[Title]] syntax; get_note shows which notes reference it
  • Series collapse, a dated work log ("… 2026-07-20", "… 2026-07-23") takes at most two slots on a result page, and search reports how many more it held back
  • Amendments, a correction records what it corrects (amends), so search flags the superseded note and points at the newest fix instead of returning a claim you already know is wrong
  • Digest, memex digest summarises notes saved in the last N days, grouped by folder
  • CLI, add, search, tag, browse, and index notes from the terminal
  • Obsidian-compatible, notes saved as .md files; works alongside existing vaults
  • Local DB, SQLite + sqlite-vec at ~/.memex/memex.db

CLI

bash
# Add notesmemex add                                    # interactive prompt (asks for layer)memex add --title "Note title" --content "..." --layer pastmemex add --title "Note title" --file ./note.md --layer statememex add --title "Note title" --content "..." --folder work/people/tom --layer pastmemex add --title "Note title" --content "..." -T typescript -T architecture --layer past
# Layersmemex layer                               # distribution of past / state / rulememex layer <id> state                     # move a note to a different layer
# Searchmemex search "semantic search query"         # multilingualmemex search "knowledge management" --limit 10    # multilingual: matches Korean/Japanese notes toomemex search "query" --tag typescript        # filter by tagmemex search "query" --from 2026-04-01       # notes since a datememex search "query" --from 2026-04-01 --to 2026-04-30
# Browsememex list                                   # recent 10 notesmemex list --limit 20memex show <id>memex tags                                   # all tags with countsmemex related <id>                           # semantically related notesmemex digest                                 # last 7 days + signals + inferencesmemex digest --days 30                       # summary of last 30 days
# Insights (inference engine)memex signals                                # detect un-synthesized patternsmemex signals --type hidden_arc              # one type onlymemex signals dismiss <id>                   # triage (also: snooze)memex signals mint <signalId>                        # print evidence bundle to synthesizememex signals mint <signalId> --title "..." --summary "..." --confidence 0.7memex inferences                             # list inferences (auto-flags stale)memex schedule                               # print cron/launchd snippet (no daemon)
# Edit / deletememex edit <id>memex delete <id>memex delete --yes <id>                      # skip confirmation
# Index external directoriesmemex source add ~/Documents/My\ Notes       # register a vaultmemex source listmemex source remove ~/Documents/My\ Notesmemex index                                  # scan vault + all sourcesmemex index --force                          # re-index everythingmemex reembed                                # re-embed with current model
# Configmemex config showmemex config set vault-path ~/Documents/Second\ Brain
# MCPmemex mcp install                            # register with every MCP client on this machine
# Auto-recallmemex recall install                         # search notes on every prompt, inject hitsmemex recall uninstall                       # remove the hookmemex mcp path                               # print MCP binary path

MCP server

Claude, Claude Code, Codex, Cursor

bash
memex mcp install

It writes each client's own config file and leaves the servers already in it alone. If a client still runs an older copy of memex, it gets repointed. memex mcp path prints the server path for a client memex does not know about yet.

Available tools

ToolDescription
save_noteSave a note, requires layer, warns if a similar note already exists, surfaces flashbacks
search_notesSemantic search; supports category, tag, date_from, date_to filters; appends flashbacks for the top result
list_notesList recent notes
list_tagsList all tags with note counts
list_foldersList all folders with note counts
get_noteGet full content and backlinks of a note by ID
update_noteUpdate title or content. Refuses past notes (with [Amendment] suggestion) and rule notes (user-only)
delete_noteDelete a note by ID
get_signalsDeterministic un-synthesized patterns (hidden_arc / stale_state / dangling_link / tag_burst)
update_signal_statusTriage a signal, dismiss or snooze
list_inferencesList synthesized hypotheses (re-checks staleness first)
get_inferenceOne inference with full provenance + change/delete markers
mint_inferencePersist an approved hypothesis, requires explicit confirmation

Inferences are kept separate from notes (excluded from search) and are cited as hypotheses, never facts. Detection stays deterministic; the only LLM step is synthesizing an inference's summary, which Claude does, never memex.

Note layers

Every note is classified into one of three layers based on mutability:

LayerMeaningClaude's permission
pastRecord of what happened, retros, meetings, decision rationale, debugging sessionsAppend-only. update_note refuses, suggesting an [Amendment] note instead
stateCurrent state or plans, project progress, roadmaps, a person's current roleFreely updatable
ruleBehaviour guide for Claude, coding style, search policyClaude is read-only. Only the user writes

The CLI prints a colour-coded [past] / [state] / [rule] badge next to each note in list, search, and show.

  • save_note (MCP) and memex add (CLI) require an explicit layer. The classification rules are documented in the tool description so Claude picks correctly.
  • On first run, existing notes get a folder-based backfill: projects/dev/herald → state, coding → rule, everything else → past. Migration is idempotent.
  • rule notes are also auto-injected into the MCP server's instructions, see Rule layer auto-inject below.

Flashback

When you save a note or search, memex automatically surfaces older notes from a different folder that are semantically similar, "you wrote about this 124 days ago in a different context." Stored as system-generated backlinks (note_links.source = 'flashback'), separate from your [[wikilinks]] (source = 'wiki').

Tune via env:

EnvDefaultBehaviour
MEMEX_FLASHBACK_DAYS90minimum age gap, in days
MEMEX_FLASHBACK_DIST0.4maximum vector distance (lower = stricter match)
MEMEX_FLASHBACK_LIMIT3max suggestions per surface

Rule layer auto-inject

Notes with layer = 'rule' are appended to the MCP server's instructions on boot, under a ## House Rules section. Claude sees them at the start of every conversation, no search_notes call required. This is the right home for coding style guides or other behavioural guidance.

EnvDefaultBehaviour
MEMEX_INJECT_RULESenabledSet to 0 to disable injection entirely
MEMEX_RULES_MAX_CHARS8000Byte budget for the injected section; overflow is truncated with a console.warn

Updates to rule notes are picked up on the next Claude Desktop / Claude Code restart.


Configuration

Config lives at ~/.memex/config.json.

KeyDefaultDescription
vault_path~/Documents/Second BrainDirectory where .md files are saved
sources[]Additional directories to index (e.g. existing Obsidian vaults)
aliases{}Search alias map, e.g. { "js": ["javascript", "ecmascript"] }, values can be any language to bridge across scripts
bash
memex config set vault-path ~/my-vault

Architecture

~/.memex/  config.json, vault path, sources, and aliases  memex.db, SQLite DB (notes + note/chunk vec embeddings + FTS5 index)  models/, cached embedding model
<vault>/  *.md, notes (Obsidian-compatible)
PackageRole
@memex/dbSQLite schema, drizzle queries, sqlite-vec + FTS5 integration
@memex/embedLocal embedder via @huggingface/transformers
@memex/rerankLocal cross-encoder reranker (opt-in)
@memex/coreNote service shared by CLI and MCP: save, edit, search, vector indexing
@memex/utilsConfig, path helpers, shared utilities
@memex/mcpMCP server (bundled into CLI dist)

The ecosystem

memex is one of three local-first tools that share one principle, your data stays on your machine, and the AI comes to it. They interoperate through any MCP client, and none depends on the others.

mermaid
flowchart TB    U([You])    subgraph I["Interfaces, talk to your tools"]        direction LR        CD[Claude Desktop]        CC[Claude Code]        CU[Cursor]    end    subgraph T["Local-first tools, each owns its data, on your machine"]        direction LR        F["firma · money<br/>~/.firma"]        M["memex · memory<br/>~/.memex"]        S["skope · news<br/>~/.skope"]    end    U --> I    I -- MCP --> F & M & S    F <-. never call each other .-> M    M <-.-> S
  • firma · money, portfolio, net worth, cash flow
  • memex · memory, notes and the context behind them, across sessions
  • skope · news, a personalized lens on the world

You reach them through Claude Desktop, Claude Code, Cursor, or any other MCP client. The tools compose through the model, never by calling each other.


Where this is going

memex is a memory engine, not a place to read. There is no window, no editor, and no screen to keep up with. Everything a person would have supervised by hand — what is still true, what a later note corrected, which notes answer a question nobody phrased the way they were written — has to be settled by the retrieval path itself, at the moment an agent asks.

The reasoning behind dropping the desktop app: a document an LLM wrote is a document nobody reads. A vault that needs curating is a vault that rots. So the target is a structure that retrieves correctly without being read and without being maintained:

GoalStatus
Retrieval that answers the question, not the phrasing (hybrid + rerank + chunking)shipped
A correction reaching every surface that returns the note it correctedshipped
Signals and inferences that name what went stale, deterministicallyshipped
Layers and templates that make a note's lifetime explicit at write timeshipped
Staleness settled at read time rather than by a person clearing a queuein progress
Evidence (derives_from) required, so a claim can be rechecked without guessingin progress

Out of scope: a GUI, sync, collaboration, publishing, a plugin system, and a graph canvas.

The design record is in docs/plans/. Those documents are a history of decisions, not a roadmap, and the ones written for the desktop app have been removed.


llms.txt

llms.txt is a machine-readable summary of this project for LLM agents, concise description with documentation links, following the llms.txt standard.


License

MIT

來源:README.md,提交 19aae2c

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分