From 34ef99dbfb0815fbca10d3faea2da7c50f29e19f Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 28 Oct 2026 22:20:50 +0200 Subject: [PATCH] feat: allow negative values for the Relevance Threshold setting (#33330) The Relevance Threshold field in the Documents settings refused negative values, so admins whose reranker returns raw scores (which can go below zero) could not set a useful threshold, and a negative RAG_RELEVANCE_THRESHOLD made the whole Documents settings page impossible to save while hybrid search was on. The server already stores and applies negative thresholds; only the field blocked them. The field now takes negative values in the same 0.01 steps as before, its help text says they are valid for rerankers that return raw scores outside the 0 to 1 range, and the hover hint asking for a value between 0 and 1 is gone. Nothing changes for 0 and above, and 0 still means no threshold. Closes #29888 --- src/lib/components/admin/Settings/Documents.svelte | 2 -- src/lib/i18n/locales/en-US/translation.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/components/admin/Settings/Documents.svelte b/src/lib/components/admin/Settings/Documents.svelte index cb7c55eb17..79d7567148 100644 --- a/src/lib/components/admin/Settings/Documents.svelte +++ b/src/lib/components/admin/Settings/Documents.svelte @@ -1431,8 +1431,6 @@ placeholder={$i18n.t('Enter Score')} bind:value={RAGConfig.RELEVANCE_THRESHOLD} autocomplete="off" - min="0.0" - title={$i18n.t('The score should be a value between 0.0 (0%) and 1.0 (100%).')} /> diff --git a/src/lib/i18n/locales/en-US/translation.json b/src/lib/i18n/locales/en-US/translation.json index e4c6c4d2d0..ffee6365cb 100644 --- a/src/lib/i18n/locales/en-US/translation.json +++ b/src/lib/i18n/locales/en-US/translation.json @@ -2878,7 +2878,7 @@ "settings.admin.documents.reindex.label": "Reindex", "settings.admin.documents.reindexKnowledgeAndMemoryVectors.description": "Rebuild vectors for existing knowledge files, knowledge search, and memories.", "settings.admin.documents.reindexKnowledgeAndMemoryVectors.label": "Reindex Knowledge and Memory Vectors", - "settings.admin.documents.relevanceThreshold.description": "Only return documents with a score greater than or equal to this value.", + "settings.admin.documents.relevanceThreshold.description": "Only return documents with a score greater than or equal to this value. Negative values are valid for rerankers that return raw scores outside the 0 to 1 range.", "settings.admin.documents.relevanceThreshold.label": "Relevance Threshold", "settings.admin.documents.rerankingBatchSize.description": "Number of results processed per reranking batch.", "settings.admin.documents.rerankingBatchSize.label": "Reranking Batch Size",