memex
让 Claude 更懂你。
本地优先的第二大脑,通过 MCP 连接 Claude。笔记以纯 Markdown 存储,并用本地 ML 模型建立索引,完全离线运行,无需 API 密钥,数据不会离开你的设备。
问题
Claude 的智能程度取决于对话中已有的内容。你的决策、你的背景、你的思考,除非你每次都手动粘贴进去,否则对 Claude 来说都是不可见的。
You: What did we decide about the auth approach last sprint?
Claude: I don't have context from previous conversations...Related MCP server: Memsolus MCP Server
解决方案
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 会在回答前搜索你的笔记,并在每次对话结束时自动保存洞察,无需任何提示。
安装
npm install -g @evan-moon/memex连接到 Claude Code:
memex mcp install这会将 memex 同时注册到 Claude Code 和 Codex。安装后请重启客户端。如需手动注册任一客户端:
claude mcp add memex -- node "$(memex mcp path)"
codex mcp add memex -- node "$(memex mcp path)"就这样。首次运行时,嵌入模型(约 450MB)会下载一次到 ~/.memex/models/。
自动召回(可选)
memex recall install将检索从 Claude 必须决定去做的事情,变成自然而然发生的事情。你输入的每一条提示都会与你的笔记进行语义搜索,排名前 3 的标题会在 Claude 回答之前作为上下文注入——就像原生记忆一样工作。当某个标题看起来相关时,Claude 会通过 get_note 拉取完整笔记。
一个后台守护进程保持嵌入模型常驻(~/.memex/recall.sock),因此一次查找只需约 30ms,而不是冷启动 CLI 搜索加载模型所需的约 1.5s。空闲 2 小时后会自动退出。
代价:常驻时约 200MB 内存,加上每条提示最多 3 个笔记标题的上下文。使用 memex recall uninstall 移除。
功能特性
语义搜索,按含义而非仅关键词查找笔记。支持多语言(韩语 + 英语),通过
multilingual-e5-base完全离线运行混合检索,向量搜索 + BM25 全文 + 标签匹配,通过 Reciprocal Rank Fusion 融合
分块级嵌入,长笔记会被拆分为约 340 token 的段落并分别嵌入,因此埋藏在第三页的答案与开头段落中的答案一样容易被找到。搜索返回的是匹配的段落,而非笔记的开头几行
交叉编码器重排序(可选,
MEMEX_RERANK=1),检索两倍的候选结果,并用bge-reranker-v2-m3重新排序。在黄金测试集上可提升约 +20pp 的 hit@1,但每次搜索约需 1.8s——默认关闭,因为自动召回和 CLI 都是围绕即时查找设计的日期过滤,使用
--from/--to将搜索范围缩小到指定时间段笔记分层,每条笔记要么是
past(不可变记录)、state(可变计划),要么是rule(Claude 行为指南)。past笔记拒绝更新;rule笔记会自动注入 Claude 的系统提示闪回,保存和搜索时自动浮现来自不同文件夹的、语义相关的旧笔记,"你在 124 天前在不同的上下文中写过这个"
推理引擎,确定性的信号会浮现未综合的模式(跨年脉络、过期的 state 笔记、标签复兴);你可以将好的信号提升为推理(带有来源的假设),当源笔记发生变化时推理会自动失效。核心不涉及 LLM
MCP 服务器,Claude 自动搜索和保存。无需额外配置 CLAUDE.md
自动召回,可选的钩子,在每条提示时搜索你的笔记并在 Claude 回答前注入命中结果,因此召回从不依赖 Claude 记得去查找
重复检测,
save_note在已存在语义相似的笔记时发出警告,引导 Claude 更新而非新建反向链接,使用
[[Title]]语法链接笔记;get_note会显示哪些笔记引用了它系列折叠,带日期的日志("… 2026-07-20"、"… 2026-07-23")在结果页面上最多占两个位置,搜索会报告还隐藏了多少条
修正,一条修正记录会标明它修正了什么(
amends),因此搜索会标记被取代的笔记并指向最新的修正,而不是返回一个你已知是错误的结论摘要,
memex digest按文件夹汇总最近 N 天保存的笔记CLI,在终端中添加、搜索、打标签、浏览和索引笔记
兼容 Obsidian,笔记以
.md文件保存;可与现有 vault 并行使用本地数据库,SQLite +
sqlite-vec,位于~/.memex/memex.db
CLI
# Add notes
memex add # interactive prompt (asks for layer)
memex add --title "Note title" --content "..." --layer past
memex add --title "Note title" --file ./note.md --layer state
memex add --title "Note title" --content "..." --folder work/people/tom --layer past
memex add --title "Note title" --content "..." -T typescript -T architecture --layer past
# Layers
memex layer # distribution of past / state / rule
memex layer <id> state # move a note to a different layer
# Search
memex search "semantic search query" # multilingual
memex search "knowledge management" --limit 10 # multilingual: matches Korean/Japanese notes too
memex search "query" --tag typescript # filter by tag
memex search "query" --from 2026-04-01 # notes since a date
memex search "query" --from 2026-04-01 --to 2026-04-30
# Browse
memex list # recent 10 notes
memex list --limit 20
memex show <id>
memex tags # all tags with counts
memex related <id> # semantically related notes
memex digest # last 7 days + signals + inferences
memex digest --days 30 # summary of last 30 days
# Insights (inference engine)
memex signals # detect un-synthesized patterns
memex signals --type hidden_arc # one type only
memex signals dismiss <id> # triage (also: snooze)
memex signals mint <signalId> # print evidence bundle to synthesize
memex signals mint <signalId> --title "..." --summary "..." --confidence 0.7
memex inferences # list inferences (auto-flags stale)
memex schedule # print cron/launchd snippet (no daemon)
# Edit / delete
memex edit <id>
memex delete <id>
memex delete --yes <id> # skip confirmation
# Index external directories
memex source add ~/Documents/My\ Notes # register a vault
memex source list
memex source remove ~/Documents/My\ Notes
memex index # scan vault + all sources
memex index --force # re-index everything
memex reembed # re-embed with current model
# Config
memex config show
memex config set vault-path ~/Documents/Second\ Brain
# MCP
memex mcp install # register with Claude Code and Codex
# Auto-recall
memex recall install # search notes on every prompt, inject hits
memex recall uninstall # remove the hook
memex mcp path # print MCP binary pathMCP 服务器
Claude Code 和 Codex
memex mcp install或为 Claude Code 手动配置:
claude mcp add memex -- node "$(memex mcp path)"为 Codex 配置:
codex mcp add memex -- node "$(memex mcp path)"Claude Desktop
添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"memex": {
"command": "node",
"args": ["<path from `memex mcp path`>"]
}
}
}可用工具
工具 | 描述 |
| 保存笔记,需要 |
| 语义搜索;支持 |
| 列出最近的笔记 |
| 列出所有标签及笔记数量 |
| 列出所有文件夹及笔记数量 |
| 按 ID 获取笔记的完整内容和反向链接 |
| 更新标题或内容。拒绝更新 |
| 按 ID 删除笔记 |
| 确定性的未综合模式(hidden_arc / stale_state / dangling_link / tag_burst) |
| 对信号进行分类处理,忽略或稍后提醒 |
| 列出综合出的假设(先重新检查过期状态) |
| 单个推理的完整来源 + 变更/删除标记 |
| 持久化已批准的假设,需要明确确认 |
推理与笔记分开保存(不参与搜索),并作为假设而非事实引用。检测保持确定性;唯一的 LLM 步骤是综合推理摘要,这一步由 Claude 完成,memex 从不参与。
笔记分层
每条笔记根据可变性分为三个层级之一:
层级 | 含义 | Claude 的权限 |
| 对已发生事情的记录,回顾、会议、决策依据、调试过程 | 仅追加。 |
| 当前状态或计划,项目进度、路线图、某人的当前职位 | 可自由更新 |
| Claude 的行为指南,编码风格、搜索策略 | Claude 只读。仅用户可写 |
CLI 会在 list、search 和 show 中为每条笔记打印颜色编码的 [past] / [state] / [rule] 徽章。
save_note(MCP)和memex add(CLI)需要显式指定layer。分类规则记录在工具描述中,以便 Claude 正确选择。首次运行时,现有笔记会按文件夹进行回填:
projects/dev/herald→state,coding→rule,其他全部 →past。迁移是幂等的。rule笔记也会自动注入 MCP 服务器的指令中,参见下方的 Rule 层自动注入。
闪回
当你保存笔记或搜索时,memex 会自动浮现来自不同文件夹的、语义相似的旧笔记,"你在 124 天前在不同的上下文中写过这个。" 以系统生成的反向链接存储(note_links.source = 'flashback'),与你的 [[wikilinks]](source = 'wiki')分开。
通过环境变量调整:
环境变量 | 默认值 | 行为 |
|
| 最小时间间隔,以天为单位 |
|
| 最大向量距离(越小 = 匹配越严格) |
|
| 每次浮现的最大建议数 |
Rule 层自动注入
layer = 'rule' 的笔记会在启动时追加到 MCP 服务器的指令中,放在 ## House Rules 部分下。Claude 在每次对话开始时就能看到它们,无需调用 search_notes。这是编码风格指南或其他行为指导的合适归属地。
环境变量 | 默认值 | 行为 |
| 启用 | 设为 |
|
| 注入部分的字节预算;超出部分会被截断并输出 |
对 rule 笔记的更新会在下次 Claude Desktop / Claude Code 重启时生效。
配置
配置位于 ~/.memex/config.json。
键 | 默认值 | 描述 |
|
|
|
|
| 要索引的其他目录(例如现有的 Obsidian vault) |
|
| 搜索别名映射,例如 |
memex config set vault-path ~/my-vault架构
~/.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)包 | 作用 |
| SQLite 模式、drizzle 查询、sqlite-vec + FTS5 集成 |
| 通过 @huggingface/transformers 实现的本地嵌入器 |
| 本地交叉编码器重排序器(可选) |
| CLI 和 MCP 共享的笔记服务:保存、编辑、搜索、向量索引 |
| 配置、路径辅助、共享工具 |
| MCP 服务器(打包进 CLI 发行版) |
生态系统
memex 是三个本地优先工具之一,它们共享一个原则:你的数据留在你的机器上,AI 来找它。 它们通过任何 MCP 客户端互操作,彼此之间互不依赖。
flowchart TB
U([You])
subgraph I["Interfaces, talk to your tools"]
direction LR
CD[Claude Desktop]
CC[Claude Code]
H["Herald · voice"]
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你可以通过 Claude Desktop、Claude Code、Cursor 或 Herald(一个语音界面)来使用它们。这些工具通过模型进行组合,从不互相调用。
llms.txt
llms.txt 是此项目面向 LLM 代理的机器可读摘要,包含简洁描述和文档链接,遵循 llms.txt 标准。
许可证
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI agents with persistent, searchable memory that survives across conversations using semantic search, temporal versioning, and smart organization. Enables long-term context retention and cross-session continuity for AI assistants.14

Memsolus MCP Serverofficial
AlicenseAqualityDmaintenanceProvides persistent long-term memory for AI agents through semantic search and automated knowledge graph extraction. It enables agents to store, recall, and reason over facts, preferences, and relationships across multiple conversations and sessions.148MIT- AlicenseAqualityAmaintenanceA production-grade persistent memory service for AI agents. Agents forget everything between sessions by default — memex fixes that. It stores, retrieves, and ranks conversation memory using semantic search with recency decay, so agents surface what's relevant and recent, not just what's semantically closest.41MIT
- AlicenseAqualityAmaintenanceProvides persistent, searchable memory for AI agents, enabling them to retain, recall, and reflect on information across conversations.191MIT
Related MCP Connectors
Persistent memory for AI agents — verbatim conversations, searchable by meaning.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Persistent memory for AI agents. Search, store, and recall across sessions.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/evan-moon/memex'
If you have feedback or need assistance with the MCP directory API, please join our Discord server