Skip to content

Build your personal knowledge base with Trilium Notes

docs(user): start offering information about the new AI implementation

Elian Doran7a4114c2c0e5
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/AI.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/AI.html
index e5000ac9fd..0b0c7ce532 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/AI.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/AI.html
@@ -1,3 +1,10 @@
+<aside class="admonition warning">
+ <p>This feature is currently marked as experimental. While it is functional,
+ we do expect that the user interface might change or we might add or remove
+ some features related to it.</p>
+</aside>
+<h2>History</h2>
+<h3>Removal in v0.102.0</h3>
<p>Starting with version v0.102.0, AI/LLM integration has been removed from
the Trilium Notes core.</p>
<p>While a significant amount of effort went into developing this feature,
@@ -6,6 +13,106 @@
of the dedicated chat window they will be turned to a normal&nbsp;<a class="reference-link"
href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;note, revealing the underlying
JSON of the conversation.</p>
+<h3>Reintroduction in v0.103.0</h3>
+<p>Given the recent advancements of the AI scene, we decided to give the
+ LLM integration another try. v0.103.0 introduces a completely new chat
+ system.</p>
+<p>One of the key changes that lead to the reimplementation is that now we
+ are using a library (<a href="https://github.com/vercel/ai">Vercel AI</a>)
+ to manage the inner mechanism and the differences between LLM providers
+ instead of having to implement it on our own.</p>
+<h2>Feature highlights</h2>
+<ul>
+ <li>Chat-based interface with live streaming of the messages.</li>
+ <li>Provides the AI context with the note currently being looked at.</li>
+ <li>Tools to alter note content, create new notes, etc.</li>
+ <li>Statistics regarding context window use and pricing per message.</li>
+ <li>Optional MCP to allow external chat tools (e.g. Claude Code) to operate
+ on notes within Trilium.</li>
+</ul>
+<h2>LLM Providers</h2>
+<h3>Cloud providers</h3>
+<p>Currently, only three cloud providers are supported:</p>
+<ul>
+ <li><a href="https://platform.claude.com/settings/workspaces/default/keys">Anthropic</a>
+ </li>
+ <li>OpenAI</li>
+ <li>Gemini</li>
+</ul>
+<p>For all the providers, an API key is needed. Note that this is charged
+ separately from the subscription you might already have (e.g. Claude Pro).
+ If that might be a problem, consider using the MCP server and connecting
+ it to your agent (e.g. Claude Code).</p>
+<aside class="admonition note">
+ <p>We don't plan to support all cloud providers, even if the library we are
+ using would theoretically support them. Before opening a PR adding support
+ for a different cloud provider, make sure to discuss it over GitHub discussions.</p>
+</aside>
+<h3>Self-hosted providers</h3>
+<p>You might have noticed that there are no self-hosted solutions supported
+ by the AI integration. The reasoning is that currently the self-hosted
+ alternatives require additional integrations (for example a web search
+ tool) or provide low-quality results (e.g. hallucinating tool calls) that
+ would otherwise degrade the experience of the chat.</p>
+<aside class="admonition note">
+ <p>We do plan to support self-hosted AI solutions in future versions.</p>
+</aside>
+<h2>Enabling the AI integration</h2>
+<p>Because it is an experimental feature, enabling the AI integration is
+ a two-step process:</p>
+<ol>
+ <li>Go to&nbsp;<a class="reference-link" href="#root/_help_4TIF1oA4VQRO">Options</a>&nbsp;→ <em>Advanced</em> and
+ check <em>AI / LLM Chat</em> in the <em>Experimental Options</em> section.</li>
+ <li>Go to&nbsp;<a class="reference-link" href="#root/_help_4TIF1oA4VQRO">Options</a>&nbsp;→ <em>AI / LLM</em> and
+ configure a new provider.</li>
+</ol>
+<h2>Creating a new chat</h2>
+<p>There are two different chat interfaces:</p>
+<ul>
+ <li>One in the sidebar.</li>
+ <li>A dedicated note type.</li>
+</ul>
+<h3>The sidebar interface</h3>
+<p>Once the AI integration is activated, a <em>Chat</em> entry will appear
+ in the&nbsp;<a class="reference-link" href="#root/_help_RnaPdbciOfeq">Right Sidebar</a>.</p>
+<ul>
+ <li>Unlike the dedicated note type, the side bar has optional access to the
+ current note, making it easy to ask for information or modifications to
+ a note without having to search for the note first.
+ <ul>
+ <li>To toggle whether the current note is visible to the AI, simply click
+ on the file icon at the bottom of the chat interface.</li>
+ </ul>
+ </li>
+ <li>On the top-right of the sidebar there are three buttons:
+ <ul>
+ <li>Create a new conversation.</li>
+ <li>Go to a previous conversation</li>
+ <li>Save the current conversation as a dedicated note in the&nbsp;<a class="reference-link"
+ href="#root/_help_l0tKav7yLHGF">Day Notes</a>, which turns it into a dedicated
+ chat note.</li>
+ </ul>
+ </li>
+</ul>
+<aside class="admonition note">
+ <p>The sidebar chats are stored in the&nbsp;<a class="reference-link" href="#root/_help_2mUhVmZK8RF3">Hidden Notes</a>&nbsp;and
+ can be seen in the <em>AI Chat History</em> section.</p>
+</aside>
+<h3>The dedicated note type</h3>
+<p>The dedicated chat note is similar to the sidebar interface, but it makes
+ longer conversations more comfortable to read.</p>
+<p>Unlike the sidebar, the AI will not be aware of the current note it's
+ in.</p>
+<h2>Web search</h2>
+<p>The AI can optionally search the web to find more information about a
+ specific topic.&nbsp;</p>
+<p>This feature is on by default but it can easily be disabled by clicking
+ on the model selector at the bottom of the chat and unchecking <em>Web search</em>.</p>
+<h2>Tools</h2>
+<p>Tools allow the agentic AI to understand and operate on notes directly
+ within your Trilium instance.</p>
+<p>This feature is on by default but it can easily be disabled by clicking
+ on the model selector at the bottom of the chat and unchecking <em>Note access</em>.</p>
<h2>Alternative solutions (MCP)</h2>
<p>Given the recent advancements of the AI scene, MCP has grown to be more
powerful and facilitates easier integrations with various application.</p>
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html
index 280bf77957..a49fed6d2a 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html
@@ -32,122 +32,122 @@
<p>The following features are supported by Trilium's Markdown format and
will show up in the preview pane:</p>
<ul>
- <li>All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes).</li>
- <li
- >Basic HTML is also supported (e.g. collapsible blocks using <code spellcheck="false">&lt;details&gt;</code> and
- <code
- spellcheck="false">&lt;summary&gt;</code>).</li>
- <li>Code blocks with syntax highlight.
- <ul>
- <li>The language must be specified for syntax highlight to be applied (e.g.
- <code
- spellcheck="false">```js</code>).</li>
- <li>Code blocks will respect the text wrapping from the&nbsp;<a class="reference-link"
- href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_iPIMuisry3hd">Text</a>&nbsp;section
- in&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_4TIF1oA4VQRO">Options</a>.</li>
- </ul>
- </li>
- <li><a class="reference-link" href="#root/_help_NwBbFdNZ9h7O">Block quotes &amp; admonitions</a>
- </li>
- <li><a class="reference-link" href="#root/_help_YfYAtQBcfo5V">Math Equations</a>&nbsp;(both
- inline and block)</li>
- <li><a class="reference-link" href="#root/_help_s1aBHPd79XYj">Mermaid Diagrams</a>&nbsp;using
+ <li>
+ <p>All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes).</p>
+ </li>
+ <li>
+ <p>Basic HTML is also supported (e.g. collapsible blocks using <code spellcheck="false">&lt;details&gt;</code> and
+ <code
+ spellcheck="false">&lt;summary&gt;</code>).</p>
+ </li>
+ <li>
+ <p>Code blocks with syntax highlight.</p>
+ <ul>
+ <li>The language must be specified for syntax highlight to be applied (e.g.
<code
- spellcheck="false">```mermaid</code>
- </li>
- <li>
- <p><a class="reference-link" href="#root/_help_nBAXQFj20hS1">Include Note</a>&nbsp;(no
- built-in Markdown syntax, but HTML syntax works just fine):</p><pre><code class="language-text-html">&lt;section class="include-note" data-note-id="vJDjQm0VK8Na" data-box-size="expandable"&gt;
+ spellcheck="false">```js</code>).</li>
+ <li>Code blocks will respect the text wrapping from the&nbsp;<a class="reference-link"
+ href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;section in&nbsp;<a class="reference-link"
+ href="#root/_help_4TIF1oA4VQRO">Options</a>.</li>
+ </ul>
+ </li>
+ <li>
+ <p><a class="reference-link" href="#root/_help_NwBbFdNZ9h7O">Block quotes &amp; admonitions</a>
+ </p>
+ </li>
+ <li>
+ <p><a class="reference-link" href="#root/_help_YfYAtQBcfo5V">Math Equations</a>&nbsp;(both
+ inline and block)</p>
+ </li>
+ <li>
+ <p><a class="reference-link" href="#root/_help_s1aBHPd79XYj">Mermaid Diagrams</a>&nbsp;using
+ <code
+ spellcheck="false">```mermaid</code>
+ </p>
+ </li>
+ <li>
+ <p><a class="reference-link" href="#root/_help_nBAXQFj20hS1">Include Note</a>&nbsp;(no
+ built-in Markdown syntax, but HTML syntax works just fine):</p><pre><code class="language-text-html">&lt;section class="include-note" data-note-id="vJDjQm0VK8Na" data-box-size="expandable"&gt;
&amp;nbsp;
&lt;/section&gt;</code></pre>
- <ul>
- <li>These can also be quickly created via the <code spellcheck="false">/include</code> command
- or via a dedicated keyboard shortcut (not assigned by default).</li>
- </ul>
- </li>
- <li>
- <p><a class="reference-link" href="#root/_help_hrZ1D00cLbal">Internal (reference) links</a>&nbsp;via
- its HTML syntax, or through a <em>Wikilinks</em>-like format (only&nbsp;
- <a
- class="reference-link" href="#root/_help_m1lbrzyKDaRB">Note ID</a>):</p><pre><code class="language-text-x-markdown">[[Hg8TS5ZOxti6]]</code></pre>
- </li>
- <li>
- <p><a class="reference-link" href="#root/_help_AgjCISero73a">Footnotes</a>&nbsp;are
- also supported via the corresponding Markdown syntax:</p><pre><code class="language-text-x-markdown">This is [^1], while this is [^2].
+ <ul>
+ <li>These can also be quickly created via the <code spellcheck="false">/include</code> command
+ or via a dedicated keyboard shortcut (not assigned by default).</li>
+ </ul>
+ </li>
+ <li>
+ <p><a class="reference-link" href="#root/_help_hrZ1D00cLbal">Internal (reference) links</a>&nbsp;via
+ its HTML syntax, or through a <em>Wikilinks</em>-like format (only&nbsp;
+ <a
+ class="reference-link" href="#root/_help_m1lbrzyKDaRB">Note ID</a>):</p><pre><code class="language-text-x-gfm">[[Hg8TS5ZOxti6]]</code></pre>
+ </li>
+ <li>
+ <p><a class="reference-link" href="#root/_help_AgjCISero73a">Footnotes</a>&nbsp;are
+ also supported via the corresponding Markdown syntax:</p><pre><code class="language-text-x-gfm">This is [^1], while this is [^2].
[^1]: the first footnote
[^2]: the second footnote</code></pre>
- <ul>
- <li>These can also be quickly created using the <code spellcheck="false">/footnote</code> command.</li>
- </ul>
- </li>
+ <ul>
+ <li>These can also be quickly created using the <code spellcheck="false">/footnote</code> command.</li>
+ </ul>
+ </li>
</ul>
<h3>Links</h3>
<p>Multiple types of links are supported:</p>
<ul>
<li>
- <p>Web URLs can be written with the standard Markdown syntax:</p><pre><code class="language-text-x-markdown">[Wikipedia](https://www.wikipedia.org)</code></pre>
+ <p>Web URLs can be written with the standard Markdown syntax:</p><pre><code class="language-text-x-gfm">[Wikipedia](https://www.wikipedia.org)</code></pre>
</li>
<li>
- <p><a href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/iPIMuisry3hd/QEAPj01N5f7w/_help_hrZ1D00cLbal">Reference link</a> to
- other notes with dynamic title, either by manually entering the note ID
- or via the <em>Add link</em> dialog:</p><pre><code class="language-text-x-markdown">[[B9oMG6rFvvfq]]</code></pre>
+ <p><a href="#root/_help_hrZ1D00cLbal">Reference link</a> to other notes with dynamic
+ title, either by manually entering the note ID or via the <em>Add link</em> dialog:</p><pre><code class="language-text-x-gfm">[[B9oMG6rFvvfq]]</code></pre>
</li>
<li>
- <p><a href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/iPIMuisry3hd/QEAPj01N5f7w/_help_hrZ1D00cLbal">Reference link</a> to
- other notes with a custom text:</p><pre><code class="language-text-x-markdown">[This is a link](#root/LhtnZxtVsUMp)</code></pre>
+ <p><a href="#root/_help_hrZ1D00cLbal">Reference link</a> to other notes with a custom
+ text:</p><pre><code class="language-text-x-gfm">[This is a link](#root/LhtnZxtVsUMp)</code></pre>
</li>
</ul>
<p>To create a link, either:</p>
<ul>
<li>Type it manually using the syntax described above.</li>
- <li>Use the <em>Add link</em> dialog by pressing <kbd spellcheck="false">Ctrl</kbd>+
- <kbd
- spellcheck="false">L</kbd>or typing the <code spellcheck="false">/link</code> command.</li>
+ <li>Use the <em>Add link</em> dialog by pressing <kbd>Ctrl</kbd>+<kbd>L</kbd> or
+ typing the <code spellcheck="false">/link</code> command.</li>
</ul>
<h3>Keyboard shortcuts</h3>
<p>The Markdown notes share some of the keyboard shortcuts from&nbsp;<a class="reference-link"
- href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_iPIMuisry3hd">Text</a>&nbsp;notes:</p>
+ href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;notes:</p>
<ul>
- <li><em>Cut to note</em> (<kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">X</kbd>)
- which cuts the selection into a new child note.</li>
- <li><em>Add link</em> (<kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">L</kbd>)
- which shows the dialog to create external or reference links.</li>
- <li><em>Insert date/time</em> (<kbd spellcheck="false">Alt</kbd>+<kbd spellcheck="false">T</kbd>)
- which respects the same formatting as text notes.</li>
+ <li><em>Cut to note</em> (<kbd>Ctrl</kbd>+<kbd>X</kbd>) which cuts the selection
+ into a new child note.</li>
+ <li><em>Add link</em> (<kbd>Ctrl</kbd>+<kbd>L</kbd>) which shows the dialog
+ to create external or reference links.</li>
+ <li><em>Insert date/time</em> (<kbd>Alt</kbd>+<kbd>T</kbd>) which respects
+ the same formatting as text notes.</li>
<li><em>Include note</em> (not assigned by default), which triggers the same
dialog to insert notes as the one for text notes.</li>
</ul>
<p>In addition, the following formatting keyboard shortcuts are available:</p>
<ul>
- <li><kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">B</kbd> to toggle <strong>bold</strong>.</li>
- <li
- ><kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">I</kbd> to toggle <em>italic</em>.</li>
- <li
- ><kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">M</kbd> to wrap
- the current selection in an inline math (<code spellcheck="false">$</code>).</li>
- <li
- ><kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">Shift</kbd>+
- <kbd
- spellcheck="false">X</kbd>to toggle <del>strikethrough</del>.</li>
+ <li><kbd>Ctrl</kbd>+<kbd>B</kbd> to toggle <strong>bold</strong>.</li>
+ <li><kbd>Ctrl</kbd>+<kbd>I</kbd> to toggle <em>italic</em>.</li>
+ <li><kbd>Ctrl</kbd>+<kbd>M</kbd> to wrap the current selection in an inline
+ math (<code spellcheck="false">$</code>).</li>
+ <li><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>X</kbd> to toggle <del>strikethrough</del>.</li>
</ul>
<h3>Images &amp; attachments</h3>
<p>Images can be inserted into the document in four different methods:</p>
<ul>
<li>Drag &amp; drop directly into the editor area.</li>
<li>Pasting an image from clipboard.</li>
- <li>Pasting a reference to another <a href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/BFs8mudNFgCS/_help_0vhv7lsOLy82">attachment</a> (e.g. <em>Copy reference to clipboard</em> button).</li>
- <li
- >Use the <code spellcheck="false">/image</code> slash command.</li>
+ <li>Pasting a reference to another <a href="#root/_help_0vhv7lsOLy82">attachment</a> (e.g. <em>Copy reference to clipboard</em> button).</li>
+ <li>Use the <code spellcheck="false">/image</code> slash command.</li>
</ul>
-<p>An image reference to an attachment looks like this:</p><pre><code class="language-text-x-markdown">![Name.jpeg](api/attachments/z50RceuHXe9J/image/image)</code></pre>
+<p>An image reference to an attachment looks like this:</p><pre><code class="language-text-x-gfm">![Name.jpeg](api/attachments/z50RceuHXe9J/image/image)</code></pre>
<h3>Slash commands</h3>
-<p>Just like&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_iPIMuisry3hd">Text</a>&nbsp;notes,
+<p>Just like&nbsp;<a class="reference-link" href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;notes,
Markdown notes support a selection of slash commands:</p>
<ul>
- <li>Creating <a href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/iPIMuisry3hd/_help_NwBbFdNZ9h7O">admonitions</a> (e.g.
- <code
- spellcheck="false">/tip</code>)</li>
+ <li>Creating <a href="#root/_help_NwBbFdNZ9h7O">admonitions</a> (e.g. <code spellcheck="false">/tip</code>)</li>
<li>Uploading images (<code spellcheck="false">/image</code>).</li>
<li>Inserting the current date &amp; time (<code spellcheck="false">/date</code>).</li>
</ul>
@@ -174,8 +174,7 @@
<ol>
<li>Create a new note (e.g. in the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>)
and select the type <em>Markdown</em>, just like all the other note types.</li>
- <li
- >Create a note of type&nbsp;<a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;and
+ <li>Create a note of type&nbsp;<a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;and
select as the language either <em>Markdown</em> or <em>GitHub-Flavored Markdown</em>.
This maintains compatibility with your existing notes prior to the introduction
of this feature.</li>
@@ -212,7 +211,7 @@
as handling of attachments).</p>
<p>When exporting Markdown files as ZIP, choosing HTML or Markdown as the
export format makes no difference as that only affects&nbsp;<a class="reference-link"
- href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_iPIMuisry3hd">Text</a>&nbsp;notes.</p>
+ href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;notes.</p>
<p>If the Markdown note contains attachments, a ZIP export will rewrite the
links to attachments so that they are replaced with a relative path to
the attachment. On import, the links are re-written back.</p>
diff --git a/docs/Developer Guide/Developer Guide/Documentation.md b/docs/Developer Guide/Developer Guide/Documentation.md
index 3d4d679ce7..213a0d1cee 100644
--- a/docs/Developer Guide/Developer Guide/Documentation.md
+++ b/docs/Developer Guide/Developer Guide/Documentation.md
@@ -1,5 +1,5 @@
# Documentation
-There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/KmFCFBKmAztv/Documentation_image.png" width="205" height="162">
+There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/24IJrYQ9gXia/Documentation_image.png" width="205" height="162">
* The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing <kbd>F1</kbd>.
* The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers.
diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json
index dc4f88ff7a..81388a15f0 100644
--- a/docs/User Guide/!!!meta.json
+++ b/docs/User Guide/!!!meta.json
@@ -11142,94 +11142,108 @@
{
"type": "relation",
"name": "internalLink",
- "value": "NwBbFdNZ9h7O",
+ "value": "4TIF1oA4VQRO",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
- "value": "YfYAtQBcfo5V",
+ "value": "NwBbFdNZ9h7O",
"isInheritable": false,
"position": 60
},
{
"type": "relation",
"name": "internalLink",
- "value": "s1aBHPd79XYj",
+ "value": "YfYAtQBcfo5V",
"isInheritable": false,
"position": 70
},
{
"type": "relation",
"name": "internalLink",
- "value": "nBAXQFj20hS1",
+ "value": "s1aBHPd79XYj",
"isInheritable": false,
"position": 80
},
{
"type": "relation",
"name": "internalLink",
- "value": "hrZ1D00cLbal",
+ "value": "nBAXQFj20hS1",
"isInheritable": false,
"position": 90
},
{
"type": "relation",
"name": "internalLink",
- "value": "m1lbrzyKDaRB",
+ "value": "hrZ1D00cLbal",
"isInheritable": false,
"position": 100
},
{
"type": "relation",
"name": "internalLink",
- "value": "AgjCISero73a",
+ "value": "m1lbrzyKDaRB",
"isInheritable": false,
"position": 110
},
{
"type": "relation",
"name": "internalLink",
- "value": "BFvAtE74rbP6",
+ "value": "AgjCISero73a",
"isInheritable": false,
"position": 120
},
{
"type": "relation",
"name": "internalLink",
- "value": "RnaPdbciOfeq",
+ "value": "0vhv7lsOLy82",
"isInheritable": false,
"position": 130
},
{
"type": "relation",
"name": "internalLink",
- "value": "IjZS7iK5EXtb",
+ "value": "BFvAtE74rbP6",
"isInheritable": false,
"position": 140
},
{
"type": "relation",
"name": "internalLink",
- "value": "R9pX4DGra2Vt",
+ "value": "RnaPdbciOfeq",
"isInheritable": false,
"position": 150
},
{
"type": "relation",
"name": "internalLink",
- "value": "wy8So3yZZlH9",
+ "value": "IjZS7iK5EXtb",
"isInheritable": false,
"position": 160
},
{
"type": "relation",
"name": "internalLink",
- "value": "oPVyFC7WL2Lp",
+ "value": "R9pX4DGra2Vt",
"isInheritable": false,
"position": 170
},
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "wy8So3yZZlH9",
+ "isInheritable": false,
+ "position": 180
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "oPVyFC7WL2Lp",
+ "isInheritable": false,
+ "position": 190
+ },
{
"type": "label",
"name": "iconClass",
@@ -11243,20 +11257,6 @@
"value": "markdown",
"isInheritable": false,
"position": 40
- },
- {
- "type": "relation",
- "name": "internalLink",
- "value": "0vhv7lsOLy82",
- "isInheritable": false,
- "position": 180
- },
- {
- "type": "relation",
- "name": "internalLink",
- "value": "4TIF1oA4VQRO",
- "isInheritable": false,
- "position": 190
}
],
"format": "markdown",
@@ -16461,6 +16461,34 @@
"isInheritable": false,
"position": 10
},
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "4TIF1oA4VQRO",
+ "isInheritable": false,
+ "position": 20
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "RnaPdbciOfeq",
+ "isInheritable": false,
+ "position": 30
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "l0tKav7yLHGF",
+ "isInheritable": false,
+ "position": 40
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "2mUhVmZK8RF3",
+ "isInheritable": false,
+ "position": 50
+ },
{
"type": "label",
"name": "shareAlias",
diff --git a/docs/User Guide/User Guide/AI.md b/docs/User Guide/User Guide/AI.md
index 8c848f1163..3e55a63903 100644
--- a/docs/User Guide/User Guide/AI.md
+++ b/docs/User Guide/User Guide/AI.md
@@ -1,10 +1,99 @@
# AI
+> [!WARNING]
+> This feature is currently marked as experimental. While it is functional, we do expect that the user interface might change or we might add or remove some features related to it.
+
+## History
+
+### Removal in v0.102.0
+
Starting with version v0.102.0, AI/LLM integration has been removed from the Trilium Notes core.
While a significant amount of effort went into developing this feature, maintaining and supporting it long-term proved to be unsustainable.
When upgrading to v0.102.0, your Chat notes will be preserved, but instead of the dedicated chat window they will be turned to a normal <a class="reference-link" href="Note%20Types/Code.md">Code</a> note, revealing the underlying JSON of the conversation.
+### Reintroduction in v0.103.0
+
+Given the recent advancements of the AI scene, we decided to give the LLM integration another try. v0.103.0 introduces a completely new chat system.
+
+One of the key changes that lead to the reimplementation is that now we are using a library ([Vercel AI](https://github.com/vercel/ai)) to manage the inner mechanism and the differences between LLM providers instead of having to implement it on our own.
+
+## Feature highlights
+
+* Chat-based interface with live streaming of the messages.
+* Provides the AI context with the note currently being looked at.
+* Tools to alter note content, create new notes, etc.
+* Statistics regarding context window use and pricing per message.
+* Optional MCP to allow external chat tools (e.g. Claude Code) to operate on notes within Trilium.
+
+## LLM Providers
+
+### Cloud providers
+
+Currently, only three cloud providers are supported:
+
+* [Anthropic](https://platform.claude.com/settings/workspaces/default/keys)
+* OpenAI
+* Gemini
+
+For all the providers, an API key is needed. Note that this is charged separately from the subscription you might already have (e.g. Claude Pro). If that might be a problem, consider using the MCP server and connecting it to your agent (e.g. Claude Code).
+
+> [!NOTE]
+> We don't plan to support all cloud providers, even if the library we are using would theoretically support them. Before opening a PR adding support for a different cloud provider, make sure to discuss it over GitHub discussions.
+
+### Self-hosted providers
+
+You might have noticed that there are no self-hosted solutions supported by the AI integration. The reasoning is that currently the self-hosted alternatives require additional integrations (for example a web search tool) or provide low-quality results (e.g. hallucinating tool calls) that would otherwise degrade the experience of the chat.
+
+> [!NOTE]
+> We do plan to support self-hosted AI solutions in future versions.
+
+## Enabling the AI integration
+
+Because it is an experimental feature, enabling the AI integration is a two-step process:
+
+1. Go to <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Advanced_ and check _AI / LLM Chat_ in the _Experimental Options_ section.
+2. Go to <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _AI / LLM_ and configure a new provider.
+
+## Creating a new chat
+
+There are two different chat interfaces:
+
+* One in the sidebar.
+* A dedicated note type.
+
+### The sidebar interface
+
+Once the AI integration is activated, a _Chat_ entry will appear in the <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar.md">Right Sidebar</a>.
+
+* Unlike the dedicated note type, the side bar has optional access to the current note, making it easy to ask for information or modifications to a note without having to search for the note first.
+ * To toggle whether the current note is visible to the AI, simply click on the file icon at the bottom of the chat interface.
+* On the top-right of the sidebar there are three buttons:
+ * Create a new conversation.
+ * Go to a previous conversation
+ * Save the current conversation as a dedicated note in the <a class="reference-link" href="Advanced%20Usage/Advanced%20Showcases/Day%20Notes.md">Day Notes</a>, which turns it into a dedicated chat note.
+
+> [!NOTE]
+> The sidebar chats are stored in the <a class="reference-link" href="Advanced%20Usage/Hidden%20Notes.md">Hidden Notes</a> and can be seen in the _AI Chat History_ section.
+
+### The dedicated note type
+
+The dedicated chat note is similar to the sidebar interface, but it makes longer conversations more comfortable to read.
+
+Unlike the sidebar, the AI will not be aware of the current note it's in.
+
+## Web search
+
+The AI can optionally search the web to find more information about a specific topic. 
+
+This feature is on by default but it can easily be disabled by clicking on the model selector at the bottom of the chat and unchecking _Web search_.
+
+## Tools
+
+Tools allow the agentic AI to understand and operate on notes directly within your Trilium instance.
+
+This feature is on by default but it can easily be disabled by clicking on the model selector at the bottom of the chat and unchecking _Note access_.
+
## Alternative solutions (MCP)
Given the recent advancements of the AI scene, MCP has grown to be more powerful and facilitates easier integrations with various application.
diff --git a/docs/User Guide/User Guide/Note Types/Markdown.md b/docs/User Guide/User Guide/Note Types/Markdown.md
index f628a86e6e..175920c997 100644
--- a/docs/User Guide/User Guide/Note Types/Markdown.md
+++ b/docs/User Guide/User Guide/Note Types/Markdown.md
@@ -27,6 +27,7 @@ The following features are supported by Trilium's Markdown format and will show
* All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes).
* Basic HTML is also supported (e.g. collapsible blocks using `<details>` and `<summary>`).
* Code blocks with syntax highlight.
+
* The language must be specified for syntax highlight to be applied (e.g. ` ```js `).
* Code blocks will respect the text wrapping from the <a class="reference-link" href="Text.md">Text</a> section in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a>.
* <a class="reference-link" href="Text/Block%20quotes%20%26%20admonitions.md">Block quotes &amp; admonitions</a>
@@ -43,12 +44,12 @@ The following features are supported by Trilium's Markdown format and will show
* These can also be quickly created via the `/include` command or via a dedicated keyboard shortcut (not assigned by default).
* <a class="reference-link" href="Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> via its HTML syntax, or through a _Wikilinks_\-like format (only <a class="reference-link" href="../Advanced%20Usage/Note%20ID.md">Note ID</a>):
- ```markdown
+ ```gfm
[[Hg8TS5ZOxti6]]
```
* <a class="reference-link" href="Text/Footnotes.md">Footnotes</a> are also supported via the corresponding Markdown syntax:
- ```markdown
+ ```gfm
This is [^1], while this is [^2].
[^1]: the first footnote
@@ -63,40 +64,40 @@ Multiple types of links are supported:
* Web URLs can be written with the standard Markdown syntax:
- ```markdown
+ ```gfm
[Wikipedia](https://www.wikipedia.org)
```
* [Reference link](Text/Links/Internal%20\(reference\)%20links.md) to other notes with dynamic title, either by manually entering the note ID or via the _Add link_ dialog:
- ```markdown
+ ```gfm
[[B9oMG6rFvvfq]]
```
* [Reference link](Text/Links/Internal%20\(reference\)%20links.md) to other notes with a custom text:
- ```markdown
+ ```gfm
[This is a link](#root/LhtnZxtVsUMp)
```
To create a link, either:
* Type it manually using the syntax described above.
-* Use the _Add link_ dialog by pressing <kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">L</kbd> or typing the `/link` command.
+* Use the _Add link_ dialog by pressing <kbd>Ctrl</kbd>+<kbd>L</kbd> or typing the `/link` command.
### Keyboard shortcuts
The Markdown notes share some of the keyboard shortcuts from <a class="reference-link" href="Text.md">Text</a> notes:
-* _Cut to note_ (<kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">X</kbd>) which cuts the selection into a new child note.
-* _Add link_ (<kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">L</kbd>) which shows the dialog to create external or reference links.
-* _Insert date/time_ (<kbd spellcheck="false">Alt</kbd>+<kbd spellcheck="false">T</kbd>) which respects the same formatting as text notes.
+* _Cut to note_ (<kbd>Ctrl</kbd>+<kbd>X</kbd>) which cuts the selection into a new child note.
+* _Add link_ (<kbd>Ctrl</kbd>+<kbd>L</kbd>) which shows the dialog to create external or reference links.
+* _Insert date/time_ (<kbd>Alt</kbd>+<kbd>T</kbd>) which respects the same formatting as text notes.
* _Include note_ (not assigned by default), which triggers the same dialog to insert notes as the one for text notes.
In addition, the following formatting keyboard shortcuts are available:
-* <kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">B</kbd> to toggle **bold**.
-* <kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">I</kbd> to toggle _italic_.
-* <kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">M</kbd> to wrap the current selection in an inline math (`$`).
-* <kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">Shift</kbd>+<kbd spellcheck="false">X</kbd> to toggle ~~strikethrough~~.
+* <kbd>Ctrl</kbd>+<kbd>B</kbd> to toggle **bold**.
+* <kbd>Ctrl</kbd>+<kbd>I</kbd> to toggle _italic_.
+* <kbd>Ctrl</kbd>+<kbd>M</kbd> to wrap the current selection in an inline math (`$`).
+* <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>X</kbd> to toggle ~~strikethrough~~.
### Images & attachments
@@ -109,7 +110,7 @@ Images can be inserted into the document in four different methods:
An image reference to an attachment looks like this:
-```markdown
+```gfm
![Name.jpeg](api/attachments/z50RceuHXe9J/image/image)
```