DigUp Kills Its Own Indexer to Survive Your Worst PDF
A local-first search tool that reads your photos, PDFs, and podcasts by meaning, and treats every file parser as a hostile dependency.
- DigUp runs file extraction in a disposable helper process and kills it on purpose when a parser runs away, so one poisonous PDF costs a restart instead of the whole indexing session.
- Text, images, audio, and video all land in one shared embedding space, so a single natural-language query can return a PDF page, a photo, or a podcast timestamp.
- Everything stays on the machine: one model download, no account, no telemetry, and no file data leaving the disk.
- The engine is a Swift library with no UI, and macOS, Windows, and Linux are thin shells that talk to the same services over JSON lines.
The PDF That Ate 30 Gigabytes
Apple's PDF text extraction can grow without end. On a page of certain PDFs it consumed 30 GB of RAM in 3.5 minutes and never returned. That number is not a stress test invented for a benchmark. It sits in a comment inside DigUp's own source, written by someone who watched it happen.
Nothing outside a running process can stop code like that. You cannot politely ask a parser to stop allocating. You cannot cancel a call that has already descended into a native library. You can only end the process that is doing it.
// Apple's PDF text extraction has grown without end on a page of some
// PDFs (30 GB in 3.5 minutes, never returning), and nothing stops code
// like that from outside but ending the process.
//
// Source: Sources/digup/Watchdog.swift, ARahim3/DigUp
That is the failure mode DigUp is built around. The app does not pretend its dependencies are well behaved. It assumes the opposite, and it designs the architecture so that a single bad file cannot take down the session.
The App That Kills Its Own Indexer
DigUp never runs extraction inside the app itself. When you point it at a folder, it spawns a helper process called index-service, and that helper does the reading: OCR through Vision, text through PDFKit, frames through AVFoundation. When it finishes, it exits, and every byte it borrowed returns to the operating system.
A watchdog sits beside it. Once per second it samples two things: the helper's memory footprint and how long the current file has been in progress. Cross either limit and the watchdog writes down the file path and the reason, then exits with a specific code.
memoryLimit = min(8 GB, max(4 GB, physicalRAM / 2))
// Scales with the machine, never below 4 GB, never above 8 GB.
// Exceed it, or blow the per-file time limit, and the helper exits
// with StoppedFile.exitCode.
The app sees that exit code, starts a fresh helper, and the new one reads the note from disk, marks the file as unreadable, and moves on. One runaway file costs one restart. It does not cost the session.
Two companion defenses live in the same loop. A timing rule called yieldAt guarantees that indexing gets at least as long as the sync that preceded it, so a folder that keeps changing cannot starve indexing forever. And a pre-sync availability check treats an absent folder as unknown rather than deleted, so an unplugged drive never crawls as if every file on it had vanished.
Anatomy of a Suicide
Why It Had to Be This Way
ARahim3 built DigUp as a local-first tool. No account, no telemetry, and the only network traffic is a one-time 865 MB model download plus a daily update check that sends nothing about your files. The index, the vectors, and the queries all stay on the disk.
Process isolation is not only crash-proofing. It is also how DigUp keeps its own memory small. Vision alone keeps about 100 MB of models cached in whatever process ran OCR. In a measured run the app went from 16 MB to 93 MB after indexing 11 screenshots and stayed there. By moving extraction into a process that exits, DigUp hands all of that back to the OS instead of carrying it for the life of the app.
The same philosophy shapes the product boundary. DigUp is deliberately not a chatbot.
No. DigUp is a search: you describe what you remember and it finds the file and the place in it. No language model writes answers, and nothing is sent anywhere.
- 865 MB: the one-time model download, EmbeddingGemma 2 at 740M parameters.
- ~100 MB: the Vision model cache that stays in whatever process ran OCR.
- 30 GB: the runaway PDF extraction in 3.5 minutes that never returned.
- 1 second: how often the watchdog samples the helper's memory and progress.
One Vector Space for Four Senses
Underneath the defensive engineering is the actual product. EmbeddingGemma 2, run through llama.cpp, maps text, images, audio, and video into one shared coordinate space. A search for the lease clause about parking can return a PDF page. A search for that podcast bit about sourdough can return a 30-second timestamp.
DigUp combines that semantic retrieval with exact-string matching in the same query, so a filename you half remember and a concept you half describe can both hit. Results do not stop at the file. They land at a location inside it.
- A PDF returns the specific page.
- Audio and video return a timestamp, drawn from overlapping 30-second windows.
- Documents and notes return a passage.
- Code returns a line, in an opt-in index that respects your git ignore rules.
A Small Engine, Many Shells
The architecture follows from one decision: keep the engine free of any UI. DigUpKit is the library that crawls, extracts, indexes, and searches. It has no window, no menu, and no opinion about your desktop.
Above it sit the shells. On macOS, DigUpApp is a SwiftUI menubar app. The digup CLI carries the same engine plus the process-level services that any shell can drive. Windows and Linux shells talk to those services over JSON lines, which is why they can be written in a different language entirely.
- App to index-service: commands arrive on stdin, events go out on stdout.
- App to worker: the embedding model runs as its own process, so its memory is released on exit.
- App to search-service: the index stays open and the encoder stays warm, so a search while typing costs tens of milliseconds instead of a process start.
- Windows and Linux to the same services: a shell that cannot link the Swift library speaks JSON lines instead.
Even the naming is a constraint. The app bundle cannot be called DigUp, because on a case-insensitive disk it would collide with the digup CLI binary. Small details like that are what a portable engine forces you to notice.
How It Compares
| Dimension | DigUp | Spotlight / Windows Search | Recoll / DocFetcher | Khoj |
|---|---|---|---|---|
| Search basis | Meaning plus exact terms | Names, metadata, indexed text | Full text | Meaning, chatbot answers |
| Modalities | Text, image, audio, video, code | Text, metadata | Text | Text, some media |
| Result granularity | PDF page, video timestamp, code line | File | File or passage | Generated answer |
| Processing | Fully local | Local | Local | Server or local |
| License | MIT | Proprietary | Open source | Open source |
Positioning is drawn from each project's own documentation. DigUp's cross-platform parity across macOS, Windows, and Linux is described in the repo but not independently verified here. The project's own FAQ frames built-in search as complementary rather than obsolete, and that is the honest reading: DigUp adds content-level, cross-modal search on top of what the system already does well.





