# 260614 — Trilium (TriliumNext) deep dive (note cloning, attribute inheritance, HTML-native) Date: 2026-06-14 ## What this is A focused study of **Trilium / TriliumNext** — the open-source hierarchical personal knowledge base — read through shard-wiki's lens. It is another SQLite-local note app, but it brings a structural feature **none of the prior twelve systems had: note cloning** — a single note can sit in **multiple places in the tree at once**, so the hierarchy is a **DAG, not a tree**, with **note identity cleanly separated from placement** (a note has many "branches"). It also has an **attribute system with inheritance + templates** (computed metadata) and is one of the few **HTML-native** (not Markdown) tools. Lineage: **TriliumNext** is the community fork of the original **Trilium** (zadam, now maintenance-only) — the same pattern as TWiki→Foswiki. Distinctive material: - **Architecture** — single **SQLite** file (`document.db`); desktop or self-host server; multi-instance **sync protocol w/ conflict resolution** + WebSocket; 12-char IDs (`noteId`/`branchId`/`attributeId`/`attachmentId`) - **Note cloning** — note vs **branch** (identity vs placement); DAG hierarchy; no single canonical path - **Attributes** — labels (`#tag`) + typed relations (`~relation`), **inheritable** + **templates** (`~template`) → effective vs own metadata - **Content** — **HTML** (CKEditor5), plus canvas/mindmap/spreadsheet/geo/render note types; export to MD/HTML (lossy) - **Extension** — **scripting** (frontend/backend code notes, Script API) + **ETAPI** (token REST); **per-note encryption** (protected notes) ## Contents | Path | Role | |------|------| | `findings.md` | Architecture, note cloning/DAG, attributes+inheritance, HTML content, scripting/ETAPI, per-note encryption, capability profile, INTENT mapping, UC seeds, sources | ## Status Initial deep dive complete. Two new use cases promoted to `spec/UseCaseCatalog.md` (UC-66 attach a shard with a DAG hierarchy / note cloning, identity separated from placement; UC-67 preserve inherited/templated attributes — effective vs own metadata); UC-15/22/34/ 38/42/61 enriched. Logged for `SHARD-WP-0002` (T11/T12/T14/T15/T16): DAG namespace + identity/placement (note/branch) split, computed/inherited metadata in the page model, **per-item** content opacity (refining the 12th spectrum), HTML as a source content model, and scripting + ETAPI host surfaces. **Key takeaways recorded:** Trilium's **note/branch split (identity ≠ placement)** is the clean model for pages that live in multiple locations/shards and the namespace-level form of the clone/reference primitive; metadata is **computed** (own + inherited + template), not a flat bag; and **content opacity is per-item** (per-note encryption), not only whole-shard. **Boundary:** one SQLite-local candidate shard (DAG hierarchy, HTML-native), best attached via ETAPI; not a substrate and not the federation layer.