mirror of
https://github.com/mtayfur/openwebui-memory-system.git
synced 2026-01-22 06:51:01 +01:00
feat(memory_system): make skip category margin configurable via Filter settings
Allowing skip_category_margin to be set in Filter enables dynamic adjustment of skip detection sensitivity, improving flexibility for different deployment scenarios.
This commit is contained in:
@@ -642,8 +642,9 @@ class SkipDetector:
|
||||
non_personal_similarities = np.dot(message_embedding, self._reference_embeddings["non_personal"].T)
|
||||
max_non_personal_similarity = float(non_personal_similarities.max())
|
||||
|
||||
threshold = max_personal_similarity + Constants.SKIP_CATEGORY_MARGIN
|
||||
if (max_non_personal_similarity - max_personal_similarity) > Constants.SKIP_CATEGORY_MARGIN:
|
||||
margin = memory_system.valves.skip_category_margin
|
||||
threshold = max_personal_similarity + margin
|
||||
if (max_non_personal_similarity - max_personal_similarity) > margin:
|
||||
logger.info(f"🚫 Skipping: non-personal content (sim {max_non_personal_similarity:.3f} > {threshold:.3f})")
|
||||
return self.SkipReason.SKIP_NON_PERSONAL.value
|
||||
|
||||
@@ -1165,6 +1166,10 @@ class Filter:
|
||||
default=Constants.LLM_RERANKING_TRIGGER_MULTIPLIER,
|
||||
description="Controls when LLM reranking activates (lower = more aggressive)",
|
||||
)
|
||||
skip_category_margin: float = Field(
|
||||
default=Constants.SKIP_CATEGORY_MARGIN,
|
||||
description="Margin above personal similarity for skip category classification (higher = more conservative skip detection)",
|
||||
)
|
||||
status_emit_level: Literal["Basic", "Detailed"] = Field(
|
||||
default="Detailed",
|
||||
description="Status message verbosity level: Basic (summary counts only), Detailed (all details)",
|
||||
|
||||
Reference in New Issue
Block a user