Garage (garagerag.app) is the search engine I wanted for my own life: everything I have written, collected and been sent, indexed on my own computer, and handed to an AI assistant one excerpt at a time. It is MIT-licensed, the source is at lwm-luminx/garage-rag, and it runs as a signed Mac app, a garage command line on macOS, Linux and Windows, and a Windows app in development.
This post is about how it works inside: what happens between a folder on disk and an answer in Claude, and where the privacy line is actually drawn.

The shape of it
sources ──▶ walker ──▶ [materialize] ──▶ extract ──▶ quality gate
│
attribution ◀─────────────────┤
│ ▼
└──────▶ documents ── chunks ◀── facts
│
┌───────────┴───────────┐
▼ ▼
emb_<model_1> emb_<model_2>
└───────────┬───────────┘
▼
hybrid search (RRF)
│
MCP server
Everything is stored in PostgreSQL with pgvector. The Mac app carries its own relocatable PostgreSQL 18 with pgvector and Apache AGE, llama.cpp for local embeddings and generation, Core ML for image embeddings and Tesseract for OCR, so it needs nothing else installed. The pipeline itself is Rust. It was written in Python first and ported one stage at a time.
Walking a personal corpus is the hard part
A personal computer is a hostile place to index. Most of what is on it was not written by a person, a lot of it is not really there, and some of it belongs to someone else.
Nothing is opened during the walk. The walker stats each candidate once and prunes excluded subtrees during descent (version control, build output, dependency caches such as .cargo/registry and go/pkg/mod, diagnostic bundles). Opening is where the cost is: parsing, and for cloud files, downloading.
Cloud placeholders are metered. iCloud Drive and Dropbox leave “dataless” files whose real size is reported but whose bytes are in the cloud, and reading one triggers a download. Garage puts these behind a materialization budget that caps files and bytes per run. On macOS the budget is enforced by the kernel as well: the ingest thread turns off the IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES I/O policy, so a stray read of a placeholder anywhere else in the pipeline fails with EDEADLK instead of quietly pulling gigabytes down. Only the materialize step turns the policy back on, for one budgeted read. Hitting the cap is not an error. Ingest is idempotent, so repeated bounded runs converge on the whole corpus.
Machine-generated text is filtered by content. One macOS sysdiagnose bundle on my machine produced about 200,000 chunks, 76% of the whole index. Path rules catch most of that kind of thing. The quality gate is the backstop, looking at structural signals: repeated line shapes, timestamp prefixes, hex and base64 density, the ratio of letters to everything else. Any single signal has false positives (a bibliography repeats, a cryptography paper is full of hex), so rejecting a document takes corroboration or one decisive signal. It was validated at zero false positives across 21 real prose documents, and a per-document chunk cap makes sure no single file can dominate the index regardless.
Re-ingesting is cheap. Each document keeps two hashes that are deliberately not redundant: one over the raw bytes, which skips an unchanged file without opening it (and so without materializing it), and one over the extracted text, which rebuilds chunks when an extractor improves even though the file never changed. When a document does change, chunks whose text and position still match keep their row ids, and therefore their vectors in every model’s table. A Messages thread that gains one message re-embeds one chunk.
Deletion is treated as the dangerous operation. An unmounted volume looks exactly like a mass deletion. A run only counts as complete when its walk ran to exhaustion, every URI the walk saw is recorded, and a run that would delete more than 25% of a source refuses without --force.
Extraction covers Markdown, PDF (with a per-page escalation to a table-aware parser when a page yields little text), Word, PowerPoint and Excel, images through Tesseract, Apple Mail and .eml messages, code and configuration files. A Messages chat.db is read as a database rather than walked: each conversation becomes one document with one chunk per message, and each chunk records whether I sent it or received it.
Who wrote this?
Most personal RAG treats every file the same. Garage records provenance for each one, as authored (my own work), reference (something I collected) or received (something sent to me), and search can filter on it. Asking “what did I write about consensus?” is a different question from “what have I read about consensus?”
The signals are tried in order, and every decision records its evidence so a wrong answer can be traced to the rule that made it:
- Git history is authoritative, and it works per file. If I have commits on a file, it is
authored; if not, it isreference. That is the only signal that separates my own repository from a clone of someone else’s, and it handles forks properly: in a fork where I changed three files, those three are mine and the rest are upstream’s. Owning the repository is not authorship of the file. - Embedded metadata: PDF
/Author, Office core properties, Markdown front matter. This is filtered for tool names, because libraries write their own names into these fields. Without the filter,python-pptx’s default template attributes every slide deck to the library’s author. - Path conventions, a data table rather than code.
- The source’s default.
Mail skips the metadata step: the sender decides. Messages from me are authored and everything else is received.
Running git log --follow once per file across about 18,000 tracked documents would mean 18,000 git invocations. Instead Garage makes one --name-only pass per repository and builds a path-to-authors map in memory: 60 repositories and 277,796 tracked paths in 29 seconds. History is read in-process through libgit2, so it works on a Mac without the developer tools installed.
Storage that outlives a model
Chunks are model-agnostic. Each embedding model gets its own table, emb_<slug>, keyed on the chunk id with ON DELETE CASCADE. A vector(1024) and a vector(2560) cannot share a column, and per-model nullable columns would make indexing and backfills painful. With separate tables, adding a model is a backfill rather than a re-ingest, and two models can be compared side by side over the same chunks.
pgvector’s HNSW indexes have hard ceilings (2,000 dimensions for vector, 4,000 for halfvec), so the storage type follows the model’s width:
| Model width | Storage | Index |
|---|---|---|
| up to 2,000 | vector(d) |
HNSW on the model’s distance |
| 2,001 to 4,000 | halfvec(d) |
HNSW on the model’s distance |
| over 4,000, Matryoshka-trained | halfvec(4000), truncated and renormalized |
HNSW on the model’s distance |
| over 4,000, not Matryoshka | vector(d) |
HNSW on binary_quantize(...), re-ranked on the exact distance |
Truncation is only sound for models trained for it, so the model has to declare that, and a truncated vector is renormalized because a prefix of a unit vector is not itself a unit vector.
Pictures get the same treatment. An image with little or no OCR text becomes one image chunk whose vector comes from the file, embedded by a CLIP-style model on Core ML. Search queries go through that model’s text tower, so a phrase can find a photo.
Hybrid search
Search is Reciprocal Rank Fusion over two engines: vector nearest neighbours from pgvector, and Postgres full-text search. It takes 200 candidates from each and fuses them with k = 60. RRF only needs each side’s ranking, which matters because cosine distance and ts_rank_cd are on scales that cannot be compared.
One detail made a large difference in practice. The keyword side ORs its terms instead of ANDing them. A strict query for “secure enclave firmware validation” requires every word in one chunk and usually returns nothing. Since RRF decides the final order anyway, the keyword side should favour recall, and the vector side keeps the results on topic.
Facts, distilled locally
An optional pass distills documents into atomic facts using a local model, with a Rust port of the local part of Google’s LangExtract (langextract-rs). Every fact is grounded to the exact span of the document it came from, and a fact the extractor cannot locate in the text is dropped rather than stored. Each fact also gets a chunk of its own, so the ordinary backfill embeds it under every model and search finds facts alongside passages with no special path.
The same claim stated in five documents, or quoted in every message of a mail thread, is extracted five times. A clustering pass groups restatements into one distilled fact, with a guard that never groups facts disagreeing on numbers, dates or negation. Embeddings put “42 employees” next to “45 employees”, and “on Tuesday” next to “not on Tuesday”, so similarity alone is not enough. Where the database has Apache AGE, documents, authors and facts are projected into a graph the app can browse.
Serving it over MCP
The results reach an assistant over the Model Context Protocol, on stdio for a client that launches the server or local HTTP with DNS-rebinding protection. The read tools are rag_search, rag_get_document, rag_list_sources, rag_list_authors and rag_stats. Three more, rag_ask, rag_agent and rag_generate, generate text, and they do it entirely on a local model.
rag_ask runs the same retrieval, numbers the excerpts and asks the local model to answer citing [n]. rag_agent lets a small local model drive the read tools itself. Small models follow a one-line signature per tool better than a JSON schema, so that is what they get. By default the agent’s first step is a search it has already made: without it, a model such as Gemma 2 2B reads “when did I last talk to BMW?” as a question about its training data and answers that it has no access to personal information.
Garage works with Claude Desktop, Claude Code, Cursor and other MCP clients, and garage mcp-install writes the client configuration for you.
Where the privacy line actually is
The product claim is that Garage never uploads your files or its index. That claim holds, but what leaves your computer depends on which AI you connect, and it is worth being exact about it.
- A cloud assistant over MCP, which is the usual setup. The assistant’s app queries Garage on your computer and receives only the excerpts its searches return and the documents it opens, never the whole index. Garage uploads nothing, but the assistant does send those excerpts to its provider with your conversation.
- Fully local. With the built-in llama.cpp engine, or Ollama or LM Studio on the same computer, and an assistant that runs its model locally, nothing leaves the machine.
- Your own model server on your network. Documents and code go to that server and only that server. Messages and mail never do.
That last rule is enforced in code rather than in policy, in layers that are each tested on their own:
- One choke point. No part of the pipeline opens an outbound connection itself. Every model-server request is built in one place and sent only after an egress check approves its destination.
- No cloud AI SDK. No crate depends on one, and the lock file contains none. There used to be an optional cloud fallback for OCR; it was removed.
- A destination allowlist. Loopback, or exactly the origin of the model server you configured. There is no setting that adds other hosts. A host name other than
localhostis never treated as loopback even if it resolves there today, because a DNS answer can change. The clients ignore proxy variables and never follow redirects, so neitherhttp_proxynor aLocationheader can send content somewhere else. - Communications stay on the machine. Anything classified as a communication (mail, Messages) is refused for any destination that is not loopback, even an approved one. A message is never sent to an off-box model for facts, an answer that retrieved one aborts rather than send it, and its chunks are left unembedded for a remote model.
Removing any one of these layers fails the test suite.
Reaching it from somewhere else
Everything above works on one computer with nothing in the cloud. Garage Door, which arrives with Garage 2.0, is the way in from outside: an assistant on the web, or Garage Remote on a phone. Your computer opens one outbound, encrypted connection to the door and keeps it open, so nothing on it listens and the router needs no changes. Assistants add one MCP address for the account, and every connected computer answers, each under its own name and under its own rules (read-only search by default).
The door stores, logs and caches no MCP content; it records which door, which method, the status and the time. For Claude and ChatGPT on the web, though, the door handles each request in memory on the way through, so that path is not end-to-end encrypted. Garage Remote is different: once paired, it reaches your computers over a connection sealed end to end, and the door relays ciphertext it cannot read. That sealed stream is the subject of Sealed Transport for MCP, which restates it as a proposed MCP extension.
Garage itself is open source. Garage Door’s code is closed; its protocol is published.
Try it
The Mac app is at garagerag.app, with the user guide and the full architecture and privacy write-ups this post draws on. On Linux or Windows, the README walks through Postgres, Ollama and the garage command from scratch.