# joeydd032995-pixel/gather architecture

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

- Interactive diagram: https://gitdiagram.com/joeydd032995-pixel/gather
- Repository: https://github.com/joeydd032995-pixel/gather

## Overview

Gather is a local-first personal knowledge engine, operated through a Tauri desktop app and loopback APIs. Users import conversations, files, projects, and photos; ingestion normalizes and deduplicates them, background workers extract timestamped, provenance-linked units, and the system organizes and surfaces knowledge for search, graph browsing, and review. The graph preserves the README’s major capabilities. Some worker and route internals were not sampled, so those documented relationships cite the README rather than implying direct calls between unsampled modules.

Main entry points: [`daemon/src/db.rs`](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/db.rs) (PostgreSQL store), [`daemon/src/extract/mod.rs`](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/extract/mod.rs) (Atomic units), [`daemon/src/routes/ingest.rs`](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/routes/ingest.rs) (Ingestion), [`daemon/src/routes/mod.rs`](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/routes/mod.rs) (REST routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_desktop_app["Desktop interface<br/>[App.tsx]"]
  node_desktop_api["Desktop API client<br/>[api.ts]"]
  node_review_ui["Review tray<br/>[ReviewTray.tsx]"]
end

subgraph group_api["API surfaces"]
  node_rest["REST routes<br/>[mod.rs]"]
  node_grpc["gRPC services<br/>[pipeline.rs]"]
end

subgraph group_knowledge["Knowledge pipeline"]
  node_ingest["Ingestion<br/>[ingest.rs]"]
  node_adapters["Format adapters<br/>[mod.rs]"]
  node_extraction["Extraction worker<br/>[mod.rs]"]
  node_units[("Atomic units<br/>[mod.rs]")]
  node_library["Library and search<br/>[library.rs]"]
  node_graph["Knowledge graph<br/>[query.rs]"]
  node_projects["Project organization<br/>[mod.rs]"]
end

subgraph group_organization["Organization and safety"]
  node_cluster["Topic clustering<br/>[worker.rs]"]
  node_entities["Entity resolution<br/>[merge.rs]"]
  node_contradictions["Contradiction scanner<br/>[contradiction.rs]"]
  node_safety["Semantic safety<br/>[service.rs]"]
  node_photos["Photo processing<br/>[worker.rs]"]
end

subgraph group_persistence["Persistence"]
  node_database[("PostgreSQL store<br/>[db.rs]")]
end

node_user(("User"))
node_ollama["Optional Ollama"]

node_user -->|"uses"| node_desktop_app
node_desktop_app -->|"requests data"| node_desktop_api
node_desktop_api -->|"calls REST"| node_rest
node_rest -->|"routes uploads"| node_ingest
node_grpc -->|"delegates ingestion"| node_ingest
node_ingest -->|"parses exports"| node_adapters
node_ingest -->|"stores artifacts"| node_database
node_database -->|"provides pending content"| node_extraction
node_extraction -->|"extracts units"| node_units
node_extraction -.->|"optionally extracts"| node_ollama
node_units -->|"persists provenance"| node_database
node_rest -->|"serves search"| node_library
node_library -->|"reads artifacts"| node_database
node_units -->|"links entities"| node_graph
node_units -->|"scans conflicts"| node_contradictions
node_units -->|"groups topics"| node_cluster
node_cluster -->|"resolves duplicates"| node_entities
node_user -->|"corrects decisions"| node_review_ui
node_review_ui -->|"submits actions"| node_desktop_api
node_grpc -.->|"serves review actions"| node_review_ui
node_contradictions -.->|"records decisions"| node_safety
node_photos -->|"reads and updates photos"| node_database
node_projects -.->|"stores project data"| node_database
node_user -->|"imports folders"| node_projects
node_user -->|"imports photos"| node_photos

click node_desktop_app "https://github.com/joeydd032995-pixel/gather/blob/main/apps/desktop/src/App.tsx"
click node_desktop_api "https://github.com/joeydd032995-pixel/gather/blob/main/apps/desktop/src/api.ts"
click node_review_ui "https://github.com/joeydd032995-pixel/gather/blob/main/apps/desktop/src/ReviewTray.tsx"
click node_rest "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/routes/mod.rs"
click node_grpc "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/grpc/pipeline.rs"
click node_ingest "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/routes/ingest.rs"
click node_adapters "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/adapters/mod.rs"
click node_extraction "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/extract/mod.rs"
click node_units "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/extract/mod.rs"
click node_library "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/library.rs"
click node_graph "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/routes/query.rs"
click node_projects "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/projects/mod.rs"
click node_cluster "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/cluster/worker.rs"
click node_entities "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/entities/merge.rs"
click node_contradictions "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/safety/contradiction.rs"
click node_safety "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/safety/service.rs"
click node_photos "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/photo/worker.rs"
click node_database "https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/db.rs"

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_desktop_app,node_desktop_api,node_review_ui,node_user toneBlue
class node_rest,node_grpc toneAmber
class node_ingest,node_adapters,node_extraction,node_units,node_library,node_graph,node_projects toneMint
class node_cluster,node_entities,node_contradictions,node_safety,node_photos toneRose
class node_database,node_ollama toneIndigo
```

## Components

### Desktop app

- [Desktop interface](https://github.com/joeydd032995-pixel/gather/blob/main/apps/desktop/src/App.tsx): `apps/desktop/src/App.tsx`
- [Desktop API client](https://github.com/joeydd032995-pixel/gather/blob/main/apps/desktop/src/api.ts): `apps/desktop/src/api.ts`
- [Review tray](https://github.com/joeydd032995-pixel/gather/blob/main/apps/desktop/src/ReviewTray.tsx): `apps/desktop/src/ReviewTray.tsx`

### API surfaces

- [REST routes](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/routes/mod.rs): `daemon/src/routes/mod.rs`
- [gRPC services](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/grpc/pipeline.rs): `daemon/src/grpc/pipeline.rs`

### Knowledge pipeline

- [Ingestion](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/routes/ingest.rs): `daemon/src/routes/ingest.rs`
- [Format adapters](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/adapters/mod.rs): `daemon/src/adapters/mod.rs`
- [Extraction worker](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/extract/mod.rs): `daemon/src/extract/mod.rs`
- [Atomic units](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/extract/mod.rs): `daemon/src/extract/mod.rs`
- [Library and search](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/library.rs): `daemon/src/library.rs`
- [Knowledge graph](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/routes/query.rs): `daemon/src/routes/query.rs`
- [Project organization](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/projects/mod.rs): `daemon/src/projects/mod.rs`

### Organization and safety

- [Topic clustering](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/cluster/worker.rs): `daemon/src/cluster/worker.rs`
- [Entity resolution](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/entities/merge.rs): `daemon/src/entities/merge.rs`
- [Contradiction scanner](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/safety/contradiction.rs): `daemon/src/safety/contradiction.rs`
- [Semantic safety](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/safety/service.rs): `daemon/src/safety/service.rs`
- [Photo processing](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/photo/worker.rs): `daemon/src/photo/worker.rs`

### Persistence

- [PostgreSQL store](https://github.com/joeydd032995-pixel/gather/blob/main/daemon/src/db.rs): `daemon/src/db.rs`

### Other components

- **User**
- **Optional Ollama**

## Connections

- User → Desktop interface: uses
- Desktop interface → Desktop API client: requests data (evidence: `apps/desktop/src/App.tsx`)
- Desktop API client → REST routes: calls REST
- REST routes → Ingestion: routes uploads (evidence: `daemon/src/routes/mod.rs`)
- gRPC services → Ingestion: delegates ingestion
- Ingestion → Format adapters: parses exports (evidence: `daemon/src/routes/ingest.rs`)
- Ingestion → PostgreSQL store: stores artifacts (evidence: `daemon/src/routes/ingest.rs`)
- PostgreSQL store → Extraction worker: provides pending content (evidence: `daemon/src/extract/mod.rs`)
- Extraction worker → Atomic units: extracts units (evidence: `daemon/src/extract/mod.rs`)
- Extraction worker → Optional Ollama: optionally extracts
- Atomic units → PostgreSQL store: persists provenance
- REST routes → Library and search: serves search
- Library and search → PostgreSQL store: reads artifacts
- Atomic units → Knowledge graph: links entities
- Atomic units → Contradiction scanner: scans conflicts
- Atomic units → Topic clustering: groups topics
- Topic clustering → Entity resolution: resolves duplicates
- User → Review tray: corrects decisions
- Review tray → Desktop API client: submits actions (evidence: `apps/desktop/src/ReviewTray.tsx`)
- gRPC services → Review tray: serves review actions
- Contradiction scanner → Semantic safety: records decisions
- Photo processing → PostgreSQL store: reads and updates photos (evidence: `daemon/src/photo/worker.rs`)
- Project organization → PostgreSQL store: stores project data
- User → Project organization: imports folders
- User → Photo processing: imports photos
