Skip to main content

Semantic search CLI for markdown vaults

Project description

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.

Semantic search and wikilink graph traversal for markdown vaults. Uses any sentence-transformers model. Point it at your Obsidian vault (or any markdown folder).

Quick Start

uvx memex-md --help

memex vault:add personal ~/notes ~/journal
memex search "How does the auth flow handle token refresh?" -v personal
memex 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:

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

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

Note: Initial indexing requires embedding computation. Example: ~3800 notes took ~7 minutes on an RTX 3070 Ti.

Configuration

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

memex vault:add personal ~/notes ~/journal
memex vault:add work ~/work-docs --model some/other-model
memex vault:list
memex vault:info personal
memex vault:remove personal --path ~/journal   # remove one path
memex 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).

Commands

search

memex search "How does the auth flow handle token refresh?" -v personal
memex 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

memex explore auth personal
memex 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

memex rename old-name new-name personal
memex 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

memex index
memex 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memex_md-2.0.1.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memex_md-2.0.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file memex_md-2.0.1.tar.gz.

File metadata

  • Download URL: memex_md-2.0.1.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for memex_md-2.0.1.tar.gz
Algorithm Hash digest
SHA256 76bd473a5baf4628f3e2612266989b4cd20a90498d6e35cc63389fe56e923d59
MD5 0068869c2720c8d5dae75e3c1fce9863
BLAKE2b-256 242ebc15ebbdf254e2c5dff7dbc7f2ba70d3199f7e077aa59cf767ed7d0d8298

See more details on using hashes here.

File details

Details for the file memex_md-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: memex_md-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for memex_md-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46eb2dcad881bcc3a4a4b7b82cd9a1f9a127429604f77051312646caf078e6d9
MD5 74525a569eed6bf5d90661f2b665c7cf
BLAKE2b-256 2319e872472da1a7f7d81e8db72e704d35aeb716a2cedca77c100b083b896eeb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page