semantic search for ai agents
See the codea macOS and windows app that indexes your files locally and lets you search them semantically. no cloud, no api calls, nothing leaves your machine.
existing ai-powered launchers (raycast's quick ai, spotlight, etc.) don't actually know anything about your files. ask raycast "how did i implement rate limiting here" and it has no index of your activity, it just tells you how to check manually (open file > open recent, run git status, etc.). that's a cloud llm wrapper with no real memory of your machine, not a tool that retrieves anything.
this app is the real version: an actual local index of your files, kept current automatically, queryable with real semantic search, answered with citations back to the source file.
| piece | choice | why |
|---|---|---|
| app shell | tauri (rust) | lightweight desktop shell, avoids bundling a python runtime |
| file watching | notify crate | filesystem event watching |
| embeddings | candle (rust-native ml) | cuda support on pc, metal support on mac, no python dependency |
| embedding model | all-minilm-l6-v2 | smallest, fastest, most battle-tested with candle, safest starting point |
| vector storage | lancedb (rust crate) | embedded (in process, no server), native rust bindings, hybrid vector + metadata filtering, versioned storage |
| upsert behavior | table::merge_insert | handles "file changed, re-embed it" as a delete-then-upsert keyed on path + start line, since one file is now many chunk rows |
| code chunking | tree-sitter | parses rust, python, typescript, javascript, go, java, c, c++, ruby, and swift into function/class-level chunks instead of embedding a whole file as one vector |
| agent access | rmcp (official rust mcp sdk) | a long-running mcp server keeps the embedding model warm across calls instead of reloading it per invocation |
search for natural-language lookup (with an exclude_folder param for cross-repo recall), explain for citation synthesis regardless of query phrasing, find_similar for finding near-duplicate chunks given one already found, check_doc_drift for flagging a doc chunk that no longer scores close to the code it describeswatch, embed, store, and hybrid search all work end to end through the tauri app, backed by one local index (~/.reference/). code is chunked at function/class granularity for rust, python, typescript, javascript, go, java, c, c++, ruby, and swift (prose and other languages still index as one whole-file chunk). answer synthesis cites exact chunks, syntax-highlighted in the app, with a send-to-agent clipboard button on every result.
everything lives under ~/.reference/: watched_folders.json is the plain-text list of folders you've added via the app, index/ is the actual lancedb table (paths, chunks, and embeddings). removing a folder from the app doesn't just stop watching it, it purges every already-indexed row for that folder from index/ too, so nothing stale is left searchable after you remove it.
there's a menu bar tray icon (the pixelated & mark) alongside the dock icon, click it to show/focus the main window. closing the window hides it instead of quitting the app, specifically so the tray icon has a window to bring back; quit fully via the dock icon or cmd+q.
open the folder picker (⌘7), type or paste a path, then:
git clone <this repo>
cd reference/app
pnpm install
pnpm tauri dev
requires rust and pnpm installed. no python dependency anywhere in the pipeline. on macOS this builds with metal (gpu) support automatically, no extra flags needed.
windows builds with cuda support automatically too (app/src-tauri/tauri.windows.conf.json turns on the cuda feature), but getting a working nvcc/msvc toolchain in place takes a few one-time steps on a fresh machine:
rustupprotoc (needed by lance-encoding's build script, unrelated to cuda)pnpm approve-builds --all once after the first pnpm install (pnpm's build-script approval gate otherwise blocks esbuild's postinstall)nvidia-smi; matching (or older than) whatever your driver supports should workvcvars64.bat, under VC\Auxiliary\Build in your VS install) so cl.exe/link.exe are on PATH, then set two things nvcc/the linker need on top of that:
NVCC_APPEND_FLAGS=-Xcompiler /Zc:preprocessor — without this, candle-kernels' build script fails compiling reduce.cu with an msvc preprocessor error on newer cuda toolkitslib\x64 directory to %LIB% — without this, the final link fails with cannot open input file 'cuda.lib'with those in place, pnpm tauri dev (or pnpm tauri build) from app/ builds and runs like any other rust/tauri project. a missing or non-nvidia gpu at runtime falls back to cpu automatically, it doesn't crash the app.
build it once:
cargo build -p reference-mcp
then register it with claude code:
claude mcp add --scope local reference-mcp -- ${CLAUDE_PROJECT_DIR:-.}/target/debug/reference-mcp
or, if you're using the installed app instead of a source build, the reference-mcp binary ships inside the app bundle at Contents/MacOS/reference-mcp on macOS:
claude mcp add --scope user reference-mcp -- /Applications/reference.app/Contents/MacOS/reference-mcp
on windows, build it the same way (cargo build -p reference-mcp, no extra flags needed — it picks up cuda automatically) and point at target\debug\reference-mcp.exe, or the copy that ships alongside the installed app's own .exe.
it only searches folders you've already added to the app. exposes four tools: search, explain, find_similar, and check_doc_drift.
elastic license 2.0 (LICENSE). free to use, copy, modify, and distribute. can't offer it to third parties as a hosted or managed service, and can't circumvent license key functionality.
97 commits
Rust
74.4%
TypeScript
17.8%
CSS
6.8%
semantic search for ai agents
See the codea macOS and windows app that indexes your files locally and lets you search them semantically. no cloud, no api calls, nothing leaves your machine.
existing ai-powered launchers (raycast's quick ai, spotlight, etc.) don't actually know anything about your files. ask raycast "how did i implement rate limiting here" and it has no index of your activity, it just tells you how to check manually (open file > open recent, run git status, etc.). that's a cloud llm wrapper with no real memory of your machine, not a tool that retrieves anything.
this app is the real version: an actual local index of your files, kept current automatically, queryable with real semantic search, answered with citations back to the source file.
| piece | choice | why |
|---|---|---|
| app shell | tauri (rust) | lightweight desktop shell, avoids bundling a python runtime |
| file watching | notify crate | filesystem event watching |
| embeddings | candle (rust-native ml) | cuda support on pc, metal support on mac, no python dependency |
| embedding model | all-minilm-l6-v2 | smallest, fastest, most battle-tested with candle, safest starting point |
| vector storage | lancedb (rust crate) | embedded (in process, no server), native rust bindings, hybrid vector + metadata filtering, versioned storage |
| upsert behavior | table::merge_insert | handles "file changed, re-embed it" as a delete-then-upsert keyed on path + start line, since one file is now many chunk rows |
| code chunking | tree-sitter | parses rust, python, typescript, javascript, go, java, c, c++, ruby, and swift into function/class-level chunks instead of embedding a whole file as one vector |
| agent access | rmcp (official rust mcp sdk) | a long-running mcp server keeps the embedding model warm across calls instead of reloading it per invocation |
search for natural-language lookup (with an exclude_folder param for cross-repo recall), explain for citation synthesis regardless of query phrasing, find_similar for finding near-duplicate chunks given one already found, check_doc_drift for flagging a doc chunk that no longer scores close to the code it describeswatch, embed, store, and hybrid search all work end to end through the tauri app, backed by one local index (~/.reference/). code is chunked at function/class granularity for rust, python, typescript, javascript, go, java, c, c++, ruby, and swift (prose and other languages still index as one whole-file chunk). answer synthesis cites exact chunks, syntax-highlighted in the app, with a send-to-agent clipboard button on every result.
everything lives under ~/.reference/: watched_folders.json is the plain-text list of folders you've added via the app, index/ is the actual lancedb table (paths, chunks, and embeddings). removing a folder from the app doesn't just stop watching it, it purges every already-indexed row for that folder from index/ too, so nothing stale is left searchable after you remove it.
there's a menu bar tray icon (the pixelated & mark) alongside the dock icon, click it to show/focus the main window. closing the window hides it instead of quitting the app, specifically so the tray icon has a window to bring back; quit fully via the dock icon or cmd+q.
open the folder picker (⌘7), type or paste a path, then:
git clone <this repo>
cd reference/app
pnpm install
pnpm tauri dev
requires rust and pnpm installed. no python dependency anywhere in the pipeline. on macOS this builds with metal (gpu) support automatically, no extra flags needed.
windows builds with cuda support automatically too (app/src-tauri/tauri.windows.conf.json turns on the cuda feature), but getting a working nvcc/msvc toolchain in place takes a few one-time steps on a fresh machine:
rustupprotoc (needed by lance-encoding's build script, unrelated to cuda)pnpm approve-builds --all once after the first pnpm install (pnpm's build-script approval gate otherwise blocks esbuild's postinstall)nvidia-smi; matching (or older than) whatever your driver supports should workvcvars64.bat, under VC\Auxiliary\Build in your VS install) so cl.exe/link.exe are on PATH, then set two things nvcc/the linker need on top of that:
NVCC_APPEND_FLAGS=-Xcompiler /Zc:preprocessor — without this, candle-kernels' build script fails compiling reduce.cu with an msvc preprocessor error on newer cuda toolkitslib\x64 directory to %LIB% — without this, the final link fails with cannot open input file 'cuda.lib'with those in place, pnpm tauri dev (or pnpm tauri build) from app/ builds and runs like any other rust/tauri project. a missing or non-nvidia gpu at runtime falls back to cpu automatically, it doesn't crash the app.
build it once:
cargo build -p reference-mcp
then register it with claude code:
claude mcp add --scope local reference-mcp -- ${CLAUDE_PROJECT_DIR:-.}/target/debug/reference-mcp
or, if you're using the installed app instead of a source build, the reference-mcp binary ships inside the app bundle at Contents/MacOS/reference-mcp on macOS:
claude mcp add --scope user reference-mcp -- /Applications/reference.app/Contents/MacOS/reference-mcp
on windows, build it the same way (cargo build -p reference-mcp, no extra flags needed — it picks up cuda automatically) and point at target\debug\reference-mcp.exe, or the copy that ships alongside the installed app's own .exe.
it only searches folders you've already added to the app. exposes four tools: search, explain, find_similar, and check_doc_drift.
elastic license 2.0 (LICENSE). free to use, copy, modify, and distribute. can't offer it to third parties as a hosted or managed service, and can't circumvent license key functionality.
97 commits
Rust
74.4%
TypeScript
17.8%
CSS
6.8%