Repository navigation
Conversation
…dding or merging entries
…s the user prompt
# Conflicts: # app/MindWork AI Studio/Assistants/I18N/allTexts.lua # app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua # app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua # app/MindWork AI Studio/wwwroot/changelog/v26.10.1.md
# Conflicts: # app/MindWork AI Studio/Assistants/I18N/allTexts.lua # app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor.cs # app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua # app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua # app/MindWork AI Studio/wwwroot/changelog/v26.10.1.md # documentation/Enterprise IT.md
The function of glossary_lookup goes along with every request of a chat, whether the model looks anything up or not. Listing every glossary with its ID, name, type, and description, plus every ID again as an enum, grows with each glossary: about 30 to 110 tokens apiece, which fills the context of a local model long before the chat starts and may run into the limits some providers set for enums. - Up to MAX_LISTED_GLOSSARIES (20), the function lists the glossaries and offers glossary_ids as before. - Beyond that, it names only the language pairs of the translation glossaries and offers the optional filters source_language and target_language instead of glossary_ids. The lookup then searches all glossaries; the filters never leave out a reference glossary, and regional variants count as the same language, as in the translation assistant. The number of glossaries stays out of the description, so adding one does not break the prompt cache of the providers. - The result now holds a section "glossaries" that describes every glossary with an entry on the page once: ID, name, type, and its description. With many glossaries, this is where the model learns which meaning of a term applies. - The system prompt of the tool tells the model to use these descriptions when a term has entries in several glossaries. - The glossary dialog and the example configuration plugin point out that the AI relies on the description to tell glossaries apart. - Changelog entry for the compact mode. Tests cover the switch at the limit, the language filters, and the new section of the result.
GlossaryMatcher used to copy the whole text into a normalized string for every search and then look for each term in it on its own: O(n * m) time for a text of n characters and m terms, plus O(n) memory per glossary and search. A long text in the translation assistant, up to about a million tokens, met with many terms, made that slow and allocation-heavy. The matcher now builds an Aho-Corasick automaton from the normalized terms and aliases, once per list of entries, still cached in the ConditionalWeakTable: - The trie lives in flat arrays; the edges of a node are sorted by character and found by binary search. Failure and output links come from a breadth-first pass from the root. - Entries sharing a normalized term share its end node, so duplicates, as in imported spreadsheets, are all found. - FindEntries reads the text once as a ReadOnlySpan<char> and normalizes it on the fly exactly as Normalize does: lowercase, whitespace runs as a single space, none at the start or the end. The text is never copied. - Collecting along the output links stops at the first term found before, and the search ends early once every term was found. A search now takes O(n + m) time and O(m) extra memory; the automaton takes O(L) memory for terms of total length L. The public API, the matching rules, and the order of the results stay the same. New tests check overlapping terms and terms ending other terms, entries with the same term, and compare the automaton with the plain search on 1,000 random texts over a small alphabet. A further test searches 5,000 terms in 4 million characters and reports the time without asserting it.
- New help text for the description in the glossary dialog, which now explains that the AI tells glossaries apart by it. - The en-US plugin catches up with the header of the glossary overview in the translation assistant, now split into one and several glossaries. - German: the columns "Variants" and "Note" of the glossary overview now read "Andere Formen" and "Anmerkung", as in the glossary dialog.
# Conflicts: # app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor # app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor.cs # app/MindWork AI Studio/Plugins/configuration/plugin.lua # app/MindWork AI Studio/Settings/DataModel/Data.cs # app/MindWork AI Studio/Tools/PluginSystem/PluginConfigurationObjectTypeExtensions.cs # app/MindWork AI Studio/wwwroot/changelog/v26.11.1.md
0xnkr
marked this pull request as ready for review
November 9, 2026 12:42
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR
Summary
<data>/glossaries/<id>.json(part of backups); the settings hold only the description of each glossary. Unreadable files are never overwritten silentlyglossary_lookuplets the model look up glossary terms in chats; a raised minimum provider confidence carries over to the chatGlossaries in configuration plugins
CONFIG["GLOSSARIES"], with their entries either from a spreadsheet or CSV/TSV file inside the plugin folder (columns named by their header) or listed inline in LuaDataApp.AllowUserToImportGlossarylets organizations lock thisplugin.luaand inEnterprise IT.mdRelated proposal or issue
internal issue
How did you test it?
dotnet testandcargo test.config-testswith a file-based translation glossary (semicolon CSV), an inline reference glossary, and two broken definitions: checked the read-only view, preselection in the translation assistant,glossary_lookupin chat, hot reload after changing the file, removal of the plugin, the warnings for the broken definitions, the delete summary of a local configuration plugin, that a local plugin cannot override an organization glossary, snippet export and import, and the import lockRequired statements
Credits (optional)
Wiki
For users
glossary_lookup) for chats. Your given fixed translations or explanations are added to the prompt for extra context. Reference glossaries are useful when the AI should understand the terms of your field or your project: words which mean something specific to you but which the AI cannot know.For IT departments
CONFIG["GLOSSARIES"]withId,Name,Type(TRANSLATION/REFERENCE),Description,SourceLanguage/TargetLanguage(+CustomSourceLanguage/CustomTargetLanguageforOTHER),PreselectInTranslation(defaulttrue), and the entries either asFile= {Path,TermColumn,ValueColumn, optionalOtherFormsColumn,NoteColumn}: a spreadsheet or CSV/TSV file inside the plugin folder (relative path, must stay inside it), columns named by their header, read whenever the plugin loads; orEntries= list of {Term,Value, optionalOtherForms,Note}.DataApp.AllowUserToImportGlossary(defaulttrue) to allow or lock importing glossary snippets.glossary_lookupcan be switched off or given a minimum provider confidence like any other tool (DataTools.DisabledToolIds,DataTools.MinimumProviderConfidenceByToolId, defaultNONE); a raised minimum carries over to the chat once entries reached it.Pages concerned
GLOSSARIES)AllowUserToImportGlossary)glossary_lookup)glossaries/folder)