Reset the retrieved passages before every RAG run

This commit is contained in:
Thorsten Sommer 2026-09-24 14:28:00 +02:00
parent 4baf21656a
commit a9825520f4
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 15 additions and 0 deletions

View File

@ -32,6 +32,20 @@ public sealed class AISrcSelWithRetCtxVal : IRagProcess
var settings = Program.SERVICE_PROVIDER.GetService<SettingsManager>()!;
var dataSourceService = Program.SERVICE_PROVIDER.GetService<DataSourceService>()!;
//
// 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:
//

View File

@ -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.