Reset the retrieved passages before every RAG run

This commit is contained in:
Thorsten Sommer committed 2026-09-24 14:28:00 +02:00
1 parent 4baf21656a
commit a9825520f4
2 files changed
+15

No files matched your search

@@ -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:
//