# arahim3/digup architecture

> Architecture diagram of the GitHub repository arahim3/digup, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arahim3/digup
- Repository: https://github.com/arahim3/digup

## Overview

DigUp is a macOS semantic file-search app: users select folders, wait for local indexing, then describe a file or moment to find and open it. Indexing covers media, documents, and optional isolated code search; search combines multilingual embedding similarity with exact-word matches. The app delegates indexing to a helper and uses a local SQLite index and llama.cpp runtime. Some UI and extraction details are unsampled, so those subsystem links rely on the README’s documented workflow and capabilities.

Main entry points: [`Sources/DigUpKit/Indexer.swift`](https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/Indexer.swift) (Segment indexing), [`Sources/DigUpApp/Engine.swift`](https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/Engine.swift) (Index and search engine), [`Sources/DigUpKit/Searcher.swift`](https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/Searcher.swift) (Hybrid retrieval), [`Sources/DigUpApp/AppSettings.swift`](https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/AppSettings.swift) (Settings and folders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Mac App"]
  node_app["App coordinator"]
  node_settings["Settings and folders<br/>[AppSettings.swift]"]
  node_hotkey["Hotkey panel<br/>[SearchPanel.swift]"]
  node_results["Search window<br/>[SearchWindow.swift]"]
  node_previews["Result previews<br/>[Previews.swift]"]
  node_engine["Index and search engine<br/>[Engine.swift]"]
end

subgraph group_indexing["Indexing"]
  node_watcher["Folder watcher"]
  node_service["Index helper<br/>[IndexService.swift]"]
  node_selection["Folder selection"]
  node_crawler["File crawler<br/>[Crawler.swift]"]
  node_extract["Media and code readers"]
  node_indexer["Segment indexing<br/>[Indexer.swift]"]
  node_store[("SQLite index<br/>[IndexStore.swift]")]
  node_code["Code search index"]
end

subgraph group_search["Search and Results"]
  node_searcher["Hybrid retrieval<br/>[Searcher.swift]"]
  node_normalization["Multilingual text matching<br/>[SearchText.swift]"]
end

subgraph group_runtime["Embedding Runtime"]
  node_modeldownload["Model download"]
  node_models["Model files<br/>[LlamaModels.swift]"]
  node_embedder["Multimodal embedder"]
  node_worker["Embedding worker<br/>[Worker.swift]"]
end

subgraph group_cli["Command Line"]
  node_cli["CLI commands<br/>[main.swift]"]
  node_cliindex["CLI indexing<br/>[IndexService.swift]"]
end

node_user(("Mac user"))
node_localfiles["Chosen local files"]

node_user -->|"chooses folders"| node_settings
node_user -->|"opens search"| node_hotkey
node_settings -->|"configures"| node_app
node_hotkey -->|"submits query"| node_engine
node_hotkey -->|"opens larger view"| node_results
node_results -->|"renders preview"| node_previews
node_app -->|"configures indexing"| node_engine
node_engine -->|"tracks changes"| node_watcher
node_engine -->|"starts helper"| node_service
node_settings -.->|"sets roots"| node_selection
node_localfiles -->|"scans chosen folders"| node_crawler
node_service -->|"syncs files"| node_crawler
node_crawler -->|"queues changes"| node_indexer
node_indexer -.->|"extracts content"| node_extract
node_indexer -->|"writes segments"| node_store
node_indexer -.->|"requests vectors"| node_worker
node_indexer -->|"indexes code"| node_code
node_engine -->|"searches index"| node_searcher
node_searcher -->|"reads records"| node_store
node_searcher -->|"matches exact text"| node_normalization
node_searcher -.->|"embeds query"| node_embedder
node_modeldownload -->|"installs model files"| node_models
node_worker -->|"computes vectors"| node_embedder
node_embedder -->|"loads model"| node_models
node_cli -->|"runs indexing"| node_cliindex
node_cli -->|"runs search"| node_searcher

click node_app "https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/AppController.swift"
click node_settings "https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/AppSettings.swift"
click node_hotkey "https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/SearchPanel.swift"
click node_results "https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/SearchWindow.swift"
click node_previews "https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/Previews.swift"
click node_engine "https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/Engine.swift"
click node_watcher "https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/FolderWatcher.swift"
click node_service "https://github.com/arahim3/digup/blob/main/Sources/digup/IndexService.swift"
click node_selection "https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/FolderSelection.swift"
click node_crawler "https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/Crawler.swift"
click node_extract "https://github.com/arahim3/digup/tree/main/Sources/DigUpKit"
click node_indexer "https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/Indexer.swift"
click node_store "https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/IndexStore.swift"
click node_searcher "https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/Searcher.swift"
click node_normalization "https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/SearchText.swift"
click node_modeldownload "https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/ModelDownload.swift"
click node_models "https://github.com/arahim3/digup/blob/main/Sources/LlamaRuntime/LlamaModels.swift"
click node_embedder "https://github.com/arahim3/digup/blob/main/Sources/LlamaRuntime/LlamaEmbedder.swift"
click node_worker "https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/Worker.swift"
click node_code "https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/CodeExtractor.swift"
click node_cli "https://github.com/arahim3/digup/blob/main/Sources/digup/main.swift"
click node_cliindex "https://github.com/arahim3/digup/blob/main/Sources/digup/IndexService.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_settings,node_hotkey,node_results,node_previews,node_engine,node_user toneBlue
class node_watcher,node_service,node_selection,node_crawler,node_extract,node_indexer,node_store,node_code toneAmber
class node_searcher,node_normalization toneMint
class node_modeldownload,node_models,node_embedder,node_worker toneRose
class node_cli,node_cliindex,node_localfiles toneIndigo
```

## Components

### Mac App

- [App coordinator](https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/AppController.swift): `Sources/DigUpApp/AppController.swift`
- [Settings and folders](https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/AppSettings.swift): `Sources/DigUpApp/AppSettings.swift`
- [Hotkey panel](https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/SearchPanel.swift): `Sources/DigUpApp/SearchPanel.swift`
- [Search window](https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/SearchWindow.swift): `Sources/DigUpApp/SearchWindow.swift`
- [Result previews](https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/Previews.swift): `Sources/DigUpApp/Previews.swift`
- [Index and search engine](https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/Engine.swift): `Sources/DigUpApp/Engine.swift`

### Indexing

- [Folder watcher](https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/FolderWatcher.swift): `Sources/DigUpApp/FolderWatcher.swift`
- [Index helper](https://github.com/arahim3/digup/blob/main/Sources/digup/IndexService.swift): `Sources/digup/IndexService.swift`
- [Folder selection](https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/FolderSelection.swift): `Sources/DigUpKit/FolderSelection.swift`
- [File crawler](https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/Crawler.swift): `Sources/DigUpKit/Crawler.swift`
- [Media and code readers](https://github.com/arahim3/digup/tree/main/Sources/DigUpKit): `Sources/DigUpKit`
- [Segment indexing](https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/Indexer.swift): `Sources/DigUpKit/Indexer.swift`
- [SQLite index](https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/IndexStore.swift): `Sources/DigUpKit/IndexStore.swift`
- [Code search index](https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/CodeExtractor.swift): `Sources/DigUpKit/CodeExtractor.swift`

### Search and Results

- [Hybrid retrieval](https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/Searcher.swift): `Sources/DigUpKit/Searcher.swift`
- [Multilingual text matching](https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/SearchText.swift): `Sources/DigUpKit/SearchText.swift`

### Embedding Runtime

- [Model download](https://github.com/arahim3/digup/blob/main/Sources/DigUpApp/ModelDownload.swift): `Sources/DigUpApp/ModelDownload.swift`
- [Model files](https://github.com/arahim3/digup/blob/main/Sources/LlamaRuntime/LlamaModels.swift): `Sources/LlamaRuntime/LlamaModels.swift`
- [Multimodal embedder](https://github.com/arahim3/digup/blob/main/Sources/LlamaRuntime/LlamaEmbedder.swift): `Sources/LlamaRuntime/LlamaEmbedder.swift`
- [Embedding worker](https://github.com/arahim3/digup/blob/main/Sources/DigUpKit/Worker.swift): `Sources/DigUpKit/Worker.swift`

### Command Line

- [CLI commands](https://github.com/arahim3/digup/blob/main/Sources/digup/main.swift): `Sources/digup/main.swift`
- [CLI indexing](https://github.com/arahim3/digup/blob/main/Sources/digup/IndexService.swift): `Sources/digup/IndexService.swift`

### Other components

- **Mac user**
- **Chosen local files**

## Connections

- Mac user → Settings and folders: chooses folders
- Mac user → Hotkey panel: opens search
- Settings and folders → App coordinator: configures (evidence: `Sources/DigUpApp/AppController.swift`)
- Hotkey panel → Index and search engine: submits query (evidence: `Sources/DigUpApp/SearchPanel.swift`)
- Hotkey panel → Search window: opens larger view
- Search window → Result previews: renders preview (evidence: `Sources/DigUpApp/SearchWindow.swift`)
- App coordinator → Index and search engine: configures indexing (evidence: `Sources/DigUpApp/AppController.swift`)
- Index and search engine → Folder watcher: tracks changes (evidence: `Sources/DigUpApp/Engine.swift`)
- Index and search engine → Index helper: starts helper (evidence: `Sources/DigUpApp/Engine.swift`)
- Settings and folders → Folder selection: sets roots
- Chosen local files → File crawler: scans chosen folders
- Index helper → File crawler: syncs files (evidence: `Sources/digup/IndexService.swift`)
- File crawler → Segment indexing: queues changes (evidence: `Sources/DigUpKit/Indexer.swift`)
- Segment indexing → Media and code readers: extracts content (evidence: `Sources/DigUpKit/Indexer.swift`)
- Segment indexing → SQLite index: writes segments (evidence: `Sources/DigUpKit/Indexer.swift`)
- Segment indexing → Embedding worker: requests vectors
- Segment indexing → Code search index: indexes code (evidence: `Sources/DigUpKit/Indexer.swift`)
- Index and search engine → Hybrid retrieval: searches index (evidence: `Sources/DigUpApp/Engine.swift`)
- Hybrid retrieval → SQLite index: reads records (evidence: `Sources/DigUpKit/Searcher.swift`)
- Hybrid retrieval → Multilingual text matching: matches exact text (evidence: `Sources/DigUpKit/Searcher.swift`)
- Hybrid retrieval → Multimodal embedder: embeds query
- Model download → Model files: installs model files (evidence: `Sources/DigUpApp/ModelDownload.swift`)
- Embedding worker → Multimodal embedder: computes vectors (evidence: `Sources/DigUpKit/Worker.swift`)
- Multimodal embedder → Model files: loads model (evidence: `Sources/LlamaRuntime/LlamaEmbedder.swift`)
- CLI commands → CLI indexing: runs indexing (evidence: `Sources/digup/main.swift`)
- CLI commands → Hybrid retrieval: runs search (evidence: `Sources/digup/main.swift`)
