memex
Stores notes as Markdown files compatible with Obsidian vaults, enabling integration with Obsidian.
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
npm install -g @evan-moon/memexConnect to Claude Code:
memex mcp installThat's it. On first run, the embedding model (~450MB) downloads once to ~/.memex/models/.
Features
Semantic search — finds notes by meaning, not just keywords. Multilingual (Korean + English), runs fully offline via
multilingual-e5-baseHybrid retrieval — vector search + BM25 full-text + tag matching, fused via Reciprocal Rank Fusion
Date filter — narrow search to a time range with
--from/--toNote layers — every note is
past(immutable record),state(mutable plan), orrule(Claude behaviour guide). Past notes refuse updates; rule notes auto-inject into Claude's system promptFlashback — 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"
MCP server — Claude searches and saves automatically. No extra CLAUDE.md setup needed
Duplicate detection —
save_notewarns when a semantically similar note already exists, nudging Claude to update rather than createBacklinks — link notes with
[[Title]]syntax;get_noteshows which notes reference itDigest —
memex digestsummarises notes saved in the last N days, grouped by folderCLI — add, search, tag, browse, and index notes from the terminal
Obsidian-compatible — notes saved as
.mdfiles; works alongside existing vaultsLocal DB — SQLite +
sqlite-vecat~/.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 conversations/tom --layer past
memex add --title "Note title" --content "..." -T typescript -T architecture --layer past
# Layers
memex classify # distribution of past / state / rule
memex relayer <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 # summary of last 7 days
memex digest --days 30 # summary of last 30 days
# 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
memex mcp path # print MCP binary pathMCP server
Claude Code
memex mcp installOr manually:
claude mcp add memex -- node "$(memex mcp path)"Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"memex": {
"command": "node",
"args": ["<path from `memex mcp path`>"]
}
}
}Available tools
Tool | Description |
| Save a note — requires |
| Semantic search; supports |
| List recent notes |
| List all tags with note counts |
| List all folders with note counts |
| Get full content and backlinks of a note by ID |
| Update title or content. Refuses |
| Delete a note by ID |
Note layers
Every note is classified into one of three layers based on mutability:
Layer | Meaning | Claude's permission |
| Record of what happened — retros, meetings, decision rationale, debugging sessions | Append-only. |
| Current state or plans — project progress, roadmaps, a person's current role | Freely updatable |
| 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) andmemex add(CLI) require an explicitlayer. 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.rulenotes 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:
Env | Default | Behaviour |
|
| minimum age gap, in days |
|
| maximum vector distance (lower = stricter match) |
|
| max 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.
Env | Default | Behaviour |
| enabled | Set to |
|
| Byte budget for the injected section; overflow is truncated with a |
Updates to rule notes are picked up on the next Claude Desktop / Claude Code restart.
Configuration
Config lives at ~/.memex/config.json.
Key | Default | Description |
|
| Directory where |
|
| Additional directories to index (e.g. existing Obsidian vaults) |
|
| Search alias map, e.g. |
memex config set vault-path ~/my-vaultArchitecture
~/.memex/
config.json — vault path, sources, and aliases
memex.db — SQLite DB (notes + vec embeddings + FTS5 index)
models/ — cached embedding model
<vault>/
*.md — notes (Obsidian-compatible)Package | Role |
| SQLite schema, drizzle queries, sqlite-vec + FTS5 integration |
| Local embedder via @huggingface/transformers |
| Config, path helpers, shared utilities |
| MCP server (bundled into CLI dist) |
Part of a personal AI stack
memex is the memory layer of the Herald ambient voice assistant stack.
Herald + memex + Firma — ambient voice, persistent memory, and financial intelligence.
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
This server cannot be installed
Maintenance
Latest Blog Posts
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