AI Chat for your Trilium share pages — drop-in widget, tool-using agent #9650
mrbeandev
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A small open-source project I built and wanted to share — fully complementary to the recent in-app AI chat work (#9602): this one lives on the public share page, not inside the Trilium app.
What it does
search_notes(query)andread_note(noteId)) to navigate your whole shared tree — only fetches relevant notes into context, so token usage stays loweven on a 500-note KB
How it works
Single JS file dropped into Trilium via
~shareJsrelation. On first message it walks your shared tree using the public/share/api/notes/:idendpoint, builds an in-memory index,and injects a Table of Contents into the system prompt. The AI then drills in via tool calls.
The widget mounts inside a Shadow DOM so its styles can't bleed into your docs page (and vice versa).
Setup
5 steps, no build step, no dependencies. Replace one
ROOT_NOTE_IDconstant, add~shareJs(inheritable), done.Full instructions, screenshots, and provider examples in the README.
Repo
https://github.com/mrbeandev/trilium-ai-agent — MIT.
Feedback / issues / PRs welcome. Especially curious if there's interest in something like this getting bundled into TriliumNext share itself eventually.
Beta Was this translation helpful? Give feedback.
All reactions