Skip to content

Build your personal knowledge base with Trilium Notes

feat(llm): hide notes from the AI chat and MCP server with #excludeFromLlm

BeatLinkc6a4a88f11f3
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index c960572213..b9cc51b54a 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -683,6 +683,7 @@
"execute_button": "Title of the button which will execute the current code note.",
"execute_description": "Longer description of the current code note displayed together with the execute button.",
"exclude_from_note_map": "Notes with this label will be hidden from the Note Map.",
+ "exclude_from_llm": "Hides this note from the AI chat and the MCP server. Make the label inheritable to hide the notes below it as well.",
"new_notes_on_top": "New notes will be created at the top of the parent note, not on the bottom.",
"run_on_note_creation": "Executes when note is created on backend. Use this relation if you want to run the script for all notes created under a specific subtree. In that case, create it on the subtree root note and make it inheritable. A new note created within the subtree (any depth) will trigger the script.",
"run_on_child_note_creation": "Executes when new note is created under the note where this relation is defined.",
diff --git a/apps/client/src/widgets/attribute_widgets/attr_help.ts b/apps/client/src/widgets/attribute_widgets/attr_help.ts
index f4b9e2ed17..ce4713077d 100644
--- a/apps/client/src/widgets/attribute_widgets/attr_help.ts
+++ b/apps/client/src/widgets/attribute_widgets/attr_help.ts
@@ -68,6 +68,7 @@ export const ATTR_HELP: AttrHelpMap = {
executeButton: t("attribute_detail.execute_button"),
executeDescription: t("attribute_detail.execute_description"),
excludeFromNoteMap: t("attribute_detail.exclude_from_note_map"),
+ excludeFromLlm: t("attribute_detail.exclude_from_llm"),
newNotesOnTop: t("attribute_detail.new_notes_on_top"),
printLandscape: t("attribute_detail.print_landscape"),
printPageSize: t("attribute_detail.print_page_size"),
diff --git a/apps/server/src/assets/help/help_content.json b/apps/server/src/assets/help/help_content.json
index 30aa628e69..1efdf39af6 100644
--- a/apps/server/src/assets/help/help_content.json
+++ b/apps/server/src/assets/help/help_content.json
@@ -198,7 +198,7 @@
"_help_AlhDUqhENtH7": "<p>It is possible to provide a CSS file to be used regardless of the theme set by the user.</p><p>The quickest way to create one is <em>Insert child note</em> → <em>Code</em> → <em>Custom CSS</em> in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_YtSN43OrfzaA\">Note tree contextual menu</a>.</p><p>Alternatively, create a&nbsp;<a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a>&nbsp;note manually, set the language to CSS and apply the <code>#appCss</code> label.</p><h2>Seeing the changes</h2><p>Adding a new <em>app CSS note</em> or modifying an existing one does not immediately apply changes. To see the changes, press Ctrl+Shift+R to refresh the page first.</p><h2>Sample use cases</h2><h3>Customizing the printing stylesheet</h3><aside class=\"admonition tip\"><p>Since v0.99.2, it's no longer possible to use <code>#appCss</code> to customize the printing CSS, since the printing is now done in an isolated environment.</p><p>However, it's still possible to customize the CSS via <code>~printCss</code>; see&nbsp;<a class=\"reference-link\" href=\"#root/_help_NRnIZmSMc5sj\">Printing &amp; Exporting as PDF</a>&nbsp;for more information.</p></aside><h3>Per-workspace styles</h3><p>When using&nbsp;<a class=\"reference-link\" href=\"#root/_help_9sRHySam5fXb\">Workspaces</a>, it can be helpful to create a visual distinction between notes in different workspaces.</p><p>To do so:</p><ol><li>In the note with <code>#workspace</code>, add an inheritable attribute <code>#cssClass(inheritable)</code> with a value that uniquely identifies the workspace (say <code>my-workspace</code>).</li><li>Anywhere in the note structure, create a CSS note with <code>#appCss</code>.</li></ol><h4>Change the color of the icons in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a></h4><pre><code class=\"language-text-x-trilium-auto\">.fancytree-node.my-workspace.fancytree-custom-icon {\n color: #ff0000;\n}</code></pre><h4>Change the color of the note title and the icon</h4><p>To change the color of the note title and the icon (above the content):</p><pre><code class=\"language-text-x-trilium-auto\">.note-split.my-workspace .note-icon-widget button.note-icon,\n.note-split.my-workspace .note-title-widget input.note-title {\n color: #ff0000;\n}</code></pre><h4>Add a watermark to the note content</h4><figure class=\"image image-style-align-right image_resized\" style=\"width:39.97%;\"><img style=\"aspect-ratio:641/630;\" src=\"{{helpAssets}}/User%20Guide/Theme%20development/Custom%20app-wide%20CSS_image.png\" width=\"641\" height=\"630\"></figure><ol><li>Insert an image in any note and take the URL of the image.</li><li>Use the following CSS, adjusting the <code>background-image</code> and <code>width</code> and <code>height</code> to the desired values.</li></ol><pre><code class=\"language-text-x-trilium-auto\">.note-split.my-workspace .scrolling-container:after {\n position: fixed;\n content: \"\";\n background-image: url(\"/api/attachments/Rvm3zJNITQI1/image/logo.png\");\n background-size: contain;\n background-position: center;\n background-repeat: no-repeat;\n width: 237px;\n height: 44px;\n bottom: 1em;\n right: 1em;\n opacity: 0.5;\n z-index: 0;\n}</code></pre><h2>Limitations</h2><p>Some parts of the application can't be styled directly via custom CSS because they are rendered in an isolated mode (shadow DOM), more specifically:</p><ul><li>The slides in a&nbsp;<a class=\"reference-link\" href=\"#root/_help_zP3PMqaG71Ct\">Presentation</a>.</li></ul>",
"_help_g1mlRoU8CsqC": "<aside class=\"admonition note\"><p>This page explains, step‑by‑step, how to create a custom icon pack. For a general description of how to use already existing icon packs, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_gOKqSJgXLcIj\">Icon Packs</a>.</p></aside><p>First read the quick flow to get the overall steps. After that there is a concrete example (Phosphor) with a small Node.js script you can run to generate the manifest.</p><h2>Quick flow (what you need to do)</h2><ol><li>Verify the icon set is a font (one of: .woff2, .woff, .ttf).</li><li>Obtain a list that maps icon names to Unicode code points (often provided as a JSON like <code>selection.json</code> or a CSS file).</li><li>Create a manifest JSON that maps icon ids to glyphs and search terms.</li><li>Create a Trilium note of type Code, set language to JSON, paste the manifest as the note content.</li><li>Upload the font file as an attachment to the same note (MIME type must be <code>font/woff2</code>, <code>font/woff</code>, or <code>font/ttf</code> and role <code>file</code>).</li><li>Add the label <code>#iconPack=&lt;prefix&gt;</code> to the note (prefix: letters, digits, hyphen, underscore and non-ASCII characters only).</li><li>Refresh the client and verify the icon pack appears in the icon selector.</li></ol><h2>Verify the icon set</h2><p>The first step is to analyze if the icon set being packed can be integrated into Trilium.</p><p>Trilium only supports <strong>font-based icon sets</strong>, with the following formats:</p><figure class=\"table\"><table><thead><tr><th>Extension</th><th>MIME type</th><th>Description</th></tr></thead><tbody><tr><td><code>.woff2</code></td><td><code>font/woff2</code></td><td>Recommended due to great compression (low size).</td></tr><tr><td><code>.woff</code></td><td><code>font/woff</code></td><td>Higher compatibility, but the font file is bigger.</td></tr><tr><td><code>.ttf</code></td><td><code>font/ttf</code></td><td>Most common, but highest font size.</td></tr></tbody></table></figure><p>Trilium <strong>does not</strong> support the following formats:</p><ul><li>SVG-based fonts.</li><li>Individual SVGs.</li><li><code>.eot</code> fonts (legacy and proprietary).</li><li>Duotone icons, since it requires a special CSS format that Trilium doesn't support.</li><li>Any other font format not specified in the <em>Supported formats</em> section.</li></ul><p>In this case, the font must be manually converted to one of the supported formats (ideally <code>.woff2</code>).</p><h2>Manifest format</h2><p>The manifest is a JSON object with an <code>icons</code> map. Each entry key is the CSS/class id you will use (Trilium uses the CSS class when rendering). Value object:</p><ul><li>glyph: the single character (the glyph) — can be the escaped Unicode (e.g. \"\\ue9c2\") or the literal character.</li><li>terms: array of search aliases; the first term is used as display name in the selector.</li></ul><p>Example minimal manifest:</p><pre><code class=\"language-text-x-trilium-auto\">{\n \"icons\": {\n \"ph-acorn\": {\n \"glyph\": \"\\uea3f\",\n \"terms\": [\"acorn\", \"nut\"]\n },\n \"ph-book\": {\n \"glyph\": \"\\uea40\",\n \"terms\": [\"book\", \"read\"]\n }\n }\n}</code></pre><aside class=\"admonition note\"><ul><li>You can supply glyph as the escaped <code>\\uXXXX</code> sequence or as the actual UTF‑8 character. The CSS form (<code>\\ea3f</code>, as written in a stylesheet's <code>content</code>) is accepted too, so glyphs copied out of the font's own CSS work as they stand.</li><li>It is also possible to use the unescaped glyph inside the JSON. It will appear strange (e.g. ), but it will be rendered properly regardless.</li><li>The manifest keys (e.g. <code>ph-acorn</code>) should match the class names used by the font (prefix + name is a common pattern).</li><li>Like the prefix, a manifest key becomes a CSS class name, so it can contain only letters, digits, hyphens, underscores and non-ASCII characters. Punctuation and whitespace (e.g. <code>ph.acorn</code> or <code>ph acorn</code>) are not usable as class names; icons with such a key are skipped and an error is logged in&nbsp;<a class=\"reference-link\" href=\"#root/_help_bnyigUA2UK7s\">Backend (server) logs</a>, while the rest of the pack still loads.</li></ul></aside><h2>Concrete example: Phosphor Icons</h2><p><a href=\"https://phosphoricons.com/\">Phosphor Icons</a> provide a <code>selection.json</code> that includes <code>properties.code</code> (the codepoint) and <code>properties.name</code> (the icon name). The goal: convert that into Trilium's manifest.</p><p>Sample <code>selection.json</code> excerpt:</p><pre><code class=\"language-text-x-trilium-auto\">{\n \"icons\": [\n {\n \"icon\": {\n \"paths\": [ /* [...] */ ],\n \"grid\": 0,\n \"attrs\": [{}],\n \"isMulticolor\": false,\n \"isMulticolor2\": false,\n \"tags\": [\"acorn\"]\n },\n \"attrs\": [{}],\n \"properties\": {\n \"id\": 0,\n \"order\": 1513,\n \"name\": \"acorn\",\n \"code\": 60314,\n \"ligatures\": \"acorn\",\n \"prevSize\": 16\n },\n \"setIdx\": 0,\n \"setId\": 0,\n \"iconIdx\": 0\n },\n /* [...] */\n ]\n}</code></pre><details class=\"trilium-collapsible\" open=\"\"><summary>A tiny Node.js script to produce the manifest</summary><p>Place <code>selection.json</code> in the same directory and run with Node 20+):</p><pre><code class=\"language-text-javascript\">import { join } from \"node:path\";\nimport { readFileSync, writeFileSync } from \"node:fs\";\n\nfunction processIconPack(packName) {\n const path = join(packName);\n const selectionMeta = JSON.parse(readFileSync(join(path, \"selection.json\"), \"utf-8\"));\n const icons = {};\n\n for (const icon of selectionMeta.icons) {\n let name = icon.properties.name;\n if (name.endsWith(`-${packName}`)) {\n name = name.split(\"-\").slice(0, -1).join(\"-\");\n }\n\n const id = `ph-${name}`;\n icons[id] = {\n glyph: `${String.fromCharCode(icon.properties.code)}`,\n terms: [ name ]\n };\n }\n\n writeFileSync(\"manifest.json\", JSON.stringify(icons, null, 2), \"utf8\");\n console.log(\"manifest.json created\");\n}\n\nprocessIconPack(\"light\");</code></pre><p>What to do with the script:</p><ul><li>Put <code>selection.json</code> and <code>build-manifest.js</code> in a folder.</li><li>Run: node build-manifest.js</li><li>The script writes <code>manifest.json</code> — open it, verify contents, then copy into a Trilium Code note (language: JSON).</li></ul></details><aside class=\"admonition tip\"><p><strong>Mind the escape format when processing CSS</strong></p><p>The Unicode escape syntax is different in CSS (<code>\"\\ea3f\"</code>) when compared to JSON (<code>\"\\uea3f\"</code>). Notice how the JSON escape is <code>\\u</code> and not <code>\\</code>. Both forms are accepted: keep the CSS escape by writing the backslash itself as <code>\"\\\\ea3f\"</code> in the JSON, or convert it to the JSON escape <code>\"\\uea3f\"</code>.</p><p>As a more compact alternative, provide the un-escaped character directly, as UTF-8 is supported.</p></aside><h3>Assigning the prefix</h3><p>Before an icon pack can be used, it needs to have a prefix defined. This prefix uniquely identifies the icon pack so that it can be used throughout the application.</p><p>To do so, Trilium makes use of the same format that was used for the internal icon pack (Boxicons). For example, when an icon from Boxicons is set, it looks like this: <code>#iconClass=\"bx bxs-sushi\"</code>. In this case, the icon pack prefix is <code>bx</code> and the icon class name is <code>bxs-sushi</code>.</p><p>In order for an icon pack to be recognized, the prefix must be specified in the <code>#iconPack</code> label.&nbsp;</p><p>For our example with Phosphor Icons, we can use the <code>ph</code> prefix since it also matches the prefix set in the original CSS. So in this case it would be <code>#iconPack=ph</code>.</p><aside class=\"admonition important\"><p>The prefix must consist of only letters, digits, hyphens, underscores and non-ASCII characters. If the prefix doesn't match these constraints, the icon pack will be ignored and an error will be logged in&nbsp;<a class=\"reference-link\" href=\"#root/_help_bnyigUA2UK7s\">Backend (server) logs</a>.</p></aside><h2>Creating the Trilium icon pack note</h2><ol><li>Create a note of type <em>Code</em>.</li><li>Set the language to <em>JSON</em>.</li><li>Rename the note. The name of the note will also be the name of the icon pack as displayed in the list of icons.</li><li>Copy and paste the manifest generated in the previous step as the content of this note.</li><li>Go to the <a href=\"#root/_help_0vhv7lsOLy82\">note attachment</a> and upload the font file (in <code>.woff2</code>, <code>.woff</code>, <code>.ttf</code>) format.<ol><li>Trilium identifies the font to use from attachments via the MIME type, make sure the MIME type is displayed correctly after uploading the attachment (for example <code>font/woff2</code>).</li><li>Make sure the <code>role</code> appears as <code>file</code>, otherwise the font will not be identified.</li><li>Multiple attachments are supported, but only one font will actually be used in Trilium's order of preference: <code>.woff2</code>, <code>.woff</code>, <code>.ttf</code>. As such, there's not much reason to upload more than one font per icon pack.</li></ol></li><li>Add label: <code>#iconPack=&lt;prefix&gt;</code> (for Phosphor example: <code>#iconPack=ph</code>).</li></ol><h3>Final steps</h3><ul><li><a href=\"#root/_help_s8alTXmpFR61\">Refresh the client</a><ul><li>Change the icon of the note and look for the <em>Filter</em> icon in the top-right side.</li><li>Check if the new icon pack is displayed there and click on it to see the full list of icons.</li><li>Go through most of the items to look for issues such as missing icon, wrong names (some icons have aliases/terms that can cause issues).</li></ul></li><li>Optionally, assign an icon from the new icon pack to this note. This icon will be used in the icon pack filter for a visual distinction.</li><li>The icon pack can then be <a href=\"#root/_help_mHbBMPDPkVV5\">exported as ZIP</a> in order to be distributed to other users.<ul><li>It's important to note that icon packs are considered “unsafe” by default, so “Safe mode” must be disabled when importing the ZIP.</li><li>Consider linking new users to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_gOKqSJgXLcIj\">Icon Packs</a>&nbsp;documentation in order to understand how to import and use an icon pack.</li></ul></li></ul><h3>Troubleshooting</h3><p>If the icon pack doesn't show up, look through the&nbsp;<a class=\"reference-link\" href=\"#root/_help_bnyigUA2UK7s\">Backend (server) logs</a>&nbsp;for clues.</p><ul><li>One example is if the font could not be retrieved: <code>ERROR: Icon pack is missing WOFF/WOFF2/TTF attachment: Boxicons v3 400 (dup) (XRzqDQ67fHEK)</code>.</li><li>Make sure the prefix is unique and not already taken by some other icon pack. When there are two icon packs with the same prefix, only one is used. The server logs will indicate if this situation occurs.</li><li>Make sure the prefix consists only of letters, digits, hyphens, underscores and non-ASCII characters.</li><li>If the pack loads but individual icons are missing, check the logs for <code>Skipping icon '&lt;key&gt;' of icon pack</code> — that key uses characters outside the allowed set and needs renaming in the manifest.</li></ul>",
"_help_zEY4DaJG4YT5": "<figure class=\"image\"><img style=\"aspect-ratio:1071/146;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Attributes_image.png\" width=\"1071\" height=\"146\"></figure><p>In Trilium, attributes are key-value pairs assigned to notes, providing additional metadata or functionality. There are two primary types of attributes:</p><ol><li><p><a class=\"reference-link\" href=\"#root/_help_HI6GBBIduIgv\">Labels</a>&nbsp;can be used for a variety of purposes, such as storing metadata or configuring the behavior of notes. Labels are also searchable, enhancing note retrieval.</p><p>For more information, including predefined labels, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_HI6GBBIduIgv\">Labels</a>.</p></li><li><p><a class=\"reference-link\" href=\"#root/_help_Cq5X6iKQop6R\">Relations</a>&nbsp;define connections between notes, similar to links. These can be used for metadata and scripting purposes.</p><p>For more information, including a list of predefined relations, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_Cq5X6iKQop6R\">Relations</a>.</p></li></ol><p>These attributes play a crucial role in organizing, categorizing, and enhancing the functionality of notes.</p><h2>Types of attributes</h2><p>Conceptually there are two types of attributes (applying to both labels and relations):</p><ol><li><strong>System attributes</strong><br>As the name suggest, these attributes have a special meaning since they are interpreted by Trilium. For example the <code>color</code> attribute will change the color of the note as displayed in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;and links, and <code>iconClass</code> will change the icon of a note.</li><li><strong>User-defined attributes</strong><br>These are free-form labels or relations that can be used by the user. They can be used purely for categorization purposes (especially if combined with&nbsp;<a class=\"reference-link\" href=\"#root/_help_eIg8jdvaoNNd\">Search</a>), or they can be given meaning through the use of&nbsp;<a class=\"reference-link\" href=\"#root/_help_CdNpE2pqjmI6\">Scripting</a>.</li></ol><p>In practice, Trilium makes no direct distinction of whether an attribute is a system one or a user-defined one. A label or relation is considered a system attribute if it matches one of the built-in names (e.g. like the aforementioned <code>iconClass</code>). Keep this in mind when creating &nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;in order not to accidentally alter a system attribute (unless intended).</p><h2>Viewing the list of attributes</h2><p>Both the labels and relations for the current note are displayed in:</p><ul><li>The&nbsp;<a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>, in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_uNtgN0cUKEBc\">Attributes tab</a>&nbsp;with a grid-like view.</li><li>A more advanced option, in&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>&nbsp;→&nbsp;<span class=\"tn-icon bx bx-list-check\"></span> (<em>Attributes</em>) where the attributes are displayed in a textual way, making it easy to copy them around or make batch modifications.<ul><li>In the list of attributes, labels are prefixed with the <code>#</code> character whereas relations are prefixed with the <code>~</code> character.</li></ul></li></ul><h2>Attribute Definitions and Promoted Attributes</h2><p><a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;create a form-like editing experience for attributes, which makes it easy to enhancing the organization and management of attributes</p><h2>Multiplicity</h2><p>Attributes in Trilium can be \"multi-valued\", meaning multiple attributes with the same name can co-exist. This can be combined with&nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;to easily add them.</p><h2>Attribute Inheritance</h2><p>Trilium supports attribute inheritance, allowing child notes to inherit attributes from their parents. For more information, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_bwZpz2ajCEwO\">Attribute Inheritance</a>.</p>",
- "_help_HI6GBBIduIgv": "<p>A label is an <a href=\"#root/_help_zEY4DaJG4YT5\">attribute</a> of a note which has a name and optionally a value.</p><h2>Common use cases</h2><ul><li><strong>Metadata for personal use</strong>: Assign labels with optional values for categorization, such as <code>#year=1999</code>, <code>#genre=\"sci-fi\"</code>, or <code>#author=\"Neal Stephenson\"</code>. This can be combined with&nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;to make their display more user-friendly.</li><li><strong>Configuration</strong>: Labels can configure advanced features or settings (see reference below).</li><li><strong>Scripts and Plugins</strong>: Used to tag notes with special metadata, such as the \"weight\" attribute in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_R7abl2fc6Mxi\">Weight Tracker</a>.</li></ul><h2>Creating a label using the visual editor</h2><ol><li>Go to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_uNtgN0cUKEBc\">Attributes tab</a>&nbsp;in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>.</li><li>Press the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> (Add attribute) button at the end of the list, or via the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> button at the top-right of the section → <em>Add new label</em>.</li></ol><p>While in the visual editor:</p><ul><li>Set the desired name.</li><li>Optionally, set the value of the label. Labels can exist without a value.</li><li>Children can inherit this relation, click the relation and check <em>Inheritable</em>. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_bwZpz2ajCEwO\">Attribute Inheritance</a>&nbsp;for more information.</li></ul><aside class=\"admonition tip\"><p>Alternatively, press <kbd>Alt</kbd>+<kbd>L</kbd> which will open the attribute details (same view as when an existing attribute is clicked) in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>.</p></aside><h2>Creating a label manually</h2><p>In the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>, press the&nbsp;<span class=\"tn-icon bx bx-list-check\"></span> button to show the list of the attributes.</p><ul><li>Click the input box to focus it.</li><li>To create a label called <code>myLabel</code> with no value, simply type <code>#myLabel</code>.</li><li>To create a label called <code>myLabel</code> with a value <code>value</code>, simply type <code>#myLabel=value</code>.</li><li>If the value contains spaces, then the text must be quoted: <code>#myLabel=\"Hello world\"</code>.</li><li>If the string contains quotes (regardless of whether it has spaces), then the text must be quoted with apostrophes instead: <code>#myLabel='Hello \"world\"'</code>.</li><li>To create an inheritable label called <code>myLabel</code>, simply write <code>#myLabel(inheritable)</code> for no value or <code>#myLabel(inheritable)=value</code> if there is a value.</li></ul><h2>Predefined labels</h2><p>This is a list of labels that Trilium natively supports.</p><aside class=\"admonition tip\"><p>Some labels presented here end with a <code>*</code>. That means that there are multiple labels with the same prefix, consult the specific page linked in the description of that label for more information.</p></aside><figure class=\"table\"><table><thead><tr><th>Label</th><th>Description</th></tr></thead><tbody><tr><td><code>disableVersioning</code></td><td>Disables automatic creation of&nbsp;<a class=\"reference-link\" href=\"#root/_help_vZWERwf8U3nx\">Note Revisions</a>&nbsp;for a particular note. Useful for e.g. large, but unimportant notes - e.g. large JS libraries used for scripting.</td></tr><tr><td><code>versioningLimit</code></td><td>Limits the maximum number of&nbsp;<a class=\"reference-link\" href=\"#root/_help_vZWERwf8U3nx\">Note Revisions</a>&nbsp;for a particular note, overriding the global settings.</td></tr><tr><td><code>calendarRoot</code></td><td>Marks the note which should be used as root for&nbsp;<a class=\"reference-link\" href=\"#root/_help_l0tKav7yLHGF\">Day Notes</a>. Only one should be marked as such.</td></tr><tr><td><code>archived</code></td><td>Hides notes from default search results and dialogs. Archived notes can optionally be hidden in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>.</td></tr><tr><td><code>excludeFromExport</code></td><td>Excludes this note and its children when exporting.</td></tr><tr><td><code>run</code>, <code>runOnInstance</code>, <code>runAtHour</code></td><td>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_GPERMystNGTB\">Backend Events</a>.</td></tr><tr><td><code>disableInclusion</code></td><td>Scripts with this label won't be included into parent script execution.</td></tr><tr><td><code>sorted</code>, <code>sortDirection</code>, <code>sortFoldersFirst</code>, <code>sortNatural</code>, <code>sortLocale</code>, <code>top</code>, <code>bottom</code></td><td>Manages automatic/permanent sorting. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_aGlEvb9hyDhS\">Sorting Notes</a>.</td></tr><tr><td><code>hidePromotedAttributes</code></td><td>Hide&nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;on this note. Generally useful when defining inherited attributes, but the parent note doesn't need them.</td></tr><tr><td><code>readOnly</code></td><td>Marks a note to always be <a href=\"#root/_help_CoFPLs3dRlXc\">read-only</a>, if it's a supported note (text, code, mermaid).</td></tr><tr><td><code>autoReadOnlyDisabled</code></td><td>Disables automatic <a href=\"#root/_help_CoFPLs3dRlXc\">read-only mode</a> for the given note.</td></tr><tr><td><code>appCss</code></td><td>Marks CSS notes which are loaded into the Trilium application and can thus be used to modify Trilium's looks. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlhDUqhENtH7\">Custom app-wide CSS</a>&nbsp;for more info.</td></tr><tr><td><code>appTheme</code></td><td>Marks CSS notes which are full Trilium themes and are thus available in Trilium options. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_pKK96zzmvBGf\">Theme development</a>&nbsp;for more information.</td></tr><tr><td><code>appThemeBase</code></td><td>Set to <code>next</code>, <code>next-light</code>, or <code>next-dark</code> to use the corresponding TriliumNext theme (auto, light or dark) as the base for a custom theme, instead of the legacy one. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_WFGzWeUK6arS\">Customize the Next theme</a>&nbsp;for more information.</td></tr><tr><td><code>customFont</code></td><td>Marks a font as selectable in the Options → Appearance font selection. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_w4rMEhJsALlA\">Personalizing the font</a>.</td></tr><tr><td><code>cssClass</code></td><td>Value of this label is then added as CSS class to the node representing given note in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>. This can be useful for advanced theming. Can be used in template notes.</td></tr><tr><td><code>iconClass</code></td><td>value of this label is added as a CSS class to the icon on the tree which can help visually distinguish the notes in the tree. Example might be bx bx-home - icons are taken from boxicons. Can be used in template notes.</td></tr><tr><td><code>pageSize</code></td><td>Specifies the number of items per page in&nbsp;<a class=\"reference-link\" href=\"#root/_help_0ESUbbAxVnoK\">Note List</a>.</td></tr><tr><td><code>customRequestHandler</code></td><td>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_J5Ex1ZrMbyJ6\">Custom Request Handler</a>.</td></tr><tr><td><code>customResourceProvider</code></td><td>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_d3fAXQ2diepH\">Custom Resource Providers</a>.</td></tr><tr><td><code>widget</code></td><td>Marks this note as a custom widget which will be added to the Trilium component tree. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_MgibgPcfeuGz\">Custom Widgets</a>&nbsp;for more information.</td></tr><tr><td><code>searchHome</code></td><td>New search notes will be created as children of this note (see&nbsp;<a class=\"reference-link\" href=\"#root/_help_m523cpzocqaD\">Saved Search</a>).</td></tr><tr><td><code>workspace</code> and related attributes</td><td>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_9sRHySam5fXb\">Workspaces</a>.</td></tr><tr><td><code>inbox</code></td><td>Default inbox location for new notes. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_S0Fos78ZfcY7\">Note Inbox</a>&nbsp;for more information.</td></tr><tr><td><code>sqlConsoleHome</code></td><td>Default location of&nbsp;<a class=\"reference-link\" href=\"#root/_help_YKWqdJhzi2VY\">SQL Console</a>&nbsp;saved queries.</td></tr><tr><td><code>bookmarked</code></td><td>Indicates this note is a <a href=\"#root/_help_u3YFHC9tQlpm\">bookmark</a>.</td></tr><tr><td><code>bookmarkFolder</code></td><td>Note with this label will appear in bookmarks as folder (allowing access to its children). See&nbsp;<a class=\"reference-link\" href=\"#root/_help_u3YFHC9tQlpm\">Bookmarks</a>&nbsp;for more information.</td></tr><tr><td><code>share*</code></td><td>See the attribute reference in&nbsp;<a class=\"reference-link\" href=\"#root/_help_R9pX4DGra2Vt\">Sharing</a>.</td></tr><tr><td><code>displayRelations</code>, <code>hideRelations</code></td><td>Comma delimited names of relations which should be displayed/hidden in a&nbsp;<a class=\"reference-link\" href=\"#root/_help_iRwzGnHPzonm\">Relation Map</a>&nbsp;(both the note type and the&nbsp;<a class=\"reference-link\" href=\"#root/_help_BCkXAVs63Ttv\">Note Map (Link map, Tree map)</a>&nbsp;general functionality).</td></tr><tr><td><code>titleTemplate</code></td><td>Default title of notes created as children of this note. This value is evaluated as a JavaScript string and thus can be enriched with dynamic content via the injected <code>now</code> and <code>parentNote</code> variables.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> <br>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_47ZrP6FNuoG8\">Default Note Title</a>&nbsp;for more info.</td></tr><tr><td><code>template:titleTemplate</code></td><td>Set on a template note: default title of notes created from the template, taking precedence over the parent's <code>titleTemplate</code>. Evaluated the same way as <code>titleTemplate</code>. See <a class=\"reference-link\" href=\"#root/_help_47ZrP6FNuoG8\">Default Note Title</a>.</td></tr><tr><td><code>template</code></td><td>This note will appear in the selection of available template when creating new note. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>&nbsp;for more information.</td></tr><tr><td><code>color</code></td><td>defines color of the note in note tree, links etc. Use any valid CSS color value like 'red' or #a13d5f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>Note: this color may be automatically adjusted when displayed to ensure sufficient contrast with the background.</td></tr><tr><td><code>keyboardShortcut</code></td><td>Defines a keyboard shortcut which will immediately jump to this note. Example: 'ctrl+alt+e'. Requires frontend reload for the change to take effect.</td></tr><tr><td><code>keepCurrentHoisting</code></td><td>Opening this link won't change hoisting even if the note is not displayable in the current hoisted subtree.</td></tr><tr><td><code>executeButton</code></td><td>Title of the button which will execute the current code note</td></tr><tr><td><code>executeDescription</code></td><td>Longer description of the current code note displayed together with the execute button</td></tr><tr><td><code>excludeFromNoteMap</code></td><td>Notes with this label will be hidden from the&nbsp;<a class=\"reference-link\" href=\"#root/_help_bdUJEHsAPYQR\">Note Map</a>.</td></tr><tr><td><code>newNotesOnTop</code></td><td>New notes will be created at the top of the parent note, not on the bottom.</td></tr><tr><td><code>hideChildrenOverview</code></td><td>Hides the&nbsp;<a class=\"reference-link\" href=\"#root/_help_0ESUbbAxVnoK\">Note List</a>&nbsp;for that particular note.</td></tr><tr><td><code>subtreeHidden</code></td><td>Hides all child notes of this note from the tree, displaying a badge with the count of hidden children. Children remain accessible via search or direct links.</td></tr><tr><td><code>printLandscape</code></td><td>When exporting to PDF, changes the orientation of the page to landscape instead of portrait.</td></tr><tr><td><code>printPageSize</code></td><td>When exporting to PDF, changes the size of the page. Supported values: <code>A0</code>, <code>A1</code>, <code>A2</code>, <code>A3</code>, <code>A4</code>, <code>A5</code>, <code>A6</code>, <code>Legal</code>, <code>Letter</code>, <code>Tabloid</code>, <code>Ledger</code>.</td></tr><tr><td><code>printScale</code>, <code>printMargins</code></td><td>Additional printing options, generally configured through the&nbsp;<a class=\"reference-link\" href=\"#root/_help_NRnIZmSMc5sj\">Printing &amp; Exporting as PDF</a>&nbsp;dialog.</td></tr><tr><td><code>geolocation</code></td><td>Indicates the latitude and longitude of a note, to be displayed in a&nbsp;<a class=\"reference-link\" href=\"#root/_help_81SGnPGMk7Xc\">Geo Map</a>.</td></tr><tr><td><code>geoShape</code></td><td>Indicates the coordinates for the points of a <a href=\"#root/_help_C2H9HK4BzwG7\">shapec</a> drawn on the&nbsp;<a class=\"reference-link\" href=\"#root/_help_81SGnPGMk7Xc\">Geo Map</a>&nbsp;(e.g. area, rectangle, circle).</td></tr><tr><td><code>map:*</code></td><td>Defines specific options for the&nbsp;<a class=\"reference-link\" href=\"#root/_help_81SGnPGMk7Xc\">Geo Map</a>.</td></tr><tr><td><code>calendar:*</code></td><td>Defines specific options for the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xWbu3jpNWapp\">Calendar</a>.</td></tr><tr><td><code>viewType</code></td><td>Sets the view of child notes (e.g. grid or list). See&nbsp;<a class=\"reference-link\" href=\"#root/_help_0ESUbbAxVnoK\">Note List</a>&nbsp;for more information.</td></tr><tr><td><code>webViewSrc</code></td><td>Defines the URL of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_1vHRoWCEjj0L\">Web View</a>.</td></tr><tr><td><code>tabWidth</code>, <code>indentWithTabs</code>, <code>wrapLines</code></td><td>Per-note Code editor settings: indentation width, indent with tabs vs. spaces, and word wrapping. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a>.</td></tr><tr><td><code>datePattern</code>, <code>weekPattern</code>, <code>monthPattern</code>, <code>quarterPattern</code>, <code>yearPattern</code></td><td>Customizes the title naming pattern of day / week / month / quarter / year notes. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_l0tKav7yLHGF\">Day Notes</a>.</td></tr><tr><td><code>enableWeekNote</code>, <code>enableQuarterNote</code></td><td>Enables optional week and quarter notes in the calendar hierarchy; set on the calendar root. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_l0tKav7yLHGF\">Day Notes</a>.</td></tr><tr><td><code>fullContentWidth</code></td><td>Expands the note to the full editor width, ignoring the configured content width (useful for wide tables). See&nbsp;<a class=\"reference-link\" href=\"#root/_help_t596jLvPrqkS\">Content width</a>.</td></tr><tr><td><code>iconPack</code></td><td>Identifies a custom icon pack by its prefix. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_g1mlRoU8CsqC\">Creating an icon pack</a>.</td></tr><tr><td><code>clipperInbox</code></td><td>Overrides the default location where the Web Clipper saves clippings (defaults to the day note). See&nbsp;<a class=\"reference-link\" href=\"#root/_help_MtPxeAWVAzMg\">Web Clipper</a>.</td></tr><tr><td><code>docName</code> , <code>docUrl</code></td><td>Used internally for the in-app help.</td></tr><tr><td><code>aiQuickAction</code></td><td>Defines a custom prompt to be used for the&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>'s quick actions.</td></tr></tbody></table></figure>",
+ "_help_HI6GBBIduIgv": "<p>A label is an <a href=\"#root/_help_zEY4DaJG4YT5\">attribute</a> of a note which has a name and optionally a value.</p><h2>Common use cases</h2><ul><li><strong>Metadata for personal use</strong>: Assign labels with optional values for categorization, such as <code>#year=1999</code>, <code>#genre=\"sci-fi\"</code>, or <code>#author=\"Neal Stephenson\"</code>. This can be combined with&nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;to make their display more user-friendly.</li><li><strong>Configuration</strong>: Labels can configure advanced features or settings (see reference below).</li><li><strong>Scripts and Plugins</strong>: Used to tag notes with special metadata, such as the \"weight\" attribute in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_R7abl2fc6Mxi\">Weight Tracker</a>.</li></ul><h2>Creating a label using the visual editor</h2><ol><li>Go to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_uNtgN0cUKEBc\">Attributes tab</a>&nbsp;in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>.</li><li>Press the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> (Add attribute) button at the end of the list, or via the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> button at the top-right of the section → <em>Add new label</em>.</li></ol><p>While in the visual editor:</p><ul><li>Set the desired name.</li><li>Optionally, set the value of the label. Labels can exist without a value.</li><li>Children can inherit this relation, click the relation and check <em>Inheritable</em>. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_bwZpz2ajCEwO\">Attribute Inheritance</a>&nbsp;for more information.</li></ul><aside class=\"admonition tip\"><p>Alternatively, press <kbd>Alt</kbd>+<kbd>L</kbd> which will open the attribute details (same view as when an existing attribute is clicked) in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>.</p></aside><h2>Creating a label manually</h2><p>In the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>, press the&nbsp;<span class=\"tn-icon bx bx-list-check\"></span> button to show the list of the attributes.</p><ul><li>Click the input box to focus it.</li><li>To create a label called <code>myLabel</code> with no value, simply type <code>#myLabel</code>.</li><li>To create a label called <code>myLabel</code> with a value <code>value</code>, simply type <code>#myLabel=value</code>.</li><li>If the value contains spaces, then the text must be quoted: <code>#myLabel=\"Hello world\"</code>.</li><li>If the string contains quotes (regardless of whether it has spaces), then the text must be quoted with apostrophes instead: <code>#myLabel='Hello \"world\"'</code>.</li><li>To create an inheritable label called <code>myLabel</code>, simply write <code>#myLabel(inheritable)</code> for no value or <code>#myLabel(inheritable)=value</code> if there is a value.</li></ul><h2>Predefined labels</h2><p>This is a list of labels that Trilium natively supports.</p><aside class=\"admonition tip\"><p>Some labels presented here end with a <code>*</code>. That means that there are multiple labels with the same prefix, consult the specific page linked in the description of that label for more information.</p></aside><figure class=\"table\"><table><thead><tr><th>Label</th><th>Description</th></tr></thead><tbody><tr><td><code>disableVersioning</code></td><td>Disables automatic creation of&nbsp;<a class=\"reference-link\" href=\"#root/_help_vZWERwf8U3nx\">Note Revisions</a>&nbsp;for a particular note. Useful for e.g. large, but unimportant notes - e.g. large JS libraries used for scripting.</td></tr><tr><td><code>versioningLimit</code></td><td>Limits the maximum number of&nbsp;<a class=\"reference-link\" href=\"#root/_help_vZWERwf8U3nx\">Note Revisions</a>&nbsp;for a particular note, overriding the global settings.</td></tr><tr><td><code>calendarRoot</code></td><td>Marks the note which should be used as root for&nbsp;<a class=\"reference-link\" href=\"#root/_help_l0tKav7yLHGF\">Day Notes</a>. Only one should be marked as such.</td></tr><tr><td><code>archived</code></td><td>Hides notes from default search results and dialogs. Archived notes can optionally be hidden in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>.</td></tr><tr><td><code>excludeFromExport</code></td><td>Excludes this note and its children when exporting.</td></tr><tr><td><code>run</code>, <code>runOnInstance</code>, <code>runAtHour</code></td><td>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_GPERMystNGTB\">Backend Events</a>.</td></tr><tr><td><code>disableInclusion</code></td><td>Scripts with this label won't be included into parent script execution.</td></tr><tr><td><code>sorted</code>, <code>sortDirection</code>, <code>sortFoldersFirst</code>, <code>sortNatural</code>, <code>sortLocale</code>, <code>top</code>, <code>bottom</code></td><td>Manages automatic/permanent sorting. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_aGlEvb9hyDhS\">Sorting Notes</a>.</td></tr><tr><td><code>hidePromotedAttributes</code></td><td>Hide&nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;on this note. Generally useful when defining inherited attributes, but the parent note doesn't need them.</td></tr><tr><td><code>readOnly</code></td><td>Marks a note to always be <a href=\"#root/_help_CoFPLs3dRlXc\">read-only</a>, if it's a supported note (text, code, mermaid).</td></tr><tr><td><code>autoReadOnlyDisabled</code></td><td>Disables automatic <a href=\"#root/_help_CoFPLs3dRlXc\">read-only mode</a> for the given note.</td></tr><tr><td><code>appCss</code></td><td>Marks CSS notes which are loaded into the Trilium application and can thus be used to modify Trilium's looks. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlhDUqhENtH7\">Custom app-wide CSS</a>&nbsp;for more info.</td></tr><tr><td><code>appTheme</code></td><td>Marks CSS notes which are full Trilium themes and are thus available in Trilium options. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_pKK96zzmvBGf\">Theme development</a>&nbsp;for more information.</td></tr><tr><td><code>appThemeBase</code></td><td>Set to <code>next</code>, <code>next-light</code>, or <code>next-dark</code> to use the corresponding TriliumNext theme (auto, light or dark) as the base for a custom theme, instead of the legacy one. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_WFGzWeUK6arS\">Customize the Next theme</a>&nbsp;for more information.</td></tr><tr><td><code>customFont</code></td><td>Marks a font as selectable in the Options → Appearance font selection. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_w4rMEhJsALlA\">Personalizing the font</a>.</td></tr><tr><td><code>cssClass</code></td><td>Value of this label is then added as CSS class to the node representing given note in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>. This can be useful for advanced theming. Can be used in template notes.</td></tr><tr><td><code>iconClass</code></td><td>value of this label is added as a CSS class to the icon on the tree which can help visually distinguish the notes in the tree. Example might be bx bx-home - icons are taken from boxicons. Can be used in template notes.</td></tr><tr><td><code>pageSize</code></td><td>Specifies the number of items per page in&nbsp;<a class=\"reference-link\" href=\"#root/_help_0ESUbbAxVnoK\">Note List</a>.</td></tr><tr><td><code>customRequestHandler</code></td><td>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_J5Ex1ZrMbyJ6\">Custom Request Handler</a>.</td></tr><tr><td><code>customResourceProvider</code></td><td>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_d3fAXQ2diepH\">Custom Resource Providers</a>.</td></tr><tr><td><code>widget</code></td><td>Marks this note as a custom widget which will be added to the Trilium component tree. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_MgibgPcfeuGz\">Custom Widgets</a>&nbsp;for more information.</td></tr><tr><td><code>searchHome</code></td><td>New search notes will be created as children of this note (see&nbsp;<a class=\"reference-link\" href=\"#root/_help_m523cpzocqaD\">Saved Search</a>).</td></tr><tr><td><code>workspace</code> and related attributes</td><td>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_9sRHySam5fXb\">Workspaces</a>.</td></tr><tr><td><code>inbox</code></td><td>Default inbox location for new notes. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_S0Fos78ZfcY7\">Note Inbox</a>&nbsp;for more information.</td></tr><tr><td><code>sqlConsoleHome</code></td><td>Default location of&nbsp;<a class=\"reference-link\" href=\"#root/_help_YKWqdJhzi2VY\">SQL Console</a>&nbsp;saved queries.</td></tr><tr><td><code>bookmarked</code></td><td>Indicates this note is a <a href=\"#root/_help_u3YFHC9tQlpm\">bookmark</a>.</td></tr><tr><td><code>bookmarkFolder</code></td><td>Note with this label will appear in bookmarks as folder (allowing access to its children). See&nbsp;<a class=\"reference-link\" href=\"#root/_help_u3YFHC9tQlpm\">Bookmarks</a>&nbsp;for more information.</td></tr><tr><td><code>share*</code></td><td>See the attribute reference in&nbsp;<a class=\"reference-link\" href=\"#root/_help_R9pX4DGra2Vt\">Sharing</a>.</td></tr><tr><td><code>displayRelations</code>, <code>hideRelations</code></td><td>Comma delimited names of relations which should be displayed/hidden in a&nbsp;<a class=\"reference-link\" href=\"#root/_help_iRwzGnHPzonm\">Relation Map</a>&nbsp;(both the note type and the&nbsp;<a class=\"reference-link\" href=\"#root/_help_BCkXAVs63Ttv\">Note Map (Link map, Tree map)</a>&nbsp;general functionality).</td></tr><tr><td><code>titleTemplate</code></td><td>Default title of notes created as children of this note. This value is evaluated as a JavaScript string and thus can be enriched with dynamic content via the injected <code>now</code> and <code>parentNote</code> variables.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> <br>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_47ZrP6FNuoG8\">Default Note Title</a>&nbsp;for more info.</td></tr><tr><td><code>template:titleTemplate</code></td><td>Set on a template note: default title of notes created from the template, taking precedence over the parent's <code>titleTemplate</code>. Evaluated the same way as <code>titleTemplate</code>. See <a class=\"reference-link\" href=\"#root/_help_47ZrP6FNuoG8\">Default Note Title</a>.</td></tr><tr><td><code>template</code></td><td>This note will appear in the selection of available template when creating new note. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>&nbsp;for more information.</td></tr><tr><td><code>color</code></td><td>defines color of the note in note tree, links etc. Use any valid CSS color value like 'red' or #a13d5f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>Note: this color may be automatically adjusted when displayed to ensure sufficient contrast with the background.</td></tr><tr><td><code>keyboardShortcut</code></td><td>Defines a keyboard shortcut which will immediately jump to this note. Example: 'ctrl+alt+e'. Requires frontend reload for the change to take effect.</td></tr><tr><td><code>keepCurrentHoisting</code></td><td>Opening this link won't change hoisting even if the note is not displayable in the current hoisted subtree.</td></tr><tr><td><code>executeButton</code></td><td>Title of the button which will execute the current code note</td></tr><tr><td><code>executeDescription</code></td><td>Longer description of the current code note displayed together with the execute button</td></tr><tr><td><code>excludeFromNoteMap</code></td><td>Notes with this label will be hidden from the&nbsp;<a class=\"reference-link\" href=\"#root/_help_bdUJEHsAPYQR\">Note Map</a>.</td></tr><tr><td><code>excludeFromLlm</code></td><td>Hides this note from the AI chat and the MCP server. Make it inheritable to hide the notes below it as well. See <a class=\"reference-link\" href=\"#root/_help_cRRrdZjgyhNc\">Privacy</a>.</td></tr><tr><td><code>newNotesOnTop</code></td><td>New notes will be created at the top of the parent note, not on the bottom.</td></tr><tr><td><code>hideChildrenOverview</code></td><td>Hides the&nbsp;<a class=\"reference-link\" href=\"#root/_help_0ESUbbAxVnoK\">Note List</a>&nbsp;for that particular note.</td></tr><tr><td><code>subtreeHidden</code></td><td>Hides all child notes of this note from the tree, displaying a badge with the count of hidden children. Children remain accessible via search or direct links.</td></tr><tr><td><code>printLandscape</code></td><td>When exporting to PDF, changes the orientation of the page to landscape instead of portrait.</td></tr><tr><td><code>printPageSize</code></td><td>When exporting to PDF, changes the size of the page. Supported values: <code>A0</code>, <code>A1</code>, <code>A2</code>, <code>A3</code>, <code>A4</code>, <code>A5</code>, <code>A6</code>, <code>Legal</code>, <code>Letter</code>, <code>Tabloid</code>, <code>Ledger</code>.</td></tr><tr><td><code>printScale</code>, <code>printMargins</code></td><td>Additional printing options, generally configured through the&nbsp;<a class=\"reference-link\" href=\"#root/_help_NRnIZmSMc5sj\">Printing &amp; Exporting as PDF</a>&nbsp;dialog.</td></tr><tr><td><code>geolocation</code></td><td>Indicates the latitude and longitude of a note, to be displayed in a&nbsp;<a class=\"reference-link\" href=\"#root/_help_81SGnPGMk7Xc\">Geo Map</a>.</td></tr><tr><td><code>geoShape</code></td><td>Indicates the coordinates for the points of a <a href=\"#root/_help_C2H9HK4BzwG7\">shapec</a> drawn on the&nbsp;<a class=\"reference-link\" href=\"#root/_help_81SGnPGMk7Xc\">Geo Map</a>&nbsp;(e.g. area, rectangle, circle).</td></tr><tr><td><code>map:*</code></td><td>Defines specific options for the&nbsp;<a class=\"reference-link\" href=\"#root/_help_81SGnPGMk7Xc\">Geo Map</a>.</td></tr><tr><td><code>calendar:*</code></td><td>Defines specific options for the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xWbu3jpNWapp\">Calendar</a>.</td></tr><tr><td><code>viewType</code></td><td>Sets the view of child notes (e.g. grid or list). See&nbsp;<a class=\"reference-link\" href=\"#root/_help_0ESUbbAxVnoK\">Note List</a>&nbsp;for more information.</td></tr><tr><td><code>webViewSrc</code></td><td>Defines the URL of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_1vHRoWCEjj0L\">Web View</a>.</td></tr><tr><td><code>tabWidth</code>, <code>indentWithTabs</code>, <code>wrapLines</code></td><td>Per-note Code editor settings: indentation width, indent with tabs vs. spaces, and word wrapping. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a>.</td></tr><tr><td><code>datePattern</code>, <code>weekPattern</code>, <code>monthPattern</code>, <code>quarterPattern</code>, <code>yearPattern</code></td><td>Customizes the title naming pattern of day / week / month / quarter / year notes. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_l0tKav7yLHGF\">Day Notes</a>.</td></tr><tr><td><code>enableWeekNote</code>, <code>enableQuarterNote</code></td><td>Enables optional week and quarter notes in the calendar hierarchy; set on the calendar root. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_l0tKav7yLHGF\">Day Notes</a>.</td></tr><tr><td><code>fullContentWidth</code></td><td>Expands the note to the full editor width, ignoring the configured content width (useful for wide tables). See&nbsp;<a class=\"reference-link\" href=\"#root/_help_t596jLvPrqkS\">Content width</a>.</td></tr><tr><td><code>iconPack</code></td><td>Identifies a custom icon pack by its prefix. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_g1mlRoU8CsqC\">Creating an icon pack</a>.</td></tr><tr><td><code>clipperInbox</code></td><td>Overrides the default location where the Web Clipper saves clippings (defaults to the day note). See&nbsp;<a class=\"reference-link\" href=\"#root/_help_MtPxeAWVAzMg\">Web Clipper</a>.</td></tr><tr><td><code>docName</code> , <code>docUrl</code></td><td>Used internally for the in-app help.</td></tr><tr><td><code>aiQuickAction</code></td><td>Defines a custom prompt to be used for the&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>'s quick actions.</td></tr></tbody></table></figure>",
"_help_Cq5X6iKQop6R": "<p>A relation is similar to a <a href=\"#root/_help_HI6GBBIduIgv\">label</a>, but instead of having a text value it refers to another note.</p><h2>Common use cases</h2><ul><li><strong>Metadata Relationships for personal use</strong>: For example, linking a book note to an author note.<br>This can be combined with&nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;to make their display more user-friendly.</li><li><strong>Configuration</strong>: For configuring some notes such as&nbsp;<a class=\"reference-link\" href=\"#root/_help_HcABDtFCkbFN\">Render Note</a>, or configuring&nbsp;<a class=\"reference-link\" href=\"#root/_help_R9pX4DGra2Vt\">Sharing</a>&nbsp;or&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>&nbsp;(see the list below).</li><li><strong>Scripting</strong>: Attaching scripts to events or conditions related to the note.</li></ul><h2>Creating a relation using the visual editor</h2><ol><li>Go to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_uNtgN0cUKEBc\">Attributes tab</a>&nbsp;in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>.</li><li>Press the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> button (<em>Add a new attribute</em>) to the right of the <em>Owned attributes</em> section.</li><li>Select <em>Add new relation</em> for the relation.</li></ol><p>While in the visual editor, set the desired name and the <em>Target note</em> (the note to point to). Unlike labels, relations cannot exist with a target note.</p><p>Children can inherit this relation, click the relation and check <em>Inheritable</em>. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_bwZpz2ajCEwO\">Attribute Inheritance</a>&nbsp;for more information.</p><aside class=\"admonition tip\"><p>Alternatively, press <kbd>Alt</kbd>+<kbd>L</kbd> which will open the attribute details (same view as when an existing attribute is clicked) in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>.</p></aside><h2>Creating a relation manually</h2><p>In the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>, press the&nbsp;<span class=\"tn-icon bx bx-list-check\"></span> button to show the list of the attributes.</p><ul><li>To create a relation called <code>myRelation</code>:<ol><li>Click the input box to focus it.</li><li>Type <code>~myRelation=@</code> .</li><li>After this, an autocompletion box should appear.</li><li>Type the title of the note to point to and press <kbd>Enter</kbd> to confirm (or click the desired note).</li><li>Alternatively copy a note from the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;and paste it after the <code>=</code> sign (without the <code>@</code> , in this case).</li></ol></li><li>To create an inheritable relation, follow the same steps as previously described but instead of <code>~myRelation</code> write <code>~myRelation(inheritable)</code>.</li></ul><h2>Predefined relations</h2><p>These relations are supported and used internally by Trilium.</p><figure class=\"table\"><table><thead><tr><th>Label</th><th>Description</th></tr></thead><tbody><tr><td><code>runOn*</code></td><td>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_GPERMystNGTB\">Backend Events</a></td></tr><tr><td><code>template</code></td><td>note's attributes will be inherited even without a parent-child relationship, note's content and subtree will be added to instance notes if empty. See documentation for details.</td></tr><tr><td><code>template:newNoteDefaultParent</code></td><td>set on a template note, points to the note under which notes created from the template are placed when no other location is picked; when set several times, the note is cloned into every target. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>.</td></tr><tr><td><code>inherit</code></td><td>note's attributes will be inherited even without a parent-child relationship. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>&nbsp;for a similar concept. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_bwZpz2ajCEwO\">Attribute Inheritance</a>&nbsp;in the documentation.</td></tr><tr><td><code>renderNote</code></td><td>notes of type&nbsp;<a class=\"reference-link\" href=\"#root/_help_HcABDtFCkbFN\">Render Note</a>&nbsp;will be rendered using a code note (HTML or script) and it is necessary to point using this relation to which note should be rendered</td></tr><tr><td><code>widget</code></td><td>Used in the context of custom&nbsp;<a class=\"reference-link\" href=\"#root/_help_4Gn3psZKsfSm\">Launch Bar Widgets</a>, to refer to the widget that will be rendered.</td></tr><tr><td><code>shareCss</code></td><td>CSS note which will be injected into the share page. CSS note must be in the shared sub-tree as well. Consider using <code>shareHiddenFromTree</code> and <code>shareOmitDefaultCss</code> as well.</td></tr><tr><td><code>shareJs</code></td><td>JavaScript note which will be injected into the share page. JS note must be in the shared sub-tree as well. Consider using <code>shareHiddenFromTree</code>.</td></tr><tr><td><code>shareHtml</code></td><td>HTML note which will be injected into the share page at locations specified by the <code>shareHtmlLocation</code> label. HTML note must be in the shared sub-tree as well. Consider using <code>shareHiddenFromTree</code>.</td></tr><tr><td><code>shareTemplate</code></td><td>Embedded JavaScript note that will be used as the template for displaying the shared note. Falls back to the default template. Consider using <code>shareHiddenFromTree</code>.</td></tr><tr><td><code>shareFavicon</code></td><td>Favicon note to be set in the shared page. Typically you want to set it to share root and make it inheritable. Favicon note must be in the shared sub-tree as well. Consider using <code>shareHiddenFromTree</code>.</td></tr></tbody></table></figure>",
"_help_bwZpz2ajCEwO": "<p>Inheritance refers to the process of having a <a href=\"#root/_help_HI6GBBIduIgv\">label</a> or a <a href=\"#root/_help_Cq5X6iKQop6R\">relation</a> shared across multiple notes, generally in parent-child relations (or anywhere if using templates).</p><h2>Standard Inheritance</h2><p>In Trilium, attributes can be automatically inherited by child notes if they have the <code>isInheritable</code> flag set to <code>true</code>. This means the attribute (a key-value pair) is applied to the note and all its descendants.</p><p>To make an attribute inheritable, simply use the visual editor for&nbsp;<a class=\"reference-link\" href=\"#root/_help_HI6GBBIduIgv\">Labels</a>&nbsp;or&nbsp;<a class=\"reference-link\" href=\"#root/_help_Cq5X6iKQop6R\">Relations</a>. Alternatively, the attribute can be manually defined where <code>#myLabel=value</code> becomes <code>#myLabel(inheritable)=value</code> when inheritable.</p><p>As an example, the <code>archived</code> label can be set to be inheritable, allowing you to hide a whole subtree of notes from searches and other dialogs by applying this label at the top level.</p><p>Standard inheritance forces all the notes that are children (and sub-children) of a note to have that particular label or relation. If there is a need to have some notes not inherit one of the labels, then <em>copying inheritance</em> or <em>template inheritance</em> needs to be used instead.</p><h2>Copying Inheritance</h2><p>Copying inheritance differs from standard inheritance by using a <code>child:</code> prefix in the attribute name. This prefix causes new child notes to automatically receive specific attributes from the parent note. These attributes are independent of the parent and will persist even if the note is moved elsewhere.</p><p>If a parent note has the label <code>#child:exampleAttribute</code>, all newly created child notes (one level deep) will inherit the <code>#exampleAttribute</code> label. This can be useful for setting default properties for notes in a specific section.</p><p>Similarly, for relations use <code>~child:myRelation</code>.</p><p>Due to the way it's designed, copying inheritance cannot be used to cascade infinitely within a hierarchy. For that use case, consider using either standard inheritance or templates.</p><h3>Chained inheritance</h3><p>It is possible to define labels across multiple levels of depth. For example, <code>#child:child:child:foo</code> applied to a root note would create:</p><ul><li><code>#child:child:foo</code> on the first-level children.</li><li><code>#child:foo</code> on the second-level children.</li><li><code>#foo</code> on the third-level children.</li></ul><p>Similarly, use <code>~child:child:child:foo</code> if dealing with relations.</p><p>Do note that same as simple copying inheritance, the changes will not apply retroactively to existing notes in the hierarchy, it will only apply to the newly created notes.</p><h2>Template Inheritance</h2><p>Attributes can also be inherited from&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>. When a new note is created using a template, it inherits the attributes defined in that template. This is particularly useful for maintaining consistency across notes that follow a similar structure or function.</p>",
"_help_OFXdgB2nNk1F": "<figure class=\"image image_resized\" style=\"width:61.4%;\"><img style=\"aspect-ratio:938/368;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Attributes/Promoted%20Attributes_image.png\" width=\"938\" height=\"368\"></figure><p>Promoted attributes are <a href=\"#root/_help_zEY4DaJG4YT5\">attributes</a> which are displayed prominently in the UI which allow them to be easily viewed and edited.</p><p>The promoted attributes are shown underneath the&nbsp;<a class=\"reference-link\" href=\"#root/_help_l7pigIGu01K2\">Title</a>&nbsp;of the note, in a collapsible section. For full-height notes such as&nbsp;<a class=\"reference-link\" href=\"#root/_help_grjYqerjn243\">Canvas</a>, the promoted attributes are collapsed by default to make room.</p><p>One way of seeing promoted attributes is as a kind of form with several fields. Each field is just regular attribute, the only difference is that they appear on the note itself.</p><p>Attributes can be pretty useful since they allow for querying and script automation etc. but they are also inconveniently hidden. This allows you to select few of the important ones and push them to the front of the user.</p><h2>Attribute definition</h2><figure class=\"image image-style-align-right image_resized\" style=\"width:50%;\"><img style=\"aspect-ratio:885/742;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Attributes/2_Promoted%20Attributes_image.png\" width=\"885\" height=\"742\"></figure><p>In order to have promoted attributes, there needs to be a way to define them.</p><p>Technically, attributes are only name-value pairs where both name and value are strings.</p><p>The <em>Attribute definition</em> specifies how should this value be interpreted:</p><ul><li>Is it just string, or is it a date?</li><li>Should we allow multiple values or note?</li><li>Should we <em>promote</em> the attribute or not?</li></ul><h2>Types of attributes</h2><p>Attribute definitions have a dedicated type field which will change how the value will be edited in the promoted attributes section.</p><p>The following types are supported:</p><ul><li><em>Text</em>, the default option which allows any type of text to be edited, similar to normal labels that don't have a type associated.</li><li><em>Multi-line text</em>, similar to a normal text field, but rendered in a bigger text box that also supports writing on multiple lines.</li><li><em>Number</em>, will display as a number input field with up/down arrows.<ul><li>Optionally a <em>precision</em> which sets how many decimals the value steps by and is displayed with.</li></ul></li><li><em>Checkbox</em>, which renders as a checkbox for a true/false value. In the label definition, this type is written as <code>boolean</code>.</li><li><em>Select,</em> which provides a list of user-defined options when editing.<ul><li>The list is not fixed, meaning that new options can be easily added from the promoted attribute.</li><li>Renaming an option does not change the existing values since the value is stored as text. Consider a <a href=\"#root/_help_ivYnonVFBxbQ\">bulk rename</a>.</li><li>The items do not have a custom color or icon. This is intentional as selects are meant to be light-weight. For a more customizable option, consider using&nbsp;<a class=\"reference-link\" href=\"#root/_help_Cq5X6iKQop6R\">Relations</a>&nbsp;instead which use notes as items and those notes can be colorized and also carry an icon.</li></ul></li><li><em>Date,</em> which provides a date picker.</li><li><em>Date &amp; Time,</em> which provides a date &amp; time picker.</li><li><em>Time,</em> which provides a time picker.</li><li><em>URL,</em> which provides a button to open the web address in a new window.</li><li><em>Email</em>, which provides a button to quickly send an email to that address using your operating system's default app.</li><li><em>Phone</em>, which provides a button to quickly call that number using your operating system's default app.</li><li><em>Color</em>, which provides a color picker and a way to remove the value.</li><li><em>Relation</em>, which points to another note and uses&nbsp;<a class=\"reference-link\" href=\"#root/_help_Cq5X6iKQop6R\">Relations</a>&nbsp;instead of&nbsp;<a class=\"reference-link\" href=\"#root/_help_HI6GBBIduIgv\">Labels</a>.</li></ul><aside class=\"admonition note\"><p>For label-based attributes, these types are not enforced by the attribute system, meaning that changing the type afterwards does not guarantee that the values in it correspond to the type (e.g. turning a text into a number).</p></aside><h2>Multiple values</h2><p>When the definition allows multiple values, each value is shown as a chip and a new one is added in the box after them. Press the <span class=\"tn-icon bx bx-x\"></span> on a chip to remove that value.</p><ul><li>For free-form types such as <em>Text</em>, <em>Number</em> or <em>Date</em>, press <kbd>Enter</kbd> (or leave the field) to add what was typed. The same value can be added more than once, for example two payments of the same amount.</li><li>For <em>Select</em>, <em>Checkbox</em> and <em>Relation</em> attributes, a value is picked from the list rather than typed, and each one can be picked only once.</li></ul><h2>Creating a new promoted attribute definition</h2><p>To create a new promoted attribute:</p><ol><li>Go to a note.</li><li>Go to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_uNtgN0cUKEBc\">Attributes tab</a>&nbsp;in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>.</li><li>Press the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> button for the top-most section (<em>Owned attributes</em>).</li><li>Select either <em>Add new label definition…</em> or <em>Add new relation definition…</em>.</li><li>Select the name which will be name of the label or relation that will be created when the promoted attribute is edited.</li><li>Ensure <em>Promoted</em> is checked in order to display it at the top of notes.</li><li>Optionally, choose an <em>Alias</em> which will be displayed next to the promoted attribute instead of the attribute name. Generally it's best to choose a “user-friendly” name since it can contain spaces and other characters which are not supported as attribute names.</li><li>Check <em>Inheritable</em> to apply it to this note and all its descendants. To keep it only for the current note, un-check it.</li><li>Press <em>Save &amp; Close</em> to apply the changes.</li></ol><p>Alternatively, promoted attributes can be created from the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>&nbsp;by going to&nbsp;<span class=\"tn-icon bx bx-list-check\"></span> (<em>Attributes</em>), pressing the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> button and selecting <em>Add new label definition…</em>. The resulting attribute can also be copy-pasted or written manually (albeit discouraged).</p><h2>How attribute definitions actually work</h2><p>When a new promoted attribute definition is created, it creates a corresponding label prefixed with either <code>label</code> or <code>relation</code>, depending on the definition type:</p><pre><code class=\"language-text-x-trilium-auto\">#label:myColor(inheritable)=\"promoted,alias=Color,multi,color\"</code></pre><p>The only purpose of the attribute definition is to set up a template. If the attribute was marked as promoted, then it's also displayed to the user for easy editing.</p><figure class=\"table\"><table><tbody><tr><td><figure class=\"image\"><img style=\"aspect-ratio:495/157;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Attributes/1_Promoted%20Attributes_image.png\" width=\"495\" height=\"157\"></figure></td><td>Notice how the promoted attribute definition only creates a “Due date” box above the text content.</td></tr><tr><td><figure class=\"image\"><img style=\"aspect-ratio:663/160;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Attributes/3_Promoted%20Attributes_image.png\" width=\"663\" height=\"160\"></figure></td><td>Once a value is set by the user, a new label (or relation, depending on the type) is created. The name of the attribute matches one set when creating the promoted attribute.</td></tr></tbody></table></figure><p>So there's one attribute for value and one for definition. But notice how an definition attribute can be made <a href=\"#root/_help_bwZpz2ajCEwO\">Inheritable</a>, meaning that it's also applied to all descendant notes. In this case, the definition used for the whole sub-tree while \"value\" attributes are for each not individually.</p><h2>Using system attributes</h2><p>It's possible to create promoted attributes out of system attributes, to be able to easily alter them.</p><p>Here are a few practical examples:</p><ul><li><a class=\"reference-link\" href=\"#root/_help_GTwFsgaA0lCt\">Collections</a>&nbsp;already make use of this practice, for example:<ul><li>Calendars add “Start Date”, “End Date”, “Start Time” and “End Time” as promoted attributes. These map to system attributes such as <code>startDate</code> which are then interpreted by the calendar view.</li><li><a class=\"reference-link\" href=\"#root/_help_zP3PMqaG71Ct\">Presentation</a>&nbsp;adds a “Background” promoted attribute for each of the slide to easily be able to customize.</li></ul></li><li>The Trilium documentation (which is edited in Trilium) uses a promoted attribute to be able to easily edit the <code>#shareAlias</code> (see&nbsp;<a class=\"reference-link\" href=\"#root/_help_R9pX4DGra2Vt\">Sharing</a>) in order to form clean URLs.</li><li>If you always edit a particular system attribute such as <code>#color</code>, simply create a promoted attribute for it to make it easier.</li></ul><h3>Inverse relation</h3><p>Some relations always occur in pairs - my favorite example is on the family. If you have a note representing husband and note representing wife, then there might be a relation between those two of <code>isPartnerOf</code>. This is bidirectional relationship - meaning that if a relation is pointing from husband to wife then there should be always another relation pointing from wife to husband.</p><p>Another example is with parent-child relationship. Again these always occur in pairs, but in this case it's not exact same relation - the one going from parent to child might be called <code>isParentOf</code> and the other one going from child to parent might be called <code>isChildOf</code>.</p><p>Relation definition allows you to specify such \"inverse relation\" - for the relation you just define you specify which is the inverse relation. Note that in the second example we should have two relation definitions - one for <code>isParentOf</code> which defines <code>isChildOf</code> as inverse relation and then second relation definition for <code>isChildOf</code> which defines <code>isParentOf</code> as inverse relation.</p><p>What this does internally is that whenever we save a relation which has defined inverse relation, we check that this inverse relation exists on the relation target note. Similarly, when we delete relation, we also delete inverse relation on the target note.</p><h2>See also</h2><ul><li>The&nbsp;<a class=\"reference-link\" href=\"#root/_help_2FvYrpmOXm29\">Table</a>&nbsp;collection makes heavy use of promoted attributes to define the columns of the table, since they already carry the type information. When made inheritable, it's also easy to change those fields when the child notes are opened.</li></ul>",
@@ -243,8 +243,8 @@
"_help_GBBMSlVSOIGP": "<p>Trilium can connect to a large language model and use it as an assistant that works directly on your notes: ask questions about the note you're reading, have it draft or restructure content, or get it to write scripts and widgets for you.</p><p>The integration is off by default and does nothing until you enable it and configure a provider; Trilium ships no model of its own. The provider you pick decides how your notes travel: a cloud API billed per use, a subscription you already pay for, or a model running on your own hardware, in which case nothing leaves the machine. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_bkPZAMT7d2sR\">Providers</a>&nbsp;for what each involves, and&nbsp;<a class=\"reference-link\" href=\"#root/_help_cRRrdZjgyhNc\">Privacy</a>&nbsp;for exactly what gets sent.</p><p>Once enabled, the assistant is available as:</p><ul><li>As a dedicated note type, it can read and modify notes through tools, which you can switch off per conversation if you would rather it only saw what you type.</li><li>A panel in the right sidebar, which acts similarly to the dedicated note type but it also has optional access to the current note.</li><li>An&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>&nbsp;which comes with builtin actions that operate over selected text (such as proof-reading, summarizing), as well as&nbsp;<a class=\"reference-link\" href=\"#root/_help_mVEYwt20exhO\">Custom AI quick actions</a>.</li></ul><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>Attachments for multi-modal chat (images, text files, PDFs).</li><li>Optional MCP to allow external chat tools (e.g. Claude Code) to operate on notes within Trilium.</li></ul><h2>Sample use-cases</h2><ul><li>Create any type of&nbsp;<a class=\"reference-link\" href=\"#root/_help_MgibgPcfeuGz\">Custom Widgets</a>.</li><li>Easily create a&nbsp;<a class=\"reference-link\" href=\"#root/_help_HcABDtFCkbFN\">Render Note</a>, e.g. <em>Create for me a render note which allows me to play tic-tac-toe. Make sure to use Preact instead of the legacy jQuery.</em></li><li>Create widgets for a&nbsp;<a class=\"reference-link\" href=\"#root/_help_IF7Q6I9x7zuw\">Dashboard</a>, such as a calculator, a stopwatch, a pomodoro timer.</li></ul><aside class=\"admonition note\"><p>Claude Sonnet is known to produce very good frontend or backend scripts with little guidance, as the AI has been instructed in how to produce them.</p></aside><h2>LLM Providers</h2><p>Trilium supports four different types of providers:</p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><span class=\"tn-icon bx bx-cloud\"></span>&nbsp;Cloud</p><div class=\"trilium-tab-panel\"><p>Pay-per use with an API key which is billed separately from any subscription you might already have.</p><ul><li><span class=\"tn-icon tn-brand tn-brand-anthropic\"></span>&nbsp;Anthropic Claude</li><li><span class=\"tn-icon tn-brand tn-brand-openai\"></span>&nbsp;OpenAI GPT</li><li><span class=\"tn-icon tn-brand tn-brand-gemini\"></span>&nbsp;Google Gemini</li><li><span class=\"tn-icon tn-brand tn-brand-deepseek\"></span>&nbsp;DeepSeek</li></ul></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><span class=\"tn-icon bx bx-coin\"></span>&nbsp;Subscription-based</p><div class=\"trilium-tab-panel\"><p>Reuses an existing subscription instead of paying per use.</p><ul><li><span class=\"tn-icon tn-brand tn-brand-claude\"></span>&nbsp;<a href=\"#root/_help_eFhxp9laTW1S\">Claude Code</a></li><li><span class=\"tn-icon tn-brand tn-brand-github-copilot\"></span>&nbsp;<a href=\"#root/_help_eFhxp9laTW1S\">GitHub Copilot</a></li><li><span class=\"tn-icon tn-brand tn-brand-antigravity\"></span>&nbsp;<a href=\"#root/_help_eFhxp9laTW1S\">Google Antigravity</a></li><li><span class=\"tn-icon tn-brand tn-brand-codex\"></span>&nbsp;<a href=\"#root/_help_eFhxp9laTW1S\">OpenAI Codex</a></li></ul></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><span class=\"tn-icon bx bx-network-chart\"></span>&nbsp;Local/self-hosted</p><div class=\"trilium-tab-panel\"><ul><li><span class=\"tn-icon tn-brand tn-brand-ollama\"></span>&nbsp;Ollama</li><li><span class=\"tn-icon tn-brand tn-brand-lmstudio\"></span>&nbsp;LM Studio</li></ul></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><span class=\"tn-icon bx bx-code-curly\"></span>&nbsp;Custom endpoints</p><div class=\"trilium-tab-panel\"><p>For other providers that are not directly supported by Trilium, either local or hosted (e.g. OpenRouter, Groq, Mistral).</p></div></section></div><aside class=\"admonition tip\"><p>For more information about each provider, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_bkPZAMT7d2sR\">Providers</a>. See the dedicated&nbsp;<a class=\"reference-link\" href=\"#root/_help_cRRrdZjgyhNc\">Privacy</a>&nbsp;to better understand what data is sent to providers.</p></aside><h2>Enabling the AI integration</h2><p>To enable the AI integration, simply go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>AI / LLM</em> and press the toggle in the top-right of the dialog and configure a provider.</p><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><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><h3>Templates</h3><p>Chat notes can be set as&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>&nbsp;to make them easily reusable. The entire conversation history is kept, allowing a basic form of specialization for the LLM with the existing chat acting like a system prompt.&nbsp;</p><h3>Model selection</h3><p>When a provider is configured in&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>, the next step is to select the models that will be available for the chat.</p><p>The models are retrieved dynamically from the provider, only when the model selection list is visible. To alter the list of models, simply press the Edit button in the model selection box.</p><p>Pricing information is displayed for known models. The pricing information (price per million tokens) is embedded in the application (using a subset of LiteLLM's data) and is updated with new versions of Trilium. Local providers are considered free, whereas custom endpoint providers don't offer any pricing information.</p><h2>Features</h2><h3>Web search</h3><p>The AI can optionally search the web to find more information about a specific topic.&nbsp;</p><p>Where the search comes from is chosen in the <em>Web search</em> submenu of the <span class=\"tn-icon bx bx-shield-quarter\"></span><em>Tools</em> menu next to the model selector at the bottom of the chat, whose row shows the source in use:</p><ul><li><em>Disabled</em> turns web search off for this chat.</li><li><em>Use the model's built-in search</em>, the default, lets the model search with its provider's own search. Anthropic, OpenAI, Google Gemini and DeepSeek models have one, as do Claude Code, Google Antigravity and OpenAI Codex. Ollama, LM Studio and custom endpoints don't, so this choice is disabled for their models. DeepSeek's search is billed per search on your DeepSeek account and works only with DeepSeek's own endpoint, not with a custom base URL.</li><li>A search provider (Brave Search, Tavily, Exa, Serper, Perplexity or SearXNG) searches through that service instead, whichever model is answering. Search providers are added in the <em>Search Providers</em> section of the AI settings, which <em>Manage search providers</em> at the bottom of the submenu opens. The browser version can't use Brave Search, Exa or Perplexity, whose services refuse requests made from a web page, so they're shown disabled there.</li></ul><p>To use SearXNG, enable its JSON output by adding <code>json</code> to the search formats in the instance's <code>settings.yml</code>. SearXNG turns JSON off by default, and without it every search fails.</p><pre><code class=\"language-text-x-yaml\">search:\n formats:\n - html\n - json</code></pre><p>SearXNG doesn't use API keys, so leave the API key empty. Fill it in only if your instance sits behind a proxy that requires a token; Trilium sends it as a bearer token in the <code>Authorization</code> header.</p><p>Whether web search is on is kept per chat; the search source is shared by all chats. A choice the current model can't use stays in the menu, disabled; hover the <span class=\"tn-icon bx bx-info-circle\"></span>icon next to it to see why. Claude Code, GitHub Copilot, Google Antigravity and OpenAI Codex run their own tools, so they can't use a search provider.</p><p>In the chat, a search run through a search provider shows that provider's logo at the start of its line instead of the <span class=\"tn-icon bx bx-search\"></span>magnifier; hover the logo to see the provider's name.</p><p>With a search provider, the model can also read the pages it finds, or a link you give it, as text: Trilium fetches the page itself and hands the model up to its first 20,000 characters. Addresses on your own machine or network are refused. In the browser version most sites don't allow being read this way, so reading a page there usually fails.</p><h3>Thinking</h3><p>Some models reason before they answer. While the model is thinking, its reasoning is shown in full under a spinner; once it is done, it folds into a collapsible <em>Thought process</em> line above the reply.</p><p>How much a model thinks is set per chat, in one of two ways depending on the model:</p><ul><li>Most models have an <span class=\"tn-icon bx bx-brain\"></span><em>Extended thinking</em> button, next to the <span class=\"tn-icon bx bx-shield-quarter\"></span><em>Tools</em> button.</li><li>Models that offer several levels of reasoning (DeepSeek V4, OpenAI Codex, Antigravity) have a <span class=\"tn-icon bx bx-brain\"></span>reasoning effort dropdown next to the model selector instead. <em>None</em>, where offered, turns thinking off; higher levels give better answers to hard questions, but take longer and cost more.</li></ul><aside class=\"admonition note\"><p>The effort dropdown only appears once Trilium knows the model's levels. For a DeepSeek provider set up with an earlier version of Trilium, edit the provider in the model selection box and press <em>Save</em> once.</p></aside><h3>Note access (tools)</h3><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. To turn it off, press the <span class=\"tn-icon bx bx-shield-quarter\"></span><em>Tools</em> button next to the model selector at the bottom of the chat and switch off <em>Note access</em>. The <em>Tools</em> button is highlighted while note access or web search is on.</p><p>Here are a few tools that Trilium provides for the LLM:</p><ul><li>At note level:<ul><li>Search for notes</li><li>Get the metadata or content of a note.</li><li>Edit a note<ul><li>There are multiple mechanism for the LLM to edit a note: completely by re-writing it, find/replace of a text sequence or append.</li><li>When re-writing a note, the LLM can also change its type (for example from a text note to a code note) or the language of a code note, rewriting the content to match.</li><li>Whenever the AI makes a change, a <a href=\"#root/_help_vZWERwf8U3nx\">revision</a> is saved to be able to revert any unwanted changes.</li></ul></li><li>Create a new note<ul><li>Asked for a drawing, the LLM can create an SVG image note, or turn an existing note into one. It can write only SVG images, not other formats such as PNG.</li></ul></li><li>Rename or delete a note.</li></ul></li><li>At attribute level:<ul><li>Get the full list of attributes, or a specific attribute.</li><li>Set the value of an attribute.<ul><li>An attribute that runs code, such as <code>#run</code>, <code>#widget</code> or <code>~renderNote</code>, is saved with a <code>disabled:</code> prefix (for example <code>#disabled:widget</code>), the same way a safe import disables it (see&nbsp;<a class=\"reference-link\" href=\"#root/_help_YzMcWlCVeW09\">Active content</a>). If the note already had that attribute enabled, the AI removes it, so none of it runs until you enable the new value. The AI tells you which note it is on; review the code, then enable it with the toggle next to the active content badge beside the note's title or, for a&nbsp;<a class=\"reference-link\" href=\"#root/_help_HcABDtFCkbFN\">Render Note</a>, the <em>Enable render note</em> button in the note.</li></ul></li><li>Delete an attribute.</li></ul></li><li>At tree level:<ul><li>Get the direct children of a note.</li><li>Get the entire subtree of a note.</li><li>Move or clone a note somewhere else.</li></ul></li><li>For&nbsp;<a class=\"reference-link\" href=\"#root/_help_0vhv7lsOLy82\">Attachments</a>:<ul><li>Get metadata for an attachment.</li><li>Get the content of an attachment.</li></ul></li><li>Skills (see the dedicated section).</li></ul><p>Each tool the AI uses appears in the chat as a single line naming the tool and the note or query it worked on; a renamed note shows its previous title struck through, a deleted note its title struck through, a moved note where it was moved from and to, an attribute the AI read, set or deleted as a pill (struck through once deleted), an attachment by its title, note and size, and a web page the AI read as a link. A line folds open only when there is something to read inline: the notes a search found, the pages a web search found, the icons an icon search found, the type, attributes or start of the content of a note the AI read, all the attributes of a note, the text of an attachment or of a web page, the User Guide pages the AI looked up or its table of contents (both open in the help panel), the children or the whole subtree of a note, what the AI wrote into a note it created, rewrote or added to, the changes of an edit, or the reason a tool failed. A search names on its line the part of the tree it is confined to, if any, and also shows how many notes it found and how many of the matches the AI asked for; each note it lists opens with a click. To see exactly what the AI sent to a tool and what it got back, hover the line and press the <span class=\"tn-icon bx bx-code-alt\"></span>button next to it; on touch screens the button is always shown.</p><p>When the reply stops moving for a couple of seconds while the AI is still at work, for example while it reads what a tool returned, a <em>Still working…</em> line appears under it until the next part of the reply arrives.</p><h4>Approving tool calls</h4><p>Before the AI runs a tool, the chat asks whether to allow it. The tool's line is marked with a <span class=\"tn-icon bx bxs-hand\"></span>icon and has <em>Allow</em> and <em>Deny</em> buttons below it. When the call would write to a note, the line opens on the text it would write or the changes of an edit. The reply waits until you answer.</p><ul><li>To let the call run, press <em>Allow</em>.</li><li>To stop asking about a tool for the rest of the chat, open the menu next to <em>Allow</em> and choose to always allow that tool for this chat. The call runs, and so do the other calls of that tool still waiting and every later one in this chat. Other tools keep asking, and a new chat asks again.</li><li>To refuse it, press <em>Deny</em>. The AI is told that you declined, and its reply carries on without the call, which is marked <em>denied</em>.</li><li>Stopping the reply denies every call that is still waiting.</li></ul><p>To make a chat ask about a tool again, open the <span class=\"tn-icon bx bx-shield-quarter\"></span><em>Tools</em> menu at the bottom of the chat and, under <em>Allowed in this chat</em>, press the tool. The submenu is shown once the chat has allowed a tool.</p><p>Which calls ask depends on the chat's permission mode, chosen in the <span class=\"tn-icon bx bx-shield-quarter\"></span><em>Tools</em> menu under <em>Permissions</em>:</p><ul><li><em>Always ask</em>: every call asks, including the ones that only read (searching notes, or reading a note or an attachment).</li><li><em>Ask before changes</em>: the calls that only read run on their own, and the ones that change your notes (creating, editing, renaming, moving or deleting a note, and setting or deleting an attribute) ask.</li><li><em>Don't ask</em>: every call runs without asking, changes included.</li></ul><p>A new chat starts in the mode you picked last, in any chat, or in <em>Ask before changes</em> until you pick one. Picking <em>Don't ask</em> therefore carries over to the next chat too.</p><p>A tool allowed for the chat runs without asking in every mode. So does looking something up in what ships with Trilium (its User Guide, the skill sheets that teach the AI Trilium's search syntax and note types, and the icons), since it reads none of your notes. Searching the web and reading a web page never ask either: turning on web search in the <em>Tools</em> menu is what allows them, whether the model searches on its own or through a search provider.</p><aside class=\"admonition note\"><p>The&nbsp;<a class=\"reference-link\" href=\"#root/_help_eFhxp9laTW1S\">Subscription-based providers</a>&nbsp;(Claude Code, GitHub Copilot, Google Antigravity and OpenAI Codex) ask like any other provider.</p></aside><aside class=\"admonition note\"><p>Most changes you allow can be undone: a deleted note can be restored, and an edit reverted from its revision. Setting an attribute is harder to undo, since attributes have no history.</p></aside><aside class=\"admonition note\"><p>Gemini can't use its built-in search while note access is on. While it is, the built-in search choice in the <em>Tools</em> menu is disabled and says why; a search provider works with note access on.</p></aside><h3>Attachments</h3><p>Since Trilium v0.140.0,&nbsp;<a class=\"reference-link\" href=\"#root/_help_0vhv7lsOLy82\">Attachments</a>&nbsp;allow for multi-modal chat:</p><ul><li>Raster image (sent as vision input, except for SVGs) with the following supported formats: PNG, JPEG, GIF, WebP.</li><li>PDFs, sent natively to the provider (supported by Anthropic, OpenAI and Google).</li><li>SVG images (sent as raw HTML).</li><li>Text files.</li></ul><p>Not every model reads every kind of attachment: DeepSeek reads no PDFs, and images only with its vision models; OpenAI Codex, GitHub Copilot and Google Antigravity read images but no PDFs. For such a model:</p><ul><li>The attach button offers only the kinds the model reads, and a pasted or dropped file it can't read is not attached.</li><li>After switching to such a model, an attachment it can't read is marked with a <span class=\"tn-icon bx bx-error\"></span>warning, and the message can't be sent until the attachment is removed or another model is selected.</li><li>An attachment sent in an earlier message reaches the model as its name only, such as <code>[attached file: report.pdf]</code>, so it can tell you it doesn't see the content.</li></ul><p>To upload an attachment:</p><ul><li>Press the dedicated <em>Attach</em> button (paperclip icon) underneath the text box.</li><li>Paste an image directly from clipboard using Ctrl+V.</li></ul><p>Once one or more attachments are uploaded, they will appear directly above the text box:</p><ul><li>Images have a small thumbnail for easy identifications.</li><li>Every attachment can be deleted by pressing their corresponding X button.</li></ul><p>Clicking an image or a PDF, either its chip above the text box or where it appears in a sent message, opens it in a viewer: an image can be zoomed and panned there, a PDF read page by page. The button next to the viewer's close button opens the original file in a new browser tab. <kbd>Ctrl</kbd>-clicking instead opens an image in a new browser tab, and a PDF as an attachment in a new Trilium tab.</p><p>When an attachment is present, the LLM is instructed to consider the attachment with priority, even if it has access to the current note.</p><aside class=\"admonition note\"><p>Currently Trilium doesn't pre-process the attachments (e.g. via&nbsp;<a class=\"reference-link\" href=\"#root/_help_TiQbQDgP8L5t\">Text Extraction (OCR)</a>) before sending them to the LLM provider.</p></aside><h3>Mentions</h3><p>Mentions are a way to insert references to notes other than the current note, using the same mechanism as&nbsp;<a class=\"reference-link\" href=\"#root/_help_hrZ1D00cLbal\">Internal (reference) links</a>. To refer to another note, simply type @ followed by the name of the note to reference.</p><p>This feature is mostly helpful when note tools are enabled, otherwise the LLM will have no way to access the given note.</p><h3>Skills</h3><p>Skills in Trilium are specialized instruction sets that help the AI be more productive by understanding how Trilium.</p><p>These skills are not loaded by default to avoid an increased consumption of tokens, but the AI can load them on-demand if <em>Note tools</em> are enabled.</p><p>The following skills are built-in:</p><ul><li>Search syntax: understands the full syntax of&nbsp;<a class=\"reference-link\" href=\"#root/_help_eIg8jdvaoNNd\">Search</a>.</li><li>Backend scripting: to be able to write proper&nbsp;<a class=\"reference-link\" href=\"#root/_help_SPirpZypehBG\">Backend scripts</a>.</li><li>Frontend scripting: to be able to write proper <a href=\"#root/_help_yIhgI5H7A2Sm\">front-end scripts</a> (basic scripts, widgets,&nbsp;<a class=\"reference-link\" href=\"#root/_help_HcABDtFCkbFN\">Render Note</a>).</li><li>Dashboards: to build a&nbsp;<a class=\"reference-link\" href=\"#root/_help_IF7Q6I9x7zuw\">Dashboard</a>&nbsp;and its widgets, including interactive ones made with a&nbsp;<a class=\"reference-link\" href=\"#root/_help_HcABDtFCkbFN\">Render Note</a>.</li></ul><p>When <em>Note tools</em> are enabled the skills will automatically be made available to the AI, so no user interaction is required.</p><aside class=\"admonition note\"><p>Custom skills are currently not supported but they are planned.</p></aside><h3>MCP</h3><p>Trilium comes with a built-in MCP server which allows you to use an external agent such as Claude Code have access to your database. See the dedicated&nbsp;<a class=\"reference-link\" href=\"#root/_help_KOWBFgsZXJAD\">MCP</a>&nbsp;page for more details.</p><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, maintaining and supporting it long-term proved to be unsustainable.</p><p>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&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>",
"_help_bkPZAMT7d2sR": "<p>Providers are added in the <em>Model Providers</em> section of the AI settings, with <em>Add Model Provider</em>. Each one lists the models selected for it, which are the ones the chat offers; a provider with no models selected is not offered in the chat.</p><h2>Cloud providers using API keys</h2><p>Currently, the following cloud providers are supported:</p><ul><li><span class=\"tn-icon tn-brand tn-brand-anthropic\"></span>&nbsp;<a href=\"https://platform.claude.com/settings/workspaces/default/keys\">Anthropic</a></li><li><span class=\"tn-icon tn-brand tn-brand-openai\"></span>&nbsp;OpenAI</li><li><span class=\"tn-icon tn-brand tn-brand-gemini\"></span>&nbsp;Gemini</li><li><span class=\"tn-icon tn-brand tn-brand-deepseek\"></span>&nbsp;DeepSeek</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 either a subscription provider (see below) or using it externally via MCP.</p><p>Do note that most other LLM providers (e.g. OpenRouter, Groq, Mistral) can still be used in Trilium via the OpenAI-compatible custom endpoint (see below).</p><p>If you are using a proxy or gateway, you can also configure the base URL, otherwise the default will be used.</p><p>For Gemini, a chat that doesn't specify a model uses <code>gemini-3.8-flash</code>, and the automatically generated chat titles use <code>gemini-3.5-flash-lite</code>. A model you select explicitly is used as is and isn't affected by these defaults.</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 <a href=\"https://github.com/orgs/TriliumNext/discussions\">GitHub Discussions</a>.</p></aside><aside class=\"admonition important\"><p>See also the dedicated&nbsp;<a class=\"reference-link\" href=\"#root/_help_cRRrdZjgyhNc\">Privacy</a>&nbsp;section to better understand what data is being sent to a cloud provider.</p></aside><h2>Subscription-based providers</h2><p>Trilium integrates multiple&nbsp;<a class=\"reference-link\" href=\"#root/_help_eFhxp9laTW1S\">Subscription-based providers</a>:</p><ul><li><span class=\"tn-icon tn-brand tn-brand-claude\"></span>&nbsp;Claude Code by reusing your CLI.</li><li><span class=\"tn-icon tn-brand tn-brand-github-copilot\"></span>&nbsp;GitHub Copilot by reusing your CLI's ACP.</li><li><span class=\"tn-icon tn-brand tn-brand-antigravity\"></span>&nbsp;Google Antigravity by downloading and setting up an ACP for Trilium.</li><li><span class=\"tn-icon tn-brand tn-brand-codex\"></span>&nbsp;OpenAI Codex by reusing your CLI through an ACP adapter shipped with Trilium.</li></ul><h2>Local/self-hosted providers</h2><p>Local or self-hosted providers are a free alternative which respects your privacy but requires specific hardware.</p><p>Trilium directly supports the following local providers:</p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><span class=\"tn-icon tn-brand tn-brand-ollama\"></span>&nbsp;Ollama</p><div class=\"trilium-tab-panel\"><p>Generally Ollama runs in the background so it should be directly usable in Trilium as long as the models are downloaded (e.g. <code>ollama pull llama3.2</code>).</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><span class=\"tn-icon tn-brand tn-brand-lmstudio\"></span>&nbsp;LM Studio</p><div class=\"trilium-tab-panel\"><p>The OpenAI-compatible server is <strong>disabled</strong> by default in LM Studio installations. First download your desired models through the graphical interface, then go to <em>Settings</em> → <em>Developer</em> and toggle <em>Developer mode</em>. On the left there will be a new <em>Developer</em> tab, with a toggle to start it up.</p></div></section></div><p>Even for local providers that are not directly supported by Trilium, you can still use a custom endpoint (see below).</p><aside class=\"admonition warning\"><p>When dealing with self-hosted LLM models, depending on the training and the size of the model, the quality of the output may vary. Before <a href=\"#root/_help_wy8So3yZZlH9\">reporting issues</a> regarding the quality of the output (e.g. hallucinating tool calls), consider benchmarking the response against a cloud provider (Claude Sonnet is recommended).</p></aside><h2>Custom endpoints</h2><p>If your desired hosted (e.g. OpenRouter, Groq, Mistral) or local LLM provider is not listed in Trilium, you can use the dedicated <em>OpenAI-compatible</em> provider from the <em>Custom endpoint</em> section.</p><p>This allows you to set the base URL to an OpenAI-compatible API, with an optional API key if required by the service.</p><p>Enter the base URL exactly as the service documents it, including its version path, such as <code>https://api.groq.com/openai/v1</code> or <code>https://open.bigmodel.cn/api/paas/v4</code>. Only a bare host such as <code>http://localhost:8080</code> is completed with <code>/v1</code>.</p><p>The endpoint can run on the same machine as Trilium, elsewhere on your local network or on a Tailscale tailnet. Trilium refuses link-local addresses (<code>169.254.0.0/16</code>) and cloud metadata endpoints, which no model server is served on.</p><p>For custom endpoints, the pricing of the models is not known so the cost of a conversation will not be displayed; this is especially relevant for hosted providers.</p>",
"_help_eFhxp9laTW1S": "<p>Some cloud providers offer a subscription, which has a fixed monthly fee instead of pay-per-use (unlike the API keys).</p><p>In a nutshell, subscription-based providers work by either reusing your existing CLI tools (e.g. Claude Code, GitHub Copilot and OpenAI Codex via ACP) whereas some require installing the ACP server manually (e.g. Google Antigravity). Because they require something to be installed on your device, these providers are not available on Mobile (Android or iOS) or standalone mode.</p><p>See also the dedicated&nbsp;<a class=\"reference-link\" href=\"#root/_help_cRRrdZjgyhNc\">Privacy</a>&nbsp;section to better understand what data is being sent to a cloud provider.</p><h2><span class=\"tn-icon tn-brand tn-brand-claude\"></span>&nbsp;Claude Code</h2><p>To use a subscription:</p><ol><li>First, Claude Code needs to be installed on the machine that runs Trilium. So for a&nbsp;<a class=\"reference-link\" href=\"#root/_help_poXkQfguuA0U\">Desktop Installation</a>, Claude needs to be installed locally and for a&nbsp;<a class=\"reference-link\" href=\"#root/_help_WOcw2SLH6tbX\">Server Installation</a>&nbsp;accessed via a browser, Claude needs to be installed on the server.</li><li>Claude Code must already be authenticated. To do so, run <code>claude</code> in a terminal once, type <code>/login</code> and follow the instructions.</li><li>Go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>AI / LLM</em> and add the Claude Code provider.</li></ol><details class=\"trilium-collapsible\"><summary>How Trilium identifies your Claude Code binary</summary><p>In this order:</p><ul><li>By looking for a <code>TRILIUM_CLAUDE_CODE_PATH</code> environment variable pointing to the Claude binary. This allows overriding the path if needed.</li><li>By looking for <code>claude</code> in your PATH, generally works in most circumstances.</li><li>By asking your login shell for its <code>PATH</code> which lets a desktop install find a CLI installed through <code>nvm</code>, <code>fnm</code>, <code>asdf</code> or Homebrew, since a GUI-launched app doesn't inherit your terminal's environment.</li></ul></details><p>After your provider is set up, you'll benefit from the same features as an API key (note tools, web search, extended thinking, image/PDF attachments, streaming).</p><aside class=\"admonition note\"><p>Trilium intentionally uses your Claude Code binary in order not to have to package a ~250 MB client with it, but this comes at a cost: there is a small risk for a version incompatibility, if the version installed locally doesn't match the one expected by Trilium. Generally it's best to keep both Claude Code and Trilium updated to the latest version.</p></aside><h2><span class=\"tn-icon tn-brand tn-brand-github-copilot\"></span>&nbsp;GitHub Copilot</h2><aside class=\"admonition note\"><p>This subscription-based provider is still in beta. It is safe to use (won't use additional funds and respects the terms of use), but you might experience small issues. Consider&nbsp;<a class=\"reference-link\" href=\"#root/_help_wy8So3yZZlH9\">Reporting issues</a>.</p></aside><p>GitHub Copilot gives access to the models of your GitHub Copilot subscription (Pro, Pro+, Business or Enterprise), without an API key. Usage counts against your Copilot plan.</p><ol><li>Install the GitHub Copilot CLI on the machine that runs Trilium, for example with <code>npm install -g @github/copilot</code>. As with Claude Code, for a&nbsp;<a class=\"reference-link\" href=\"#root/_help_WOcw2SLH6tbX\">Server Installation</a>&nbsp;it needs to be installed on the server.</li><li>Sign in by running <code>copilot login</code> in a terminal once. If you already use GitHub Copilot in another editor on the same machine, that login is reused.</li><li>Go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>AI / LLM</em> and add the GitHub Copilot provider.</li></ol><details class=\"trilium-collapsible\"><summary>How Trilium identifies your Copilot CLI binary</summary><p>In this order:</p><ul><li>By looking for a <code>TRILIUM_COPILOT_PATH</code> environment variable pointing to the Copilot binary.</li><li>By looking for <code>copilot</code> in your PATH.</li><li>By asking your login shell for its <code>PATH</code>, the same as for Claude Code.</li></ul></details><h3>Known limitations</h3><ul><li>The agent can only work with your notes through Trilium's note tools; its own file, shell and web tools are blocked for security reasons.</li><li>Images can be attached to the conversation, PDFs cannot. The LLM should still be able to read PDF notes and attachments via&nbsp;<a class=\"reference-link\" href=\"#root/_help_TiQbQDgP8L5t\">Text Extraction (OCR)</a>&nbsp;when the note tools are enabled.</li></ul><h2><span class=\"tn-icon tn-brand tn-brand-antigravity\"></span>&nbsp;Google Antigravity</h2><aside class=\"admonition note\"><p>This subscription-based provider is still in beta. It is safe to use (won't use additional funds and respects the terms of use), but you might experience small issues. Consider&nbsp;<a class=\"reference-link\" href=\"#root/_help_wy8So3yZZlH9\">Reporting issues</a>.</p></aside><p>Google Antigravity gives access to Gemini models using a Google account (free, Google AI Pro or Google AI Ultra), without an API key. At the time of writing, a free Google account is enough to use it.</p><p>Unlike Claude Code or GitHub Copilot, Google's Antigravity ACP server is not part of the CLI so it needs to be installed manually just for Trilium. The downloaded archive is around 112-334 MB and the extracted size is around 230 MB-2 GB based on the platform.</p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><span class=\"tn-icon bx bxl-windows\"></span>&nbsp;Windows</p><div class=\"trilium-tab-panel\"><ol><li>Download Google's Antigravity ACP server for your platform. The link is shown when adding the provider in&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>AI / LLM</em>. Unpack it on the device that runs Trilium.</li><li>Make it findable by Trilium, either:<ol><li>by adding the unpacked folder to your PATH, or</li><li>by setting a <code>TRILIUM_ANTIGRAVITY_ACP_PATH</code> environment variable pointing to <code>agy_acp_server.exe</code>.</li></ol></li><li>Go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ AI / LLM and add the&nbsp;<span class=\"tn-icon tn-brand tn-brand-antigravity\"></span> <em>Google Antigravity</em> provider. When the list of models is loaded for the first time, the Google sign-in page opens in a browser on the machine running Trilium; finish signing in there.</li></ol></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><span class=\"tn-icon bx bxl-tux\"></span>&nbsp;Linux &amp;&nbsp;<span class=\"tn-icon bx bxl-apple\"></span> macOS</p><div class=\"trilium-tab-panel\"><ol><li>Download Google's Antigravity ACP server for your platform. The link is shown when adding the provider in&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>AI / LLM</em>. Unpack it on the device that runs Trilium.</li><li>Make it findable by Trilium, either:<ol><li>by adding the unpacked folder to your PATH, or</li><li>by setting a <code>TRILIUM_ANTIGRAVITY_ACP_PATH</code> environment variable pointing to <code>agy_acp_server.par</code>.</li></ol></li><li>Go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ AI / LLM and add the&nbsp;<span class=\"tn-icon tn-brand tn-brand-antigravity\"></span> <em>Google Antigravity</em> provider. When the list of models is loaded for the first time, the Google sign-in page opens in a browser on the machine running Trilium; finish signing in there.</li></ol></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">NixOS</p><div class=\"trilium-tab-panel\"><ol><li><p>On NixOS, <code>antigravity-acp</code> package is already available but only in <code>nixos-unstable</code> at the time of writing. The easiest method to test it out is to use the <code>nix shell</code> with flakes:</p><pre><code class=\"language-text-x-trilium-auto\">NIXPKGS_ALLOW_UNFREE=1 nix shell --impure github:nixos/nixpkgs/nixos-unstable#antigravity-acp\ntrilium</code></pre></li><li><p>Go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ AI / LLM and add the&nbsp;<span class=\"tn-icon tn-brand tn-brand-antigravity\"></span> <em>Google Antigravity</em> provider. When the list of models is loaded for the first time, the Google sign-in page opens in a browser on the machine running Trilium; finish signing in there.</p></li></ol></div></section></div><aside class=\"admonition note\"><p>Trilium needs <code>curl</code> to use Google Antigravity. It comes with Windows 10 and later, macOS and most Linux distributions.</p></aside><h3>Known limitations</h3><ul><li>The agent can only work with your notes through Trilium's note tools; its own file and shell tools are blocked for security reasons.</li><li>The Antigravity ACP server requires authentication via a login link. The login link needs to be run on the same device, so it might not be possible to set up the provider while using the web version of a Docker installation.&nbsp;<a class=\"reference-link\" href=\"#root/_help_poXkQfguuA0U\">Desktop Installation</a>&nbsp;should work fine.</li><li>Images can be attached to the conversation, PDFs cannot. The LLM should still be able to read PDF notes and attachments via&nbsp;<a class=\"reference-link\" href=\"#root/_help_TiQbQDgP8L5t\">Text Extraction (OCR)</a>&nbsp;when the note tools are enabled.</li><li>The results of tool calls (e.g. reading a note, writing attributes) are not properly displayed because they are not exposed by the ACP server.</li></ul><h2><span class=\"tn-icon tn-brand tn-brand-codex\"></span>&nbsp;OpenAI Codex</h2><aside class=\"admonition note\"><p>This subscription-based provider is still in beta. It is safe to use (won't use additional funds and respects the terms of use), but you might experience small issues. Consider&nbsp;<a class=\"reference-link\" href=\"#root/_help_wy8So3yZZlH9\">Reporting issues</a>.</p></aside><p>OpenAI Codex gives access to the Codex models of your ChatGPT plan (Free, Go, Plus, Pro or Business), without an API key. At the time of writing, a free ChatGPT account is enough to use it. Usage counts against your plan's Codex limits, which are small on the Free plan.</p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><span class=\"tn-icon bx bxl-windows\"></span><span class=\"tn-icon bx bxl-tux\"></span><span class=\"tn-icon bx bxl-apple\"></span>&nbsp;Most platforms</p><div class=\"trilium-tab-panel\"><ol><li>Install the Codex CLI on the machine that runs Trilium, for example with <code>npm install -g @openai/codex</code>. As with Claude Code, for a&nbsp;<a class=\"reference-link\" href=\"#root/_help_WOcw2SLH6tbX\">Server Installation</a>&nbsp;it needs to be installed on the server. Trilium ships the ACP adapter that connects to it, so nothing else is needed.</li><li>Go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>AI / LLM</em> and add the&nbsp;<span class=\"tn-icon tn-brand tn-brand-codex\"></span> <em>OpenAI Codex</em> provider. When the list of models is loaded for the first time, the ChatGPT sign-in page opens in a browser on the machine running Trilium; finish signing in there.</li></ol></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">NixOS</p><div class=\"trilium-tab-panel\"><ol><li><p>On NixOS, Codex is available as the <code>codex</code> package in nixpkgs. The stable channel can lag behind Codex's releases, so a newer version can be taken from <code>nixos-unstable</code>:</p><pre><code class=\"language-text-x-sh\">nix shell github:nixos/nixpkgs/nixos-unstable#codex\ntrilium</code></pre></li><li><p>Go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>AI / LLM</em> and add the&nbsp;<span class=\"tn-icon tn-brand tn-brand-codex\"></span> <em>OpenAI Codex</em> provider. When the list of models is loaded for the first time, the ChatGPT sign-in page opens in a browser on the machine running Trilium; finish signing in there.</p></li></ol></div></section></div><p>Trilium keeps its own Codex sign-in and settings, separate from any Codex CLI you use in a terminal, so an existing <code>codex login</code> is not reused.</p><details class=\"trilium-collapsible\"><summary>How Trilium identifies your Codex CLI binary</summary><p>In this order:</p><ul><li>By looking for a <code>TRILIUM_CODEX_PATH</code> environment variable pointing to the Codex binary.</li><li>By looking for <code>codex</code> in your PATH.</li><li>By asking your login shell for its <code>PATH</code>, the same as for Claude Code.</li></ul></details><aside class=\"admonition note\"><p>Trilium needs <code>curl</code> to use OpenAI Codex, the same as for Google Antigravity: Trilium checks every tool call Codex makes through it. It comes with Windows 10 and later, macOS and most Linux distributions.</p></aside><h3>Known limitations</h3><ul><li>The agent can only work with your notes through Trilium's note tools, and search the web when the chat allows it; its own file, shell and other tools are blocked for security reasons.</li><li>The ChatGPT sign-in opens in a browser on the device running Trilium, so it might not be possible to set up the provider while using the web version of a Docker installation.&nbsp;<a class=\"reference-link\" href=\"#root/_help_poXkQfguuA0U\">Desktop Installation</a>&nbsp;should work fine.</li><li>Images and SVGs can be attached to the conversation, PDFs cannot. The LLM should still be able to read PDF notes and attachments via&nbsp;<a class=\"reference-link\" href=\"#root/_help_TiQbQDgP8L5t\">Text Extraction (OCR)</a>&nbsp;when the note tools are enabled.</li></ul>",
- "_help_cRRrdZjgyhNc": "<p>Trilium sends nothing to an AI provider until you send a message. Enabling the integration, adding a provider or opening a chat transmits nothing on its own, the one exception is that listing a provider's models sends your API key to that provider, so the list can be fetched.</p><p>Once you send a message or run the&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>, what leaves your machine depends on the provider you chose and on which context options are enabled.</p><h2>Where your notes go</h2><figure class=\"table\"><table><thead><tr><th>Provider type</th><th>Destination</th></tr></thead><tbody><tr><td>Cloud providers</td><td>The provider's servers (Anthropic, OpenAI, Google, DeepSeek)</td></tr><tr><td>Subscription-based</td><td>The provider's servers, via Claude Code running locally</td></tr><tr><td>Local / self-hosted</td><td>Nothing leaves the machine running the model</td></tr><tr><td>Custom endpoint</td><td>Wherever it was pointed, which may be your own hardware or a hosted service</td></tr></tbody></table></figure><p>This is the reason the provider list is grouped this way, and why Trilium pre-selects nothing: the choice of where your note content is sent is made explicitly by you, before anything is sent.</p><aside class=\"admonition note\"><p>The&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>&nbsp;has a model selection of its own, so it may be answered by a different provider than the one in the chat. The row at the bottom of the assistant's menu always names the one being used.</p></aside><h2>What is actually sent</h2><ul><li><strong>Always, with every message</strong><ul><li>The conversation itself: your messages and the assistant's replies, including earlier turns</li><li>Trilium's system prompt describing how to format answers and use tools.</li></ul></li><li><strong>The current note, only when note context is enabled.</strong><ul><li>In the sidebar chat this is the file icon at the bottom; the dedicated chat note type never sends a current note.</li><li>What travels is a metadata block: the note's ID, title, type, creation and modification dates, its parent IDs, the titles of up to 20 children, up to 20 attributes, and a preview of the content.</li><li>Notes above a size threshold send a size hint instead of the text, and the model must call a tool to read further.</li></ul></li><li><strong>Any note the model asks for, when note access is enabled.</strong><ul><li>Tools let the model search your tree and read notes, attributes and attachments beyond the current one.</li><li>It decides what to fetch, and each call waits for you to allow it, unless the chat's permission mode lets reads or every call run on their own, or you allowed that tool for the chat. There is no per-note permission system, so the reachable scope is your whole tree.</li></ul></li><li><strong>Attachments and mentions</strong>, when you add them: images, PDFs and text files are sent to the provider, and an <code>@</code> mention makes that note fetchable.</li><li><strong>Your search query</strong>, when web search is enabled, the model's search terms reach the provider's own search infrastructure, or the search provider chosen in the <em>Tools</em> menu (Brave Search, Tavily, Exa, Serper, Perplexity or your SearXNG instance).</li><li><strong>The pages the model reads</strong>, when web search goes through a search provider or a DeepSeek model's built-in search: Trilium fetches each page the model asks for from the site itself, so the site sees a request from the machine running Trilium. The page's text is then sent to the model's provider.</li></ul><h2>The in-editor AI assistant</h2><p>A run of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>&nbsp;sends a different set than a chat message. For quick actions, it sends it the moment you pick an action, there is no send button to reconsider at. For the free-form <em>Ask AI</em>, there is a dedicated send button and model selector.</p><ul><li><strong>The passage you selected</strong>, or the paragraph the cursor is in when you pick a quick action without selecting anything.</li><li><strong>Up to 1500 characters of the note on each side of that passage</strong>, as plain text. The assistant is told this is context only and must not be rewritten, but it is sent regardless of whether you selected it: a run on a single sentence still transmits the paragraphs around it.</li><li><strong>Where the note sits</strong>: its title and the titles of its parents, as a breadcrumb.</li><li><strong>Trilium's writing-assistant instructions</strong>, which describe the formatting it may produce.</li><li><strong>Earlier turns of the same exchange</strong>, once you follow up on a response.</li></ul><p>No note metadata block is sent, web search is never enabled, and the assistant has no note tools so it can read nothing beyond the text listed above.</p><h2>Protected notes</h2><p>While your <a href=\"#root/_help_bwg0e8ewQMak\">protected session</a> is locked, protected notes send neither title nor content. <strong>While it is unlocked they are treated like any other note,</strong> a note the model reads through a tool is sent to the provider in full. If you keep sensitive material in protected notes, be aware that unlocking them removes that boundary for the duration of the session.</p><p>The same applies to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>: it works on whatever is open in the editor, so running it inside an unlocked protected note sends that note's text like any other.</p><h2>What you control</h2><ul><li><strong>Which provider</strong>: the single decision that determines whether anything leaves your machine at all.</li><li><strong>Note access</strong>: turn it off in the <span class=\"tn-icon bx bx-shield-quarter\"></span><em>Tools</em> menu at the bottom of the chat, and the model can read nothing beyond what you type.</li><li><strong>The current note:</strong> the file icon in the sidebar chat.</li><li><strong>Web search:</strong> also in the <em>Tools</em> menu.</li><li><strong>Which tool calls ask first:</strong> the <em>Permissions</em> submenu of the <em>Tools</em> menu. <em>Always ask</em> has every call wait for you, reads included. A new chat starts in the mode you picked last, so a chat after one set to <em>Don't ask</em> asks about nothing either. Until you pick a mode, chats start in <em>Ask before changes</em>, where the AI reads and searches your notes without asking.</li><li><strong>The editor assistant</strong>: it has no per-run toggles. What you control is whether you run it, what you select before you do and which model answers.</li></ul><p>With note access and note context both off, the provider receives only the words you typed.</p><h2>Keeping everything local</h2><p>Adding an Ollama or LM Studio provider keeps every message on the machine running the model, and Trilium marks their models as free because no metered API is involved. The trade-off is quality and hardware: a small local model may fail at tool calls that a cloud model handles, so a local setup that misbehaves is worth benchmarking against a cloud provider before reporting it as a bug.</p><h2>Telemetry &amp; security</h2><p>Trilium itself collects no telemetry from the AI integration.</p><p>Your API key is stored in your database, sent only to the provider it belongs to, and is write-only through the options API so that a malevolent&nbsp;<a class=\"reference-link\" href=\"#root/_help_CdNpE2pqjmI6\">Scripting</a>&nbsp;cannot access it. If you have backend or SQL console access enabled, a malevolent script <strong>could potentially exfiltrate your API keys</strong>.</p><p>The built-in MCP server is off by default. When enabled, every request must carry an ETAPI token, which grants the same full read and write access to your notes as the REST API; treat one like a password. On desktop it is reachable only from <code>localhost</code> unless you turn on&nbsp;<a class=\"reference-link\" href=\"#root/_help_swSFivWk6KkA\">Network Access</a>.</p>",
- "_help_KOWBFgsZXJAD": "<p><a href=\"https://en.wikipedia.org/wiki/Model_Context_Protocol\">Model Context Protocol</a> allows external chat applications such as Claude Code to have access to the Trilium database.</p><h2>Built-in MCP</h2><p>v0.103.0 comes with a built-in MCP server that is not active by default. To activate it, go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ AI/LLM and toggle the <em>MCP server</em> option.</p><p>Once the MCP is active, simply add the MCP server to your AI assistant. The URL to use is displayed in the <em>Endpoint</em> <em>URL</em> information underneath the MCP toggle.</p><p>Only the HTTP transport is supported, the <code>stdio</code> method is not supported. If that is a blocker, consider using a third-party alternative listed below.</p><p>The tools exposed to the MCP are the same tools that are supported by the internal chat (see the <em>Note access</em> section).</p><h3>Approving tool calls</h3><p>Trilium does not ask for approval of the calls an external assistant makes; that is left to the assistant's own permission settings. To help it decide, each tool tells the assistant whether it only reads your notes, only adds to them (creating a note, cloning it or appending to it), or can overwrite or remove something (editing, renaming, moving or deleting). An assistant that supports these hints can then run reads on their own and ask before changes, the way <em>Ask before changes</em> does in Trilium's chat.</p><h3>Authentication</h3><p>To protect your notes from unauthorized access, the MCP server requires authentication. Generally MCP servers need to support OAuth for authentication, but Trilium uses a simpler mechanism using Bearer tokens.</p><p>To configure authentication, first create an&nbsp;<a class=\"reference-link\" href=\"#root/_help_pgxEVkzLl1OP\">ETAPI (REST API)</a>&nbsp;token by going to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>ETAPI</em>. Then follow the instructions in&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>AI / LLM</em>, by looking at the <em>How to connect an assistant</em> section under MCP.</p><h2>Third-party alternatives</h2><p>The following are alternatives to Trilium's built-in MCP feature. Since Trilium's AI implementation is still experimental, its tooling might not be as mature as external tools.</p><ul><li><a href=\"https://github.com/perfectra1n/triliumnext-mcp\">perfectra1n/triliumnext-mcp</a></li><li><a href=\"https://github.com/tan-yong-sheng/triliumnext-mcp\">tan-yong-sheng/triliumnext-mcp</a></li><li><a href=\"https://github.com/eliassoares/trilium-fastmcp\">eliassoares/trilium-fastmcp</a></li></ul><aside class=\"admonition important\"><p>These solutions are third-party and thus not endorsed or supported directly by the Trilium Notes team. Please address questions and issues on their corresponding repository instead.</p></aside>",
+ "_help_cRRrdZjgyhNc": "<p>Trilium sends nothing to an AI provider until you send a message. Enabling the integration, adding a provider or opening a chat transmits nothing on its own, the one exception is that listing a provider's models sends your API key to that provider, so the list can be fetched.</p><p>Once you send a message or run the&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>, what leaves your machine depends on the provider you chose and on which context options are enabled.</p><h2>Where your notes go</h2><figure class=\"table\"><table><thead><tr><th>Provider type</th><th>Destination</th></tr></thead><tbody><tr><td>Cloud providers</td><td>The provider's servers (Anthropic, OpenAI, Google, DeepSeek)</td></tr><tr><td>Subscription-based</td><td>The provider's servers, via Claude Code running locally</td></tr><tr><td>Local / self-hosted</td><td>Nothing leaves the machine running the model</td></tr><tr><td>Custom endpoint</td><td>Wherever it was pointed, which may be your own hardware or a hosted service</td></tr></tbody></table></figure><p>This is the reason the provider list is grouped this way, and why Trilium pre-selects nothing: the choice of where your note content is sent is made explicitly by you, before anything is sent.</p><aside class=\"admonition note\"><p>The&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>&nbsp;has a model selection of its own, so it may be answered by a different provider than the one in the chat. The row at the bottom of the assistant's menu always names the one being used.</p></aside><h2>What is actually sent</h2><ul><li><strong>Always, with every message</strong><ul><li>The conversation itself: your messages and the assistant's replies, including earlier turns</li><li>Trilium's system prompt describing how to format answers and use tools.</li></ul></li><li><strong>The current note, only when note context is enabled.</strong><ul><li>In the sidebar chat this is the file icon at the bottom; the dedicated chat note type never sends a current note.</li><li>What travels is a metadata block: the note's ID, title, type, creation and modification dates, its parent IDs, the titles of up to 20 children, up to 20 attributes, and a preview of the content.</li><li>Notes above a size threshold send a size hint instead of the text, and the model must call a tool to read further.</li></ul></li><li><strong>Any note the model asks for, when note access is enabled.</strong><ul><li>Tools let the model search your tree and read notes, attributes and attachments beyond the current one.</li><li>It decides what to fetch, and each call waits for you to allow it, unless the chat's permission mode lets reads or every call run on their own, or you allowed that tool for the chat. The reachable scope is your whole tree, except for notes you exclude (see <em>Excluding notes</em> below).</li></ul></li><li><strong>Attachments and mentions</strong>, when you add them: images, PDFs and text files are sent to the provider, and an <code>@</code> mention makes that note fetchable.</li><li><strong>Your search query</strong>, when web search is enabled, the model's search terms reach the provider's own search infrastructure, or the search provider chosen in the <em>Tools</em> menu (Brave Search, Tavily, Exa, Serper, Perplexity or your SearXNG instance).</li><li><strong>The pages the model reads</strong>, when web search goes through a search provider or a DeepSeek model's built-in search: Trilium fetches each page the model asks for from the site itself, so the site sees a request from the machine running Trilium. The page's text is then sent to the model's provider.</li></ul><h2>The in-editor AI assistant</h2><p>A run of the&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>&nbsp;sends a different set than a chat message. For quick actions, it sends it the moment you pick an action, there is no send button to reconsider at. For the free-form <em>Ask AI</em>, there is a dedicated send button and model selector.</p><ul><li><strong>The passage you selected</strong>, or the paragraph the cursor is in when you pick a quick action without selecting anything.</li><li><strong>Up to 1500 characters of the note on each side of that passage</strong>, as plain text. The assistant is told this is context only and must not be rewritten, but it is sent regardless of whether you selected it: a run on a single sentence still transmits the paragraphs around it.</li><li><strong>Where the note sits</strong>: its title and the titles of its parents, as a breadcrumb.</li><li><strong>Trilium's writing-assistant instructions</strong>, which describe the formatting it may produce.</li><li><strong>Earlier turns of the same exchange</strong>, once you follow up on a response.</li></ul><p>No note metadata block is sent, web search is never enabled, and the assistant has no note tools so it can read nothing beyond the text listed above.</p><h2>Protected notes</h2><p>While your <a href=\"#root/_help_bwg0e8ewQMak\">protected session</a> is locked, protected notes send neither title nor content. <strong>While it is unlocked they are treated like any other note,</strong> a note the model reads through a tool is sent to the provider in full. If you keep sensitive material in protected notes, be aware that unlocking them removes that boundary for the duration of the session.</p><p>The same applies to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a>: it works on whatever is open in the editor, so running it inside an unlocked protected note sends that note's text like any other.</p><h2>Excluding notes</h2><p>Add the <code>#excludeFromLlm</code> <a href=\"#root/_help_HI6GBBIduIgv\">label</a> to a note to hide it from the AI chat and the <a href=\"#root/_help_KOWBFgsZXJAD\">MCP server</a>. The label covers only that note: the notes below it stay visible unless you make the label <a href=\"#root/_help_bwZpz2ajCEwO\">inheritable</a>, and a child can opt back in with <code>#excludeFromLlm=false</code>.</p><p>For an excluded note:</p><ul><li>The note tools report it as not found: it is left out of search results, child lists and subtrees, and relations that point to it are not shown.</li><li>The model cannot read, edit, move, clone or rename it, create notes under it, or remove the label. It also cannot delete a note that has an excluded note below it.</li><li>Its metadata is not sent as the current note, even when note context is enabled.</li><li>A visible child does not show it as a parent, and the model cannot move the child out of it.</li></ul><p>Unlike a protected note, an excluded note stays hidden while your protected session is unlocked. The exclusion applies to the note tools only. It is not encryption, and it does not cover:</p><ul><li>Files you attach to a message yourself.</li><li>The <a class=\"reference-link\" href=\"#root/_help_VRoP0g1uHHc2\">In-editor AI assistant</a> when you run it inside the note.</li><li>Text from the note that appears in other notes, such as a link with the note's title.</li></ul><h2>What you control</h2><ul><li><strong>Which provider</strong>: the single decision that determines whether anything leaves your machine at all.</li><li><strong>Note access</strong>: turn it off in the <span class=\"tn-icon bx bx-shield-quarter\"></span><em>Tools</em> menu at the bottom of the chat, and the model can read nothing beyond what you type.</li><li><strong>The current note:</strong> the file icon in the sidebar chat.</li><li><strong>Notes the AI cannot reach:</strong> the <code>#excludeFromLlm</code> label, see <em>Excluding notes</em> above.</li><li><strong>Web search:</strong> also in the <em>Tools</em> menu.</li><li><strong>Which tool calls ask first:</strong> the <em>Permissions</em> submenu of the <em>Tools</em> menu. <em>Always ask</em> has every call wait for you, reads included. A new chat starts in the mode you picked last, so a chat after one set to <em>Don't ask</em> asks about nothing either. Until you pick a mode, chats start in <em>Ask before changes</em>, where the AI reads and searches your notes without asking.</li><li><strong>The editor assistant</strong>: it has no per-run toggles. What you control is whether you run it, what you select before you do and which model answers.</li></ul><p>With note access and note context both off, the provider receives only the words you typed.</p><h2>Keeping everything local</h2><p>Adding an Ollama or LM Studio provider keeps every message on the machine running the model, and Trilium marks their models as free because no metered API is involved. The trade-off is quality and hardware: a small local model may fail at tool calls that a cloud model handles, so a local setup that misbehaves is worth benchmarking against a cloud provider before reporting it as a bug.</p><h2>Telemetry &amp; security</h2><p>Trilium itself collects no telemetry from the AI integration.</p><p>Your API key is stored in your database, sent only to the provider it belongs to, and is write-only through the options API so that a malevolent&nbsp;<a class=\"reference-link\" href=\"#root/_help_CdNpE2pqjmI6\">Scripting</a>&nbsp;cannot access it. If you have backend or SQL console access enabled, a malevolent script <strong>could potentially exfiltrate your API keys</strong>.</p><p>The built-in MCP server is off by default. When enabled, every request must carry an ETAPI token, which grants the same full read and write access to your notes as the REST API; treat one like a password. On desktop it is reachable only from <code>localhost</code> unless you turn on&nbsp;<a class=\"reference-link\" href=\"#root/_help_swSFivWk6KkA\">Network Access</a>.</p>",
+ "_help_KOWBFgsZXJAD": "<p><a href=\"https://en.wikipedia.org/wiki/Model_Context_Protocol\">Model Context Protocol</a> allows external chat applications such as Claude Code to have access to the Trilium database.</p><h2>Built-in MCP</h2><p>v0.103.0 comes with a built-in MCP server that is not active by default. To activate it, go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ AI/LLM and toggle the <em>MCP server</em> option.</p><p>Once the MCP is active, simply add the MCP server to your AI assistant. The URL to use is displayed in the <em>Endpoint</em> <em>URL</em> information underneath the MCP toggle.</p><p>Only the HTTP transport is supported, the <code>stdio</code> method is not supported. If that is a blocker, consider using a third-party alternative listed below.</p><p>The tools exposed to the MCP are the same tools that are supported by the internal chat (see the <em>Note access</em> section). Notes with the <code>#excludeFromLlm</code> label are hidden from both, see <a class=\"reference-link\" href=\"#root/_help_cRRrdZjgyhNc\">Privacy</a>.</p><h3>Approving tool calls</h3><p>Trilium does not ask for approval of the calls an external assistant makes; that is left to the assistant's own permission settings. To help it decide, each tool tells the assistant whether it only reads your notes, only adds to them (creating a note, cloning it or appending to it), or can overwrite or remove something (editing, renaming, moving or deleting). An assistant that supports these hints can then run reads on their own and ask before changes, the way <em>Ask before changes</em> does in Trilium's chat.</p><h3>Authentication</h3><p>To protect your notes from unauthorized access, the MCP server requires authentication. Generally MCP servers need to support OAuth for authentication, but Trilium uses a simpler mechanism using Bearer tokens.</p><p>To configure authentication, first create an&nbsp;<a class=\"reference-link\" href=\"#root/_help_pgxEVkzLl1OP\">ETAPI (REST API)</a>&nbsp;token by going to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>ETAPI</em>. Then follow the instructions in&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>AI / LLM</em>, by looking at the <em>How to connect an assistant</em> section under MCP.</p><h2>Third-party alternatives</h2><p>The following are alternatives to Trilium's built-in MCP feature. Since Trilium's AI implementation is still experimental, its tooling might not be as mature as external tools.</p><ul><li><a href=\"https://github.com/perfectra1n/triliumnext-mcp\">perfectra1n/triliumnext-mcp</a></li><li><a href=\"https://github.com/tan-yong-sheng/triliumnext-mcp\">tan-yong-sheng/triliumnext-mcp</a></li><li><a href=\"https://github.com/eliassoares/trilium-fastmcp\">eliassoares/trilium-fastmcp</a></li></ul><aside class=\"admonition important\"><p>These solutions are third-party and thus not endorsed or supported directly by the Trilium Notes team. Please address questions and issues on their corresponding repository instead.</p></aside>",
"_help_Y84QCbArmK3z": "<aside class=\"admonition important\"><p><strong>Meeting transcription is in beta</strong></p><p>Meeting transcription is a new feature and is still in beta. It has not been tested on every operating system, audio setup and meeting application, so it might fail to capture the audio, miss part of a meeting or behave differently from what this page describes. Before relying on it for an important meeting, try it on a short call first.</p><p>If something does not work, please <a href=\"#root/_help_wy8So3yZZlH9\">report the issue</a>, mentioning your operating system and the meeting application you used. The <em>Keep recordings for troubleshooting</em> option described below keeps what is needed to reproduce a problem.</p></aside><p>Meeting transcription turns a meeting into text while it happens: Trilium listens to your microphone and to what the other participants say through your speakers, and writes down who said what in a new note. Recognition runs entirely on your device, so no audio leaves it (see <em>Privacy</em> below).</p><p>Meeting transcription is available only in the desktop application. It is not available when Trilium is accessed through a browser, nor in the mobile application.</p><h2>Enabling meeting transcription</h2><p>Meeting transcription is off by default. To turn it on, go to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>Transcription</em> and turn on <em>Meeting transcription</em>. This adds the <span class=\"tn-icon bx bx-microphone\"></span> <em>Transcribe meeting</em> button to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>, marked with a <em>Beta</em> badge.</p><p>The speech recognition models are not part of Trilium. The first time you transcribe a meeting, Trilium asks to download them; see&nbsp;<a class=\"reference-link\" href=\"#root/_help_ebyr7ES2SwOW\">Downloaded resources</a> for the sizes and how to manage them. Each device downloads its own copy.</p><h2>Transcribing a meeting</h2><ol><li>Press the <span class=\"tn-icon bx bx-microphone\"></span> <em>Transcribe meeting</em> button in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>.</li><li>If the models are not downloaded yet, confirm the download and wait for it to finish.</li><li>Trilium creates a text note titled with the current date and time (for example <em>Meeting 2026-10-15 14:30</em>) in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_S0Fos78ZfcY7\">Note Inbox</a>, opens it and starts transcribing. While it transcribes, the button turns into a <span class=\"tn-icon bx bx-stop-circle\"></span> <em>Stop transcribing</em> button and shows the time elapsed. Beside it, a reminder asks you to let everyone in the meeting know that it is being transcribed and to ask for their consent; it closes by itself after 10 seconds, or when you click it.</li><li>To end the transcription, press the <span class=\"tn-icon bx bx-stop-circle\"></span> <em>Stop transcribing</em> button. Trilium finishes transcribing what was already said before it stops.</li></ol><p>Only one meeting can be transcribed at a time. The note itself is an ordinary text note: you can take notes in it during the meeting, rename it or move it anywhere in the tree. It carries the <code>#meetingRecording</code> label.</p><p>Trilium tells you when your microphone or the meeting's audio is not being transcribed. It shows a message saying which one and why, the time on the button turns red and the button's tooltip says that some audio is not being transcribed:</p><ul><li><strong>Not captured</strong>: the transcription started without that audio, for example because there is no microphone or because Trilium was not allowed to record the screen and its audio. Connect the microphone or allow the recording, then stop the transcription and start it again.</li><li><strong>No audio</strong>: nothing has arrived from it for 10 seconds, as when its capture hangs. Stop the transcription and start it again; what was transcribed until then is kept.</li><li><strong>Only silence</strong>: it has delivered nothing but silence, for 15 seconds from your microphone or for a minute from the meeting. A microphone muted in your system's settings, or with a mute button of its own, does this. A meeting nobody speaks in for a minute does it too, so this message can be ignored when the others are just quiet.</li></ul><p>Each message shows once. <em>No audio</em> and <em>Only silence</em> clear by themselves once sound arrives again.</p><p>If the transcription stops on its own, for example because the audio could no longer be captured, Trilium shows a message and keeps everything transcribed until then. Closing Trilium during a meeting waits for the transcription to finish first.</p><h2>The transcript</h2><p>The transcript is stored as an <a href=\"#root/_help_0vhv7lsOLy82\">attachment</a> of the meeting note and is shown in a collapsible <em>Transcript</em> section above the note's content. It updates as the meeting goes on, one paragraph per speaker turn, each with the time it started. While the meeting is being transcribed, the header of the <em>Transcript</em> section shows the level of your microphone (<em>Me</em>) and of the meeting's audio (<em>Others</em>), so you can tell that both are being heard, even while the section is collapsed; a source that is not being transcribed is marked <em>Not captured</em>, <em>No audio</em> or <em>Only silence</em>. While someone is talking, <em>Speaking…</em> shows under their name until their words are transcribed. If you are reading the end of the transcript, it scrolls to follow new text.</p><p>The <em>Transcript</em> section is expanded each time the note is opened. To collapse it, click its header; it stays collapsed only until the note is opened again.</p><p>The transcript is also listed among the note's attachments, under <em>Generated by Trilium</em>. Opening it from there shows the same view of the transcript. Deleting the attachment deletes the transcript, and the section disappears from the note.</p><ul><li>What you say into your microphone is labeled <em>Me</em>.</li><li>What the other participants say is labeled <em>Speaker 1</em>, <em>Speaker 2</em> and so on, while <em>Identify speakers</em> is on; otherwise it is labeled <em>Others</em>.</li><li>To name a speaker, click their name, type the new name and press <kbd>Enter</kbd>. The name changes on every turn of that speaker. Press <kbd>Esc</kbd> to cancel, or clear the name to restore the default one.</li><li>To show the transcript with or without hesitations such as \"uh\", \"um\" and stuttered words, press the <span class=\"tn-icon bx bx-eraser\"></span> <em>Hide filler words</em> button above it, which shows as pressed while they are hidden. While they are shown, they are grayed out, so you can see what hiding them would remove. This affects only what is shown; the stored transcript keeps every word.</li><li>To copy the transcript as plain text, press the <span class=\"tn-icon bx bx-copy\"></span> <em>Copy transcript</em> button above it. Each turn is copied with the speaker's name and the time it started, as shown, so the copy leaves out filler words while they are hidden.</li></ul><p>If the meeting note is <a href=\"#root/_help_bwg0e8ewQMak\">protected</a> and the protected session is locked during the meeting, the transcript cannot be saved. Trilium keeps it in memory and saves it once you enter the protected session again, as long as Trilium stays open.</p><h2>Configuration</h2><p>The settings are in&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>&nbsp;→ <em>Transcription</em>, and are shown once <em>Meeting transcription</em> is on.</p><figure class=\"table\"><table><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><em>European languages</em></td><td>The speech recognition model. Both are versions of NVIDIA's Parakeet TDT 0.6B v3 model and recognize 25 European languages and work out which one is spoken. <em>Standard</em> is a smaller download and runs well on most computers. <em>High accuracy</em> makes fewer mistakes, but is a larger download and needs about 1.6 GB more memory while transcribing. A model is downloaded the first time you transcribe with it.</td></tr><tr><td><em>Identify speakers</em></td><td>Tells the other participants apart and labels each of them separately, using the TitaNet model. Voices are compared only during the meeting: nothing about a voice is stored, and no one is recognized from one meeting to the next. Turn it off if it mixes up voices. The change applies from the next meeting.</td></tr><tr><td><em>Keep recordings for troubleshooting</em></td><td>Keeps the audio of the meeting, the settings used and the transcript as it was produced, so that a problem can be reported and reproduced. It takes about 230 MB per hour of meeting and is never deleted automatically. The folder where they are kept is shown below the option.</td></tr></tbody></table></figure><aside class=\"admonition warning\"><p>Before turning on <em>Keep recordings for troubleshooting</em>, ask everyone in the meeting to agree to being recorded. In several countries and US states, recording a conversation without everyone's consent is a criminal offense. The audio is stored unencrypted, even for protected notes. While the option is on, the tooltip of the <em>Transcribe meeting</em> button says so, and the reminder shown when the transcription starts mentions that the audio is kept.</p></aside><p>The sizes and licenses of the models are listed in <a class=\"reference-link\" href=\"#root/_help_ebyr7ES2SwOW\">Downloaded resources</a>.</p><h2>Privacy</h2><p>Meeting transcription does not use any online service:</p><ul><li>The audio is recognized on your device by the open-source sherpa-onnx engine. Trilium does not send the audio or the transcript to any online service, and no account or API key is needed.</li><li>An Internet connection is needed only to download the models, from Hugging Face and from the sherpa-onnx project on GitHub. Once they are downloaded, meeting transcription works offline.</li><li>Speaker identification compares voices only during the meeting. Nothing about a voice is stored.</li><li>The audio is not kept, unless <em>Keep recordings for troubleshooting</em> is on. Those recordings stay in a folder on your device and are never synchronized.</li></ul><p>The transcript itself is an attachment of the meeting note, so it is handled like the rest of your notes. If you use <a class=\"reference-link\" href=\"#root/_help_cbkrhQjrkKrh\">Synchronization</a>, it is synchronized to your sync server and your other devices. To keep it encrypted, transcribe into a <a href=\"#root/_help_bwg0e8ewQMak\">protected</a> note: the transcript of a protected note is protected too.</p><h2>Limitations</h2><ul><li>Meeting transcription needs a speech recognition engine that does not load on every computer, for example on Linux distributions older than Ubuntu 22.04 or Debian 12. Where it does not load, the <em>Transcribe meeting</em> button does not appear, the <em>Transcription</em> options say so, and the log records why.</li><li>The transcript is made from the audio played by your device. A participant whose voice does not come out of your speakers or headphones, for example someone in the same room, is transcribed only as far as your microphone picks them up, and is labeled <em>Me</em>.</li><li>Speaker identification works best with a few clearly distinct voices. Similar voices, many participants or poor call quality can lead to speakers being merged or split.</li><li>Accuracy is lower for languages other than English, and the model can switch to the wrong language for short passages.</li><li>Transcribing uses a noticeable amount of processor time and memory, especially with the <em>High accuracy</em> model.</li></ul>",
"_help_CdNpE2pqjmI6": "<p>Trilium supports creating&nbsp;<a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a>&nbsp;notes, i.e. notes which allow you to store some programming code and highlight it. Special case is JavaScript code notes which can also be executed inside Trilium which can in conjunction with&nbsp;<a class=\"reference-link\" href=\"#root/_help_GLks18SNjxmC\">Script API</a>&nbsp;provide extra functionality.</p><h2>Architecture Overview</h2><p>To go further I must explain basic architecture of Trilium - in its essence it is a classic web application - it has these two main components:</p><ul><li>frontend running in the browser (using HTML, CSS, JavaScript) - this is mainly used to interact with the user, display notes etc.</li><li>backend running JavaScript code in node.js runtime - this is responsible for e.g. storing notes, encrypting them etc.</li></ul><p>So we have frontend and backend, each with their own set of responsibilities, but their common feature is that they both run JavaScript code. Add to this the fact, that we're able to create JavaScript&nbsp;<a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a>&nbsp;and we're onto something.</p><h2>Use cases</h2><ul><li><a class=\"reference-link\" href=\"#root/_help_TjLYAo3JMO8X\">\"New Task\" launcher button</a></li></ul><h2>Action handler</h2><p>Saving the note to the database is backend's responsibility, so we immediately pass control to the backend and ask it to create a note. Once this is done, we show the newly created note so that the user can set the task title and maybe some attributes.</p><h2>Script execution</h2><p>So we have a script which will add the button to the toolbar. But how can we execute it? One possibility is to click on the <span class=\"tn-icon bx bx-play\"></span> <em>Execute script</em> button. The problem with this is that this UI change is time bound by Trilium runtime so when we restart Trilium, button won't be there.</p><p>We need to execute it every time Trilium starts up, but we probably don't want to have to manually click on play button on every start up.</p><p>The solution is to give the note the <a href=\"#root/_help_zEY4DaJG4YT5\">label</a> <code>#run=frontendStartup</code> - this is one of the \"system\" labels which Trilium understands. As you might guess, this will cause all such labeled script notes to be executed once Trilium frontend starts up.</p><p>(<code>#run=frontendStartup</code> does not work for <a href=\"#root/_help_RDslemsQ6gCp\">Mobile frontend</a> - if you want to have scripts running there, give the script <code>#run=mobileStartup</code> label).</p><h3>Execute button</h3><p>Runnable code notes (frontend or backend) and saved SQL consoles can optionally have a dedicated <span class=\"tn-icon bx bx-play\"></span> execute button alongside a description.</p><p>To do so, apply the following <a href=\"#root/_help_HI6GBBIduIgv\">labels</a>:</p><ul><li>A <code>#executeButton</code> with the value of the label being displayed as the label of the button.</li><li>An optional <code>#executeDescription</code> which adds explanatory text beside it.</li></ul><h2>Autocomplete &amp; linting</h2><p>Starting with Trilium v0.104.0, frontend scripts, backend scripts and render notes benefit from an autocomplete system.</p><p>The autocomplete opens automatically while typing a name or after a <kbd>.</kbd>, or manually by pressing <kbd>Ctrl</kbd>+<kbd>Space</kbd>. Its list looks and works like the <kbd>/</kbd> list of a text note: each entry has an icon for its kind (function, property, class…), <kbd>Enter</kbd> or <kbd>Tab</kbd> inserts the highlighted one and <kbd>Esc</kbd> closes it.</p><p>In addition to that, the editor will also display syntax errors and warnings such as unreachable code.</p><aside class=\"admonition note\"><p>If you notice a false positive in regards with the errors/warnings reported or an incorrect or missing API, feel free to <a href=\"#root/_help_wy8So3yZZlH9\">open a issue</a> with a code sample.</p></aside><h2>More showcases</h2><p>You can see more scripting with explanation in&nbsp;<a class=\"reference-link\" href=\"#root/_help_5668rwcirq1t\">Advanced Showcases</a>.</p><h2>Events</h2><p>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_GPERMystNGTB\">Events</a>.</p><h2>Script API</h2><p>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_GLks18SNjxmC\">Script API</a>.</p>",
"_help_yIhgI5H7A2Sm": "<p>Front-end scripts are custom JavaScript notes that are run on the client (browser environment)</p><p>There are four flavors of front-end scripts:</p><figure class=\"table\"><table><tbody><tr><td>Regular scripts</td><td>These are run with the current app and note context. These can be run either manually or automatically on start-up.</td></tr><tr><td><a class=\"reference-link\" href=\"#root/_help_MgibgPcfeuGz\">Custom Widgets</a></td><td>These can introduce new UI elements in various positions, such as near the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>, content area or even the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>.</td></tr><tr><td><a class=\"reference-link\" href=\"#root/_help_4Gn3psZKsfSm\">Launch Bar Widgets</a></td><td>Similar to&nbsp;<a class=\"reference-link\" href=\"#root/_help_MgibgPcfeuGz\">Custom Widgets</a>, but dedicated to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>. These can simply introduce new buttons or graphical elements to the bar.</td></tr><tr><td><a class=\"reference-link\" href=\"#root/_help_HcABDtFCkbFN\">Render Note</a></td><td>This allows rendering custom content inside a note, using either HTML or Preact JSX.</td></tr></tbody></table></figure><p>For more advanced behaviors that do not require a user interface (e.g. batch modifying notes), see&nbsp;<a class=\"reference-link\" href=\"#root/_help_SPirpZypehBG\">Backend scripts</a>.</p><h2>Scripts</h2><p>Scripts don't have any special requirements. They can be run manually using the <em>Execute</em> button on the code note or they can be run automatically, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_irkwjdNtjcxR\">Frontend Events</a>.</p><h2>Widgets</h2><p>Widgets require a certain format in order for Trilium to be able to integrate them into the UI.</p><ul><li>For legacy widgets, the script note must export a <code>BasicWidget</code> or a derived one (see&nbsp;<a class=\"reference-link\" href=\"#root/_help_GhurYZjh8e1V\">Note context aware widget</a>&nbsp;or&nbsp;<a class=\"reference-link\" href=\"#root/_help_M8IppdwVHSjG\">Right pane widget</a>).</li><li>For Preact widgets, a built-in helper called <code>defineWidget</code> needs to be used.</li></ul><p>For more information, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_MgibgPcfeuGz\">Custom Widgets</a>.</p><h2>Script API</h2><p>The front-end API of Trilium is available to all scripts running in the front-end context as global variable <code>api</code>. For a reference of the API, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_Q2z6av6JZVWm\">Frontend API</a>.</p><h3>Tutorial</h3><p>For more information on building widgets, take a look at <a href=\"#root/_help_SynTBQiBsdYJ\">Widget Basics</a>.</p>",
diff --git a/docs/User Guide/User Guide/AI/MCP.md b/docs/User Guide/User Guide/AI/MCP.md
index 405b6d1fd8..1770c6cfe2 100644
--- a/docs/User Guide/User Guide/AI/MCP.md
+++ b/docs/User Guide/User Guide/AI/MCP.md
@@ -9,7 +9,7 @@ Once the MCP is active, simply add the MCP server to your AI assistant. The URL
Only the HTTP transport is supported, the `stdio` method is not supported. If that is a blocker, consider using a third-party alternative listed below.
-The tools exposed to the MCP are the same tools that are supported by the internal chat (see the _Note access_ section).
+The tools exposed to the MCP are the same tools that are supported by the internal chat (see the _Note access_ section). Notes with the `#excludeFromLlm` label are hidden from both, see <a class="reference-link" href="Privacy.md">Privacy</a>.
### Approving tool calls
diff --git a/docs/User Guide/User Guide/AI/Privacy.md b/docs/User Guide/User Guide/AI/Privacy.md
index 11112092ed..76dab4784a 100644
--- a/docs/User Guide/User Guide/AI/Privacy.md
+++ b/docs/User Guide/User Guide/AI/Privacy.md
@@ -28,7 +28,7 @@ This is the reason the provider list is grouped this way, and why Trilium pre-se
* Notes above a size threshold send a size hint instead of the text, and the model must call a tool to read further.
* **Any note the model asks for, when note access is enabled.**
* Tools let the model search your tree and read notes, attributes and attachments beyond the current one.
- * It decides what to fetch, and each call waits for you to allow it, unless the chat's permission mode lets reads or every call run on their own, or you allowed that tool for the chat. There is no per-note permission system, so the reachable scope is your whole tree.
+ * It decides what to fetch, and each call waits for you to allow it, unless the chat's permission mode lets reads or every call run on their own, or you allowed that tool for the chat. The reachable scope is your whole tree, except for notes you exclude (see _Excluding notes_ below).
* **Attachments and mentions**, when you add them: images, PDFs and text files are sent to the provider, and an `@` mention makes that note fetchable.
* **Your search query**, when web search is enabled, the model's search terms reach the provider's own search infrastructure, or the search provider chosen in the _Tools_ menu (Brave Search, Tavily, Exa, Serper, Perplexity or your SearXNG instance).
* **The pages the model reads**, when web search goes through a search provider or a DeepSeek model's built-in search: Trilium fetches each page the model asks for from the site itself, so the site sees a request from the machine running Trilium. The page's text is then sent to the model's provider.
@@ -51,11 +51,29 @@ While your [protected session](../Basic%20Concepts%20and%20Features/Notes/Protec
The same applies to the <a class="reference-link" href="../Note%20Types/Text/In-editor%20AI%20assistant.md">In-editor AI assistant</a>: it works on whatever is open in the editor, so running it inside an unlocked protected note sends that note's text like any other.
+## Excluding notes
+
+Add the `#excludeFromLlm` [label](../Advanced%20Usage/Attributes/Labels.md) to a note to hide it from the AI chat and the [MCP server](MCP.md). The label covers only that note: the notes below it stay visible unless you make the label [inheritable](../Advanced%20Usage/Attributes/Attribute%20Inheritance.md), and a child can opt back in with `#excludeFromLlm=false`.
+
+For an excluded note:
+
+* The note tools report it as not found: it is left out of search results, child lists and subtrees, and relations that point to it are not shown.
+* The model cannot read, edit, move, clone or rename it, create notes under it, or remove the label. It also cannot delete a note that has an excluded note below it.
+* Its metadata is not sent as the current note, even when note context is enabled.
+* A visible child does not show it as a parent, and the model cannot move the child out of it.
+
+Unlike a protected note, an excluded note stays hidden while your protected session is unlocked. The exclusion applies to the note tools only. It is not encryption, and it does not cover:
+
+* Files you attach to a message yourself.
+* The <a class="reference-link" href="../Note%20Types/Text/In-editor%20AI%20assistant.md">In-editor AI assistant</a> when you run it inside the note.
+* Text from the note that appears in other notes, such as a link with the note's title.
+
## What you control
* **Which provider**: the single decision that determines whether anything leaves your machine at all.
* **Note access**: turn it off in the <span class="tn-icon bx bx-shield-quarter"></span>_Tools_ menu at the bottom of the chat, and the model can read nothing beyond what you type.
* **The current note:** the file icon in the sidebar chat.
+* **Notes the AI cannot reach:** the `#excludeFromLlm` label, see _Excluding notes_ above.
* **Web search:** also in the _Tools_ menu.
* **Which tool calls ask first:** the _Permissions_ submenu of the _Tools_ menu. _Always ask_ has every call wait for you, reads included. A new chat starts in the mode you picked last, so a chat after one set to _Don't ask_ asks about nothing either. Until you pick a mode, chats start in _Ask before changes_, where the AI reads and searches your notes without asking.
* **The editor assistant**: it has no per-run toggles. What you control is whether you run it, what you select before you do and which model answers.
diff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md
index 135be11290..b68676f33a 100644
--- a/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md
+++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md
@@ -79,6 +79,7 @@ This is a list of labels that Trilium natively supports.
| `executeButton` | Title of the button which will execute the current code note |
| `executeDescription` | Longer description of the current code note displayed together with the execute button |
| `excludeFromNoteMap` | Notes with this label will be hidden from the <a class="reference-link" href="../../Note%20Types/Note%20Map.md">Note Map</a>. |
+| `excludeFromLlm` | Hides this note from the AI chat and the MCP server. Make it inheritable to hide the notes below it as well. See <a class="reference-link" href="../../AI/Privacy.md">Privacy</a>. |
| `newNotesOnTop` | New notes will be created at the top of the parent note, not on the bottom. |
| `hideChildrenOverview` | Hides the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a> for that particular note. |
| `subtreeHidden` | Hides all child notes of this note from the tree, displaying a badge with the count of hidden children. Children remain accessible via search or direct links. |
diff --git a/packages/commons/src/lib/builtin_attributes.ts b/packages/commons/src/lib/builtin_attributes.ts
index 71a40aafb4..fb01e7cee4 100644
--- a/packages/commons/src/lib/builtin_attributes.ts
+++ b/packages/commons/src/lib/builtin_attributes.ts
@@ -149,6 +149,7 @@ const BUILTIN_ATTRIBUTES = [
{ type: "label", name: "mapIncludeRelation", valueType: "text" },
// Keeps a note out of the note map -- unless the map is rooted at it, which journals rely on.
{ type: "label", name: "excludeFromNoteMap", valueType: "boolean" },
+ { type: "label", name: "excludeFromLlm", valueType: "boolean" },
{ type: "label", name: "bookmarkFolder", valueType: "boolean" },
{ type: "label", name: "sorted", valueType: "boolean" },
{ type: "label", name: "sortDirection", valueType: "select", selectOptions: [ "asc", "desc" ] },
diff --git a/packages/trilium-core/src/services/llm/note_hint.ts b/packages/trilium-core/src/services/llm/note_hint.ts
index a7cbad7096..e9ec715e4a 100644
--- a/packages/trilium-core/src/services/llm/note_hint.ts
+++ b/packages/trilium-core/src/services/llm/note_hint.ts
@@ -6,17 +6,16 @@
* to the prompt text).
*/
-import becca from "../../becca/becca.js";
import { dump } from "js-yaml";
-import { getNoteMeta, SYSTEM_PROMPT_LIMITS } from "./tools/helpers.js";
+import { getLlmNote, getNoteMeta, SYSTEM_PROMPT_LIMITS } from "./tools/helpers.js";
/**
* Build a context hint about the current note with full metadata (same shape as
- * get_note / ETAPI). Returns `null` when the note no longer exists.
+ * get_note / ETAPI). Returns `null` when the note no longer exists or is excluded from the LLM.
*/
export function buildNoteHint(noteId: string, hasAttachments: boolean): string | null {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return null;
}
diff --git a/packages/trilium-core/src/services/llm/tools/attachment_tools.spec.ts b/packages/trilium-core/src/services/llm/tools/attachment_tools.spec.ts
index 4f546d0416..b73f7dd72d 100644
--- a/packages/trilium-core/src/services/llm/tools/attachment_tools.spec.ts
+++ b/packages/trilium-core/src/services/llm/tools/attachment_tools.spec.ts
@@ -1,15 +1,16 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
-const { getAttachmentMock, getBlobMock } = vi.hoisted(() => ({
+const { getAttachmentMock, getBlobMock, getNoteMock } = vi.hoisted(() => ({
getAttachmentMock: vi.fn(),
- getBlobMock: vi.fn()
+ getBlobMock: vi.fn(),
+ getNoteMock: vi.fn()
}));
// Attachment + blob lookups go through SQL in the real becca; partial-mock core
-// so these two return deterministic stubs while the rest of core is untouched.
+// so these lookups and the owner-note lookup return deterministic stubs while the rest of core is untouched.
vi.mock("../../../becca/becca.js", async (importOriginal) => {
const actual = await importOriginal<typeof import("../../../becca/becca.js")>();
- return { default: { ...actual.default, getAttachment: getAttachmentMock, getBlob: getBlobMock } };
+ return { default: { ...actual.default, getAttachment: getAttachmentMock, getBlob: getBlobMock, getNote: getNoteMock } };
});
import blobService from "../../blob.js";
@@ -46,6 +47,7 @@ function stubAttachment(overrides: Record<string, unknown>) {
describe("attachment_tools", () => {
beforeEach(() => {
vi.clearAllMocks();
+ getNoteMock.mockReturnValue({ isLabelTruthy: () => false });
});
describe("get_attachment", () => {
diff --git a/packages/trilium-core/src/services/llm/tools/attachment_tools.ts b/packages/trilium-core/src/services/llm/tools/attachment_tools.ts
index 8414d08860..34718e1204 100644
--- a/packages/trilium-core/src/services/llm/tools/attachment_tools.ts
+++ b/packages/trilium-core/src/services/llm/tools/attachment_tools.ts
@@ -7,6 +7,7 @@ import { z } from "zod";
import becca from "../../../becca/becca.js";
import blobService from "../../../services/blob.js";
+import { getLlmAttachment } from "./helpers.js";
import { defineTools } from "./tool_registry.js";
export const attachmentTools = defineTools({
@@ -16,7 +17,7 @@ export const attachmentTools = defineTools({
attachmentId: z.string().describe("The ID of the attachment to retrieve")
}),
execute: ({ attachmentId }) => {
- const attachment = becca.getAttachment(attachmentId);
+ const attachment = getLlmAttachment(attachmentId);
if (!attachment) {
return { error: "Attachment not found" };
}
@@ -39,7 +40,7 @@ export const attachmentTools = defineTools({
attachmentId: z.string().describe("The ID of the attachment to read")
}),
execute: ({ attachmentId }) => {
- const attachment = becca.getAttachment(attachmentId);
+ const attachment = getLlmAttachment(attachmentId);
if (!attachment) {
return { error: "Attachment not found" };
}
diff --git a/packages/trilium-core/src/services/llm/tools/attribute_tools.ts b/packages/trilium-core/src/services/llm/tools/attribute_tools.ts
index 2ce8516285..00fbd893ff 100644
--- a/packages/trilium-core/src/services/llm/tools/attribute_tools.ts
+++ b/packages/trilium-core/src/services/llm/tools/attribute_tools.ts
@@ -6,7 +6,7 @@ import attributeService from "../../../services/attributes.js";
import becca from "../../../becca/becca.js";
import { z } from "zod";
-import { flag } from "./helpers.js";
+import { flag, getLlmNote, isAttributeVisibleToLlm } from "./helpers.js";
import { defineTools } from "./tool_registry.js";
export const attributeTools = defineTools({
@@ -16,13 +16,13 @@ export const attributeTools = defineTools({
noteId: z.string().describe("The ID of the note")
}),
execute: ({ noteId }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
return note.getOwnedAttributes()
- .filter((attr) => !attr.isAutoLink())
+ .filter((attr) => !attr.isAutoLink() && isAttributeVisibleToLlm(attr))
.map((attr) => ({
attributeId: attr.attributeId,
type: attr.type,
@@ -40,7 +40,7 @@ export const attributeTools = defineTools({
}),
execute: ({ attributeId }) => {
const attribute = becca.getAttribute(attributeId);
- if (!attribute) {
+ if (!attribute || !isAttributeVisibleToLlm(attribute)) {
return { error: "Attribute not found" };
}
@@ -65,14 +65,14 @@ export const attributeTools = defineTools({
}),
mutates: true,
execute: ({ noteId, type, name, value = "" }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
if (note.isProtected) {
return { error: "Note is protected and cannot be modified" };
}
- if (type === "relation" && value && !becca.getNote(value)) {
+ if (type === "relation" && value && !getLlmNote(value)) {
return { error: "Target note not found for relation" };
}
@@ -123,14 +123,14 @@ export const attributeTools = defineTools({
mutates: true,
execute: ({ noteId, attributeId }) => {
const attribute = becca.getAttribute(attributeId);
- if (!attribute) {
+ if (!attribute || !isAttributeVisibleToLlm(attribute)) {
return { error: "Attribute not found" };
}
if (attribute.noteId !== noteId) {
return { error: "Attribute does not belong to the specified note" };
}
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (note?.isProtected) {
return { error: "Note is protected and cannot be modified" };
}
diff --git a/packages/trilium-core/src/services/llm/tools/exclude_from_llm.spec.ts b/packages/trilium-core/src/services/llm/tools/exclude_from_llm.spec.ts
new file mode 100644
index 0000000000..884367336a
--- /dev/null
+++ b/packages/trilium-core/src/services/llm/tools/exclude_from_llm.spec.ts
@@ -0,0 +1,133 @@
+import becca from "../../../becca/becca.js";
+import BAttribute from "../../../becca/entities/battribute.js";
+import { buildNote } from "../../../test/becca_easy_mocking.js";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+import { buildNoteHint } from "../note_hint.js";
+import { attachmentTools } from "./attachment_tools.js";
+import { attributeTools } from "./attribute_tools.js";
+import { isExcludedFromLlm } from "./helpers.js";
+import { hierarchyTools } from "./hierarchy_tools.js";
+import { noteTools } from "./note_tools.js";
+import type { ToolDefinition } from "./tool_registry.js";
+
+const findResultsMock = vi.hoisted(() => vi.fn());
+
+vi.mock("../../../services/search/services/search.js", async (importOriginal) => {
+ const actual = await importOriginal<typeof import("../../../services/search/services/search.js")>();
+ return { default: { ...actual.default, findResultsWithQuery: findResultsMock } };
+});
+
+const NOT_FOUND = { error: "Note not found" };
+
+function run(name: string, args: object) {
+ for (const registry of [noteTools, hierarchyTools, attributeTools, attachmentTools]) {
+ for (const [toolName, def] of registry) {
+ if (toolName === name) return (def as ToolDefinition).execute(args) as any;
+ }
+ }
+ throw new Error(`Tool ${name} not registered`);
+}
+
+describe("excludeFromLlm", () => {
+ beforeEach(() => {
+ becca.reset();
+ buildNote({
+ id: "root",
+ children: [
+ {
+ id: "visible", title: "Visible", content: "body", "#topic": "x", "~link": "secret",
+ children: [{
+ id: "secret", title: "Secret", content: "body", "#excludeFromLlm": "",
+ attachments: [{ id: "satt", title: "a.txt", role: "file", mime: "text/plain" }],
+ children: [{ id: "deep", title: "Deep", content: "body" }]
+ }]
+ },
+ { id: "optedIn", title: "Opted in", content: "body", "#excludeFromLlm": "false" },
+ {
+ id: "locked", title: "Locked",
+ children: [
+ { id: "lockedChild", title: "Locked child", content: "body" },
+ { id: "overridden", title: "Overridden", content: "body", "#excludeFromLlm": "false" }
+ ]
+ }
+ ]
+ });
+ new BAttribute({ attributeId: "lockedLabel", noteId: "locked", type: "label", name: "excludeFromLlm", value: "", isInheritable: true });
+ });
+
+ it("excludes only the labelled note, unless the label is inheritable or false", () => {
+ expect(isExcludedFromLlm(becca.getNoteOrThrow("secret"))).toBe(true);
+ expect(isExcludedFromLlm(becca.getNoteOrThrow("deep"))).toBe(false);
+ expect(isExcludedFromLlm(becca.getNoteOrThrow("visible"))).toBe(false);
+ expect(isExcludedFromLlm(becca.getNoteOrThrow("optedIn"))).toBe(false);
+ expect(isExcludedFromLlm(becca.getNoteOrThrow("lockedChild"))).toBe(true);
+ expect(isExcludedFromLlm(becca.getNoteOrThrow("overridden"))).toBe(false);
+ });
+
+ it("reports excluded notes, attributes and attachments as missing", () => {
+ for (const noteId of ["secret", "lockedChild"]) {
+ expect(run("get_note", { noteId })).toEqual(NOT_FOUND);
+ expect(run("get_note_content", { noteId })).toEqual(NOT_FOUND);
+ expect(run("set_note_content", { noteId, content: "x" })).toEqual(NOT_FOUND);
+ expect(run("append_to_note", { noteId, content: "x" })).toEqual(NOT_FOUND);
+ expect(run("edit_note_content", { noteId, edits: [{ oldText: "body", newText: "x" }] })).toEqual(NOT_FOUND);
+ expect(run("rename_note", { noteId, newTitle: "x" })).toEqual(NOT_FOUND);
+ expect(run("delete_note", { noteId })).toEqual(NOT_FOUND);
+ expect(run("get_child_notes", { noteId })).toEqual(NOT_FOUND);
+ expect(run("get_subtree", { noteId })).toEqual(NOT_FOUND);
+ expect(run("move_note", { noteId, newParentNoteId: "root" })).toEqual(NOT_FOUND);
+ expect(run("clone_note", { noteId, parentNoteId: "root" })).toEqual(NOT_FOUND);
+ expect(run("get_attributes", { noteId })).toEqual(NOT_FOUND);
+ expect(run("set_attribute", { noteId, type: "label", name: "excludeFromLlm", value: "false" })).toEqual(NOT_FOUND);
+ expect(buildNoteHint(noteId, false)).toBeNull();
+ }
+
+ expect(run("create_note", { parentNoteId: "secret", title: "x", content: "x", type: "text" }))
+ .toEqual({ error: "Parent note not found" });
+ expect(run("move_note", { noteId: "optedIn", newParentNoteId: "secret" }))
+ .toEqual({ error: "Target parent note not found" });
+ expect(run("clone_note", { noteId: "optedIn", parentNoteId: "secret" }))
+ .toEqual({ error: "Parent note not found" });
+ expect(run("set_attribute", { noteId: "optedIn", type: "relation", name: "r", value: "secret" }))
+ .toEqual({ error: "Target note not found for relation" });
+
+ const labelId = becca.getNoteOrThrow("secret").getOwnedLabel("excludeFromLlm")?.attributeId;
+ expect(labelId).toBeTruthy();
+ expect(run("get_attribute", { attributeId: labelId })).toEqual({ error: "Attribute not found" });
+ expect(run("delete_attribute", { noteId: "secret", attributeId: labelId })).toEqual({ error: "Attribute not found" });
+ expect(run("get_attachment", { attachmentId: "satt" })).toEqual({ error: "Attachment not found" });
+ expect(run("get_attachment_content", { attachmentId: "satt" })).toEqual({ error: "Attachment not found" });
+ });
+
+ it("leaves excluded notes out of listings, relations and search results", () => {
+ expect(run("get_child_notes", { noteId: "visible" })).toEqual([]);
+ expect(run("get_subtree", { noteId: "visible" })).not.toHaveProperty("children");
+
+ const meta = run("get_note", { noteId: "visible" });
+ expect(meta.childNotes.totalCount).toBe(0);
+ expect(meta.attributes.results.map((a: { name: string }) => a.name)).toEqual(["topic"]);
+ expect(run("get_attributes", { noteId: "visible" }).map((a: { name: string }) => a.name)).toEqual(["topic"]);
+ const linkId = becca.getNoteOrThrow("visible").getOwnedRelation("link")?.attributeId;
+ expect(linkId).toBeTruthy();
+ expect(run("get_attribute", { attributeId: linkId })).toEqual({ error: "Attribute not found" });
+
+ findResultsMock.mockReturnValue([{ noteId: "secret" }, { noteId: "visible" }, { noteId: "deep" }]);
+ const search = run("search_notes", { query: "x" });
+ expect(search.totalResults).toBe(2);
+ expect(search.results.map((r: { noteId: string }) => r.noteId)).toEqual(["visible", "deep"]);
+ });
+
+ it("does not reveal or change the excluded parent of a visible note", () => {
+ findResultsMock.mockReturnValue([{ noteId: "deep" }]);
+ expect(run("search_notes", { query: "x" }).results[0]).toMatchObject({ noteId: "deep", parentTitle: null });
+ expect(run("get_note", { noteId: "deep" }).parentNoteIds).toEqual([]);
+ expect(run("move_note", { noteId: "deep", newParentNoteId: "root" }))
+ .toEqual({ error: "Note has no parent it can be moved from" });
+ });
+
+ it("refuses to delete a note whose subtree holds excluded notes", () => {
+ expect(run("delete_note", { noteId: "visible" }))
+ .toEqual({ error: "Note contains notes excluded from the assistant and cannot be deleted" });
+ });
+});
diff --git a/packages/trilium-core/src/services/llm/tools/helpers.spec.ts b/packages/trilium-core/src/services/llm/tools/helpers.spec.ts
index 558b2830b7..c1523f78ee 100644
--- a/packages/trilium-core/src/services/llm/tools/helpers.spec.ts
+++ b/packages/trilium-core/src/services/llm/tools/helpers.spec.ts
@@ -3,13 +3,14 @@ import type BNote from "../../../becca/entities/bnote.js";
import { beforeEach, describe, expect, it, vi } from "vitest";
const getBlobMock = vi.hoisted(() => vi.fn());
+const getNoteMock = vi.hoisted(() => vi.fn());
// getContentPreview / getNoteContentForLlm consult becca.getBlob (SQL-backed);
// partial-mock core so it returns deterministic blobs while markdown
// import/export services keep their real implementations.
vi.mock("../../../becca/becca.js", async (importOriginal) => {
const actual = await importOriginal<typeof import("../../../becca/becca.js")>();
- return { default: { ...actual.default, getBlob: getBlobMock } };
+ return { default: { ...actual.default, getBlob: getBlobMock, getNote: getNoteMock } };
});
import blobService from "../../blob.js";
@@ -253,7 +254,10 @@ describe("getNoteMeta", () => {
it("builds metadata with truncated children/attributes/attachments and total counts", () => {
getBlobMock.mockReturnValue({ contentLength: 5 });
+ const visible = { isLabelTruthy: () => false };
+ getNoteMock.mockReturnValue(visible);
const children = Array.from({ length: 3 }, (_, i) => ({
+ ...visible,
noteId: `c${i}`,
getTitleOrProtected: () => `Child ${i}`
}));
@@ -269,7 +273,7 @@ describe("getNoteMeta", () => {
isProtected: true,
getContent: () => "body",
getChildNotes: () => children,
- getParentNotes: () => [{ noteId: "root" }],
+ getParentNotes: () => [{ ...visible, noteId: "root" }],
getAttributes: () => attrs,
getAttachments: () => attachments
});
diff --git a/packages/trilium-core/src/services/llm/tools/helpers.ts b/packages/trilium-core/src/services/llm/tools/helpers.ts
index 9919bf0b1f..fe0b8bd62a 100644
--- a/packages/trilium-core/src/services/llm/tools/helpers.ts
+++ b/packages/trilium-core/src/services/llm/tools/helpers.ts
@@ -3,6 +3,7 @@
*/
import type BAttachment from "../../../becca/entities/battachment.js";
+import type BAttribute from "../../../becca/entities/battribute.js";
import becca from "../../../becca/becca.js";
import type BNote from "../../../becca/entities/bnote.js";
import blobService from "../../../services/blob.js";
@@ -31,6 +32,50 @@ const SVG_SOURCE_RE = /^\s*(?:<\?xml[\s\S]*?\?>\s*)?(?:(?:<!--(?:(?!-->)[\s\S])*
/** Note IDs that must not be deleted, moved, or cloned by the LLM. */
export const PROTECTED_SYSTEM_NOTES = new Set(["root", "_hidden", "_share", "_lbRoot", "_globalNoteMap"]);
+/** Label that keeps a note out of reach of the LLM tools; made inheritable, it covers the subtree too. */
+export const EXCLUDE_FROM_LLM_LABEL = "excludeFromLlm";
+
+/** Whether the LLM must not see a note: it owns or inherits a truthy {@link EXCLUDE_FROM_LLM_LABEL}. */
+export function isExcludedFromLlm(note: BNote) {
+ return note.isLabelTruthy(EXCLUDE_FROM_LLM_LABEL);
+}
+
+/** Look a note up for the LLM; an excluded note is reported as missing so its existence does not leak. */
+export function getLlmNote(noteId: string): BNote | null {
+ const note = becca.getNote(noteId);
+ return note && !isExcludedFromLlm(note) ? note : null;
+}
+
+/** The note's children the LLM may see. */
+export function getLlmChildNotes(note: BNote) {
+ return note.getChildNotes().filter((child) => !isExcludedFromLlm(child));
+}
+
+/** The note's parents the LLM may see. */
+export function getLlmParentNotes(note: BNote) {
+ return note.getParentNotes().filter((parent) => !isExcludedFromLlm(parent));
+}
+
+/** Whether an attribute may be shown to the LLM: neither its owner nor, for a relation, its target is excluded. */
+export function isAttributeVisibleToLlm(attribute: BAttribute) {
+ const owner = becca.getNote(attribute.noteId);
+ if (!owner || isExcludedFromLlm(owner)) {
+ return false;
+ }
+ const target = attribute.type === "relation" ? becca.getNote(attribute.value) : null;
+ return !target || !isExcludedFromLlm(target);
+}
+
+/** Look an attachment up for the LLM; one whose owning note (directly or through a revision) is excluded is reported as missing. */
+export function getLlmAttachment(attachmentId: string): BAttachment | null {
+ const attachment = becca.getAttachment(attachmentId);
+ if (!attachment) {
+ return null;
+ }
+ const owner = becca.getNote(attachment.ownerId) ?? becca.getRevision(attachment.ownerId)?.getNote();
+ return owner && !isExcludedFromLlm(owner) ? attachment : null;
+}
+
/**
* Return `true` if the value is truthy, otherwise `undefined`.
* Since `undefined` values are omitted from JSON serialization,
@@ -243,12 +288,12 @@ function truncated<T>(items: T[], limit: number) {
* {@link TOOL_LIMITS} for the `get_note` tool.
*/
export function getNoteMeta(note: BNote, limits: NoteMetaLimits) {
- const allChildNotes = note.getChildNotes().map((ch) => ({
+ const allChildNotes = getLlmChildNotes(note).map((ch) => ({
noteId: ch.noteId,
title: ch.getTitleOrProtected()
}));
- const allAttributes = note.getAttributes().map((attr) => ({
+ const allAttributes = note.getAttributes().filter(isAttributeVisibleToLlm).map((attr) => ({
attributeId: attr.attributeId,
type: attr.type,
name: attr.name,
@@ -273,7 +318,7 @@ export function getNoteMeta(note: BNote, limits: NoteMetaLimits) {
mime: note.mime,
dateCreated: note.dateCreated,
dateModified: note.dateModified,
- parentNoteIds: note.getParentNotes().map((p) => p.noteId),
+ parentNoteIds: getLlmParentNotes(note).map((p) => p.noteId),
childNotes: truncated(allChildNotes, limits.childNotes),
attributes: truncated(allAttributes, limits.attributes),
contentPreview: getContentPreview(note),
diff --git a/packages/trilium-core/src/services/llm/tools/hierarchy_tools.ts b/packages/trilium-core/src/services/llm/tools/hierarchy_tools.ts
index af314b0bcd..0db5de9775 100644
--- a/packages/trilium-core/src/services/llm/tools/hierarchy_tools.ts
+++ b/packages/trilium-core/src/services/llm/tools/hierarchy_tools.ts
@@ -2,13 +2,12 @@
* LLM tools for navigating the note hierarchy (tree structure, branches).
*/
-import becca from "../../../becca/becca.js";
import type BNote from "../../../becca/entities/bnote.js";
import cloningService from "../../../services/cloning.js";
import { z } from "zod";
import branchService from "../../branches.js";
-import { PROTECTED_SYSTEM_NOTES } from "./helpers.js";
+import { getLlmChildNotes, getLlmNote, isExcludedFromLlm, PROTECTED_SYSTEM_NOTES } from "./helpers.js";
import { defineTools } from "./tool_registry.js";
//#region Subtree tool implementation
@@ -30,14 +29,14 @@ function buildSubtree(note: BNote, depth: number, maxDepth: number): SubtreeNode
};
if (depth >= maxDepth) {
- const childCount = note.getChildNotes().length;
+ const childCount = getLlmChildNotes(note).length;
if (childCount > 0) {
node.children = `${childCount} children not shown (depth limit reached)`;
}
return node;
}
- const children = note.getChildNotes();
+ const children = getLlmChildNotes(note);
if (children.length === 0) {
return node;
}
@@ -64,16 +63,16 @@ export const hierarchyTools = defineTools({
noteId: z.string().describe("The ID of the parent note (use 'root' for top-level)")
}),
execute: ({ noteId }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
- return note.getChildNotes().map((child) => ({
+ return getLlmChildNotes(note).map((child) => ({
noteId: child.noteId,
title: child.getTitleOrProtected(),
type: child.type,
- childCount: child.getChildNotes().length
+ childCount: getLlmChildNotes(child).length
}));
}
},
@@ -85,7 +84,7 @@ export const hierarchyTools = defineTools({
depth: z.number().min(1).max(MAX_DEPTH).optional().describe(`How many levels deep to traverse (1-${MAX_DEPTH}). Defaults to 2.`)
}),
execute: ({ noteId, depth = 2 }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
@@ -102,7 +101,7 @@ export const hierarchyTools = defineTools({
}),
mutates: true,
execute: ({ noteId, newParentNoteId }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
@@ -113,7 +112,7 @@ export const hierarchyTools = defineTools({
return { error: "Note is protected and cannot be moved" };
}
- const targetParent = becca.getNote(newParentNoteId);
+ const targetParent = getLlmNote(newParentNoteId);
if (!targetParent) {
return { error: "Target parent note not found" };
}
@@ -121,7 +120,6 @@ export const hierarchyTools = defineTools({
return { error: "Cannot move note to a protected parent" };
}
- // Use the first (primary) parent branch for the move
const branches = note.getParentBranches();
/* v8 ignore next 3 -- rare edge case, not worth simulating in a unit test:
an orphaned note (its last parent branch removed but the note itself not
@@ -130,9 +128,14 @@ export const hierarchyTools = defineTools({
if (branches.length === 0) {
return { error: "Note has no parent branches" };
}
+ // Move the first branch whose parent the LLM can see, so an excluded parent is neither changed nor revealed.
+ const branch = branches.find((b) => b.parentNote && !isExcludedFromLlm(b.parentNote));
+ if (!branch) {
+ return { error: "Note has no parent it can be moved from" };
+ }
- const oldParentNoteId = branches[0].parentNoteId;
- const result = branchService.moveBranchToNote(branches[0], newParentNoteId);
+ const oldParentNoteId = branch.parentNoteId;
+ const result = branchService.moveBranchToNote(branch, newParentNoteId);
if (Array.isArray(result)) {
// Validation error: [statusCode, { success: false, message }]
const validation = result[1] as { success: boolean; message?: string };
@@ -165,7 +168,7 @@ export const hierarchyTools = defineTools({
mutates: true,
additive: true,
execute: ({ noteId, parentNoteId, prefix }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
@@ -173,8 +176,11 @@ export const hierarchyTools = defineTools({
return { error: "Note is protected and cannot be cloned" };
}
- const parent = becca.getNote(parentNoteId);
- if (parent && !parent.isContentAvailable()) {
+ const parent = getLlmNote(parentNoteId);
+ if (!parent) {
+ return { error: "Parent note not found" };
+ }
+ if (!parent.isContentAvailable()) {
return { error: "Cannot clone note to a protected parent" };
}
@@ -189,9 +195,7 @@ export const hierarchyTools = defineTools({
noteId,
title: note.getTitleOrProtected(),
parentNoteId,
- // A successful clone always has a real (content-available) parent note.
- /* v8 ignore next -- defensive: parent is non-null on the success path */
- parentTitle: parent?.getTitleOrProtected() ?? parentNoteId,
+ parentTitle: parent.getTitleOrProtected(),
branchId: result.branchId
};
}
diff --git a/packages/trilium-core/src/services/llm/tools/note_tools.spec.ts b/packages/trilium-core/src/services/llm/tools/note_tools.spec.ts
index babf8139a1..cc518a8d14 100644
--- a/packages/trilium-core/src/services/llm/tools/note_tools.spec.ts
+++ b/packages/trilium-core/src/services/llm/tools/note_tools.spec.ts
@@ -402,14 +402,14 @@ describe("note_tools — write tools return post-write content", () => {
findResultsMock.mockReturnValue([
{ noteId: "sa" },
- { noteId: "stale" } // not in becca → filtered out within the limit
+ { noteId: "stale" } // not in becca → filtered out before counting
]);
const result = getTool("search_notes").execute({ query: "alpha", limit: 5 }) as {
totalResults: number;
results: any[];
};
- expect(result.totalResults).toBe(2);
+ expect(result.totalResults).toBe(1);
expect(result.results).toHaveLength(1); // stale id dropped
expect(result.results[0]).toMatchObject({ noteId: "sa", title: "Alpha", parentTitle: "Search parent" });
});
diff --git a/packages/trilium-core/src/services/llm/tools/note_tools.ts b/packages/trilium-core/src/services/llm/tools/note_tools.ts
index c6e90ce723..5aae7e5135 100644
--- a/packages/trilium-core/src/services/llm/tools/note_tools.ts
+++ b/packages/trilium-core/src/services/llm/tools/note_tools.ts
@@ -11,7 +11,7 @@ import SearchContext from "../../../services/search/search_context.js";
import TaskContext from "../../../services/task_context.js";
import { z } from "zod";
-import { applyTextEdits, getContentPreview, getNoteContentForLlm, getNoteMeta, getSvgImageError, LLM_NOTE_TYPES, PROTECTED_SYSTEM_NOTES, setNoteContentFromLlm, SVG_MIME, TOOL_LIMITS } from "./helpers.js";
+import { applyTextEdits, getContentPreview, getLlmNote, getLlmParentNotes, getNoteContentForLlm, getNoteMeta, getSvgImageError, isExcludedFromLlm, LLM_NOTE_TYPES, PROTECTED_SYSTEM_NOTES, setNoteContentFromLlm, SVG_MIME, TOOL_LIMITS } from "./helpers.js";
import { defineTools } from "./tool_registry.js";
export const noteTools = defineTools({
@@ -40,12 +40,12 @@ export const noteTools = defineTools({
includeArchivedNotes,
ancestorNoteId
});
- const results = searchService.findResultsWithQuery(query, searchContext);
+ const results = searchService.findResultsWithQuery(query, searchContext)
+ .filter((sr) => becca.notes[sr.noteId] && !isExcludedFromLlm(becca.notes[sr.noteId]));
const notes = results.slice(0, limit).map(sr => {
const note = becca.notes[sr.noteId];
- if (!note) return null;
- const parentNote = note.getParentNotes()[0];
+ const parentNote = getLlmParentNotes(note).at(0);
return {
noteId: note.noteId,
title: note.getTitleOrProtected(),
@@ -53,7 +53,7 @@ export const noteTools = defineTools({
parentTitle: parentNote?.getTitleOrProtected() ?? null,
contentPreview: getContentPreview(note)
};
- }).filter(Boolean);
+ });
return {
totalResults: results.length,
@@ -68,7 +68,7 @@ export const noteTools = defineTools({
noteId: z.string().describe("The ID of the note to retrieve")
}),
execute: ({ noteId }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
@@ -83,7 +83,7 @@ export const noteTools = defineTools({
noteId: z.string().describe("The ID of the note to read")
}),
execute: ({ noteId }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
@@ -114,7 +114,7 @@ export const noteTools = defineTools({
}),
mutates: true,
execute: ({ noteId, content, type, mime }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
@@ -168,7 +168,7 @@ export const noteTools = defineTools({
mutates: true,
additive: true,
execute: ({ noteId, content }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
@@ -231,7 +231,7 @@ export const noteTools = defineTools({
}),
mutates: true,
execute: ({ noteId, edits }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
@@ -313,7 +313,7 @@ export const noteTools = defineTools({
}
}
- const parentNote = becca.getNote(parentNoteId);
+ const parentNote = getLlmNote(parentNoteId);
if (!parentNote) {
return { error: "Parent note not found" };
}
@@ -355,7 +355,7 @@ export const noteTools = defineTools({
}),
mutates: true,
execute: ({ noteId, newTitle }) => {
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
@@ -392,13 +392,16 @@ export const noteTools = defineTools({
return { error: "Cannot delete system notes" };
}
- const note = becca.getNote(noteId);
+ const note = getLlmNote(noteId);
if (!note) {
return { error: "Note not found" };
}
if (note.isProtected) {
return { error: "Note is protected and cannot be deleted" };
}
+ if (note.getSubtree().notes.some(isExcludedFromLlm)) {
+ return { error: "Note contains notes excluded from the assistant and cannot be deleted" };
+ }
const title = note.getTitleOrProtected();
const taskContext = new TaskContext("no-progress-reporting", "deleteNotes", null);