Local-first second brain with semantic search. Markdown notes indexed by a local ML model.
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.
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...
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.
npm install -g @evan-moon/memex
Connect your apps:
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/.
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.
multilingual-e5-baseMEMEX_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--from / --topast (immutable record), state (mutable plan), or rule (Claude behaviour guide). Past notes refuse updates; rule notes auto-inject into Claude's system promptsave_note warns when a semantically similar note already exists, nudging Claude to update rather than create[[Title]] syntax; get_note shows which notes reference itamends), so search flags the superseded note and points at the newest fix instead of returning a claim you already know is wrongmemex digest summarises notes saved in the last N days, grouped by folder.md files; works alongside existing vaultssqlite-vec at ~/.memex/memex.db# 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 every MCP client on this machine
# Auto-recall
memex recall install # search notes on every prompt, inject hits
memex recall uninstall # remove the hook
memex mcp path # print MCP binary path
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.
| Tool | Description |
|---|---|
save_note | Save a note, requires layer, warns if a similar note already exists, surfaces flashbacks |
search_notes | Semantic search; supports category, tag, date_from, date_to filters; appends flashbacks for the top result |
list_notes | List recent notes |
list_tags | List all tags with note counts |
list_folders | List all folders with note counts |
get_note | Get full content and backlinks of a note by ID |
update_note | Update title or content. Refuses past notes (with [Amendment] suggestion) and rule notes (user-only) |
delete_note | Delete a note by ID |
get_signals | Deterministic un-synthesized patterns (hidden_arc / stale_state / dangling_link / tag_burst) |
update_signal_status | Triage a signal, dismiss or snooze |
list_inferences | List synthesized hypotheses (re-checks staleness first) |
get_inference | One inference with full provenance + change/delete markers |
mint_inference | Persist 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.
Every note is classified into one of three layers based on mutability:
| Layer | Meaning | Claude's permission |
|---|---|---|
past | Record of what happened, retros, meetings, decision rationale, debugging sessions | Append-only. update_note refuses, suggesting an [Amendment] note instead |
state | Current state or plans, project progress, roadmaps, a person's current role | Freely updatable |
rule | Behaviour guide for Claude, coding style, search policy | Claude 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.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.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:
| Env | Default | Behaviour |
|---|---|---|
MEMEX_FLASHBACK_DAYS | 90 | minimum age gap, in days |
MEMEX_FLASHBACK_DIST | 0.4 | maximum vector distance (lower = stricter match) |
MEMEX_FLASHBACK_LIMIT | 3 | max suggestions per surface |
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.
| Env | Default | Behaviour |
|---|---|---|
MEMEX_INJECT_RULES | enabled | Set to 0 to disable injection entirely |
MEMEX_RULES_MAX_CHARS | 8000 | Byte 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.
Config lives at ~/.memex/config.json.
| Key | Default | Description |
|---|---|---|
vault_path | ~/Documents/Second Brain | Directory 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 |
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)
| Package | Role |
|---|---|
@memex/db | SQLite schema, drizzle queries, sqlite-vec + FTS5 integration |
@memex/embed | Local embedder via @huggingface/transformers |
@memex/rerank | Local cross-encoder reranker (opt-in) |
@memex/core | Note service shared by CLI and MCP: save, edit, search, vector indexing |
@memex/utils | Config, path helpers, shared utilities |
@memex/mcp | MCP server (bundled into CLI dist) |
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.
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
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.
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:
| Goal | Status |
|---|---|
| Retrieval that answers the question, not the phrasing (hybrid + rerank + chunking) | shipped |
| A correction reaching every surface that returns the note it corrected | shipped |
| Signals and inferences that name what went stale, deterministically | shipped |
| Layers and templates that make a note's lifetime explicit at write time | shipped |
| Staleness settled at read time rather than by a person clearing a queue | in progress |
Evidence (derives_from) required, so a claim can be rechecked without guessing | in 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 is a machine-readable summary of this project for LLM agents, concise description with documentation links, following the llms.txt standard.
MIT
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y @evan-moon/memexMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-evan-moon-memex": {
"command": "npx",
"args": [
"-y",
"@evan-moon/memex"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup reference@evan-moon/memexnpmio.github.evan-moon/memex works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.