Trilium AI Agent
May 4, 2026 ยท View on GitHub
A floating chat widget that turns your Trilium Notes share page into an AI-assisted docs site. One JS file, no build step.
Install (5 steps)
Requires TriliumNext โฅ 0.91.
-
Find your shared root note's ID. Right-click it in Trilium โ Copy note ID. Or grab it from the share URL (
/share/<this-id>). -
Create a code/JavaScript note. Paste the contents of
widget.js. -
Edit the script. Near the top, set:
const ROOT_NOTE_ID = "your-root-note-id"; -
Hide the JS note from the public sidebar. On it, add label:
#shareHiddenFromTree -
Wire it up. On your shared root note, add a relation:
- Name:
shareJs - Target: the JS note
- Inheritable: yes โ required, or it won't load on child notes
- Name:
Hard-refresh your share page. A ๐ฌ bubble appears bottom-right.
Use it
- Click the bubble โ enter your API key (Gemini works out of the box; any OpenAI-compatible provider works too)
- Ask anything about your docs
- The AI uses tools to search and read only the relevant notes
Optional: nicer code blocks
If your docs have code samples, code-blocks.css adds a Tokyo Night dark palette. Same install pattern: code/CSS note + #shareHiddenFromTree + inheritable ~shareCss relation on the shared root.
More
FEATURES.mdโ full feature list, provider examples, architecture, troubleshooting- MIT License