| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .gitignore | ||
| BOOK-NOTES.md | ||
| CARDS.md | ||
| CLAUDE.md | ||
| CONVERT.md | ||
| NOTES.md | ||
| README.md | ||
| secrets.example.toml | ||
kioku
Docs an LLM assistant follows to edit the user's Trilium notes (via ETAPI) and Anki flashcards (via AnkiConnect) from a plain-language prompt.
Architecture
flowchart TD
subgraph localhost [User machine]
U[User prompt] --> L[LLM assistant]
L -->|reads| D[Docs in this repo]
L -->|reads| S[secrets.toml]
L -->|HTTP :8765| A[AnkiConnect]
A --> AN[Anki desktop app]
end
subgraph remote [Server: 10.100.0.1]
T[Trilium server :8067] --> FS[(/var/lib/trilium)]
SYNC[Anki sync server :27701]
end
L -->|HTTPS + ETAPI token| T
AN -.->|sync| SYNC
No daemon or sync loop: each prompt triggers one round of ETAPI/AnkiConnect calls, then the LLM is done until the next prompt.
- The user asks for a change in plain language.
- The LLM reads
secrets.tomlfor credentials and the relevant doc below for conventions — it doesn't invent formatting or structure. - Trilium edits go through ETAPI (search, read, create, patch, PUT content).
- Anki edits go through AnkiConnect; if Anki isn't running, the LLM launches it.
- Bulk/destructive edits trigger an ETAPI backup first, retrieved over SSH.
Why not RAG
Source material is read in full per generation pass, not retrieved by chunk. RAG pays off when a corpus can't fit in context and only a few chunks matter per query; here the goal is full syllabus coverage, where a retriever's imperfect recall would silently leave gaps before an exam. A course's material is a few thousand to tens of thousands of tokens — well within context, and cheaper than a vector index. RAG would make sense if the corpus grew to every course's bibliography and the task became one-off Q&A instead of exhaustive note generation.
Repo contents
CLAUDE.md— credentials layout, Trilium deployment, ETAPI endpoints and note type/mime scheme, backup procedure, AnkiConnect setup.NOTES.md— Trilium note style (headings, bold, lists, math, tables).BOOK-NOTES.md— procedure for generating notes from a book/bibliography source.CARDS.md— flashcard rules: formula cards, deck/subdeck organization, the "Programming" note type for exact-syntax recall.CONVERT.md— legacy HTML-to-Markdown note conversion procedure and gotchas.secrets.example.toml— tracked template forsecrets.toml(gitignored).
Trilium
Self-hosted, exposed at https://notes.yhkze.net1. The local desktop app is a sync client only, not the source of truth.
All edits go through ETAPI (<trilium.url>/etapi, Authorization: <trilium.token>). SSH access
to the server is used only to retrieve backup files.
Note type/mime determines handling:
code+text/x-markdown— plain Markdown, the standard format going forward.text+text/html— legacy CKEditor rich text; referenceCONVERT.mdto migrate.canvas+application/json— Excalidraw scenes, left untouched.docand therootnoteId — system notes, skipped.
Anki
Anki runs as a Flatpak (net.ankiweb.Anki) with AnkiConnect exposing http://localhost:8765.
All flashcard reads/writes go through AnkiConnect.
If AnkiConnect is unreachable, the LLM launches Anki into a silent Hyprland special workspace2:
hyprctl dispatch exec "[workspace special silent] flatpak run net.ankiweb.Anki"
A self-hosted sync server3 syncs collections between devices. It's unrelated to AnkiConnect: AnkiConnect talks to the local collection regardless of how it's synced elsewhere.
Credentials
secrets.toml (gitignored) holds trilium.url, trilium.token (an ETAPI token from Trilium's
Options → ETAPI menu), and anki.url. secrets.example.toml is the tracked template.
-
Deployed via
git.yhkze.net/yuuhikaze/nixos/modules/features/trilium-server.nixon10.100.0.1, port 8067 behind traefik, data in/var/lib/trilium. ↩︎ -
Workspace mechanism configured in
git.yhkze.net/yuuhikaze/nixos/modules/features/hyprland.nix. ↩︎ -
git.yhkze.net/yuuhikaze/nixos/modules/features/anki-sync-server.nix. ↩︎