From a9825520f4a64afab4ee911fca4d31972b686dba Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Thu, 24 Sep 2026 14:28:00 +0200 Subject: [PATCH] Reset the retrieved passages before every RAG run --- .../RAG/RAGProcesses/AISrcSelWithRetCtxVal.cs | 14 ++++++++++++++ .../wwwroot/changelog/v26.9.1.md | 1 + 2 files changed, 15 insertions(+) diff --git a/app/MindWork AI Studio/Tools/RAG/RAGProcesses/AISrcSelWithRetCtxVal.cs b/app/MindWork AI Studio/Tools/RAG/RAGProcesses/AISrcSelWithRetCtxVal.cs index b7958a8e..749a94c8 100644 --- a/app/MindWork AI Studio/Tools/RAG/RAGProcesses/AISrcSelWithRetCtxVal.cs +++ b/app/MindWork AI Studio/Tools/RAG/RAGProcesses/AISrcSelWithRetCtxVal.cs @@ -32,6 +32,20 @@ public sealed class AISrcSelWithRetCtxVal : IRagProcess var settings = Program.SERVICE_PROVIDER.GetService()!; var dataSourceService = Program.SERVICE_PROVIDER.GetService()!; + // + // What an earlier message retrieved must not travel along with this one. The augmented + // data and the AI-selected data sources describe the last retrieval, not a certain + // message, and only the steps below ever write them. Without starting from empty, every + // message which retrieves nothing -- because the data sources were switched off, none of + // them can be used right now, or the search found nothing -- would still send the + // passages of the last message which did, cf. ChatThread.RollBackTo. + // + // The data security and the required provider confidence stay as they are: both only + // ever tighten, because the data which raised them was seen by this thread. + // + chatThread.AugmentedData = string.Empty; + chatThread.AISelectedDataSources = []; + // // 1. Check if the user wants to bind any data sources to the chat: // diff --git a/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md b/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md index 360ffbb6..bed8c49f 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md @@ -86,6 +86,7 @@ - Fixed data sources you picked for your chats vanishing from the selection without a word when they cannot be used. AI Studio now lists them by name, so you can see why an answer was created without them. - Fixed the data sources you picked for a chat being forgotten the moment you changed your selection while one of them could not be used. Such a source stays selected and is used again as soon as it is available. - Fixed the silence when the step that picks the fitting passages out of your documents fails. You are told that the answer rests on everything that was found. +- Fixed passages from your data sources still reaching the AI after you switched the data sources of a chat off. Likewise, when a search in them found nothing, the AI kept receiving the passages an earlier message had brought up. - Fixed the regenerate button taking an answer away without producing a new one. This happened in chats started from a template that holds no question of your own. - Fixed the counter above an answer, which shows how many sources it rests on, doing nothing when you clicked it. It now takes you down to the sources. - Fixed the list of models staying empty at a server you host yourself, which made the model you had picked look as if it had vanished. Your key was there all along, it just was not read when the settings opened.