Skip to main content

memex-md

You like Obsidian? Your LLM will love it too.

Memex: Vannevar Bush's 1945 concept of a "memory extender" - a device for storing and retrieving personal knowledge. The conceptual ancestor of personal wikis and second brains.

Fuzzy find, wikilink graph traversal, and semantic search for markdown vaults. Point it at your Obsidian vault (or any markdown folder).

Quick Start

uv tool install memex-md                                                    # find, explore, rename
uv tool install memex-md --with "memex-md[semantic]" --torch-backend=cpu    # + semantic search (CPU, ~200MB)
uv tool install memex-md --with "memex-md[semantic]" --torch-backend=auto   # + semantic search (auto-detect GPU)

If installed, you can run memex directly, or via the alias mx:

mx vault:add personal ~/notes ~/journal
mx search "How does the auth flow handle token refresh?" -v personal
mx find knn
mx explore auth personal

For a memex skill, see my agent workflows.

How It Works

A vault is a named collection of directories. Each vault has its own embedding model and SQLite index (~/.local/share/memex-md/<vault-name>/index.db).

The index contains:

  • Wikilink graph for backlink/outlink queries
  • Extracted frontmatter (aliases, tags)
  • Embeddings for semantic similarity (optional, default: embeddinggemma-300m)

Indexing is incremental — on each command, only files with changed mtimes are re-indexed. Hidden directories (.obsidian, .trash, .git, etc.) are excluded.

Semantic search requires the semantic extra (pip install memex-md[semantic]). Without it, find, explore (outlinks/backlinks), and rename work normally — only search and the "similar notes" section in explore are unavailable.

Note: Initial embedding computation is GPU-intensive. Example: ~3800 notes took ~7 minutes on an RTX 3070 Ti.

Configuration

Vaults are configured via CLI. Config lives at ~/.config/memex/config.toml.

mx vault:add personal ~/notes ~/journal
mx vault:add work ~/work-docs --model some/other-model
mx vault:list
mx vault:info personal
mx vault:remove personal --path ~/journal   # remove one path
mx vault:remove work                        # remove entire vault

Re-add a vault with --model to change its embedding model (triggers re-embedding). Use --model none to disable semantic search (wikilink navigation only).

Embeddings run on a GPU when torch finds one. To pin every vault to one device, set it under [defaults]:

[defaults]
device = "cpu"   # any torch device: "cpu", "cuda", "cuda:1", "mps"

Commands

find

mx find knn
mx find "neural ordinary" -v personal
mx find auth -n 20

Fuzzy match against note titles, frontmatter aliases, and paths. No embeddings needed — instant results. Ranked: exact title/alias > substring > fuzzy (rapidfuzz WRatio). Multi-word queries match any part; more parts hitting = ranked higher.

Flag Description
-v, --vault Search a specific vault (default: all)
-n, --limit Max results (default: 10)
mx search "How does the auth flow handle token refresh?" -v personal
mx search "What approaches did we consider for caching?" -v work --full

Embeds the query and ranks indexed notes by cosine distance. Natural language questions of a few sentences tend to work well.

Flag Description
-v, --vault Search a specific vault (default: all)
-n, --limit Max results (default: 5)
-p, --page Pagination (default: 1)
-f, --full Include note content (default: paths only)

explore

mx explore auth personal
mx explore docs/api-design work --full

Shows a note's outlinks ([[wikilinks]]), backlinks, and semantically similar notes.

note_path can be a title (auth) or path (docs/auth.md). Titles must be unique in the vault.

Flag Description
-f, --full Include note content and metadata (default: graph only)

rename

mx rename old-name new-name personal
mx rename docs/guide manual work

Renames a note file and updates all [[wikilinks]] pointing to it. Handles path links, title links, aliases, and heading refs. Ambiguous links (multiple files share a name) are skipped with warning.

index

mx index
mx index -v personal

Trigger indexing. Runs automatically before search/explore.

Development

uv sync
make check          # ruff + ty
make test           # pytest
make release-patch  # 1.0.0 -> 1.0.1, tag, push
make release-minor  # 1.0.0 -> 1.1.0
make release-major  # 1.0.0 -> 2.0.0

Metadata

Release files for memex-md 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for memex-md 2.3.0
File Size Uploaded
memex_md-2.3.0.tar.gz 22.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for memex-md 2.3.0
File Interpreter ABI Platform
memex_md-2.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.6 kB

Release files / memex_md-2.3.0.tar.gz

Download URL memex_md-2.3.0.tar.gz
Size 22.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b3228208ac50c003fb228737e0e95125a18f135857b6c1c8e914139fb189ba2d
BLAKE2b-256 checksum
How to use checksums
e3f075102790d83a1c6b4d924dd94b9232048d325ba5d2c9beb9859a34081dd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / memex_md-2.3.0-py3-none-any.whl

Download URL memex_md-2.3.0-py3-none-any.whl
Size 26.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
863fa9d49125e291c535374516b5b5eb9f4a860e4b3cd51dc1bc21821c3c36a9
BLAKE2b-256 checksum
How to use checksums
528e839cce454df70a69801293d47d5cec645e18077ee7067d2a710676d98d46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page