You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: stricter semantic cache defaults for reliability
- Increase default similarity_threshold from 0.95 to 0.98
- Increase default min_text_length from 50 to 128 chars
- Make min_text_length configurable via CacheConfig
These changes ensure semantic caching only activates for longer,
substantive queries with near-identical content.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,16 @@ Fixed critical issues with the semantic cache that caused incorrect cache matche
12
12
13
13
1.**System Prompt Hash Matching**: The semantic cache now includes a hash of the system prompt when matching cached responses. Previously, different LLM operations with similar user messages but different system prompts could incorrectly return cached responses from unrelated operations.
14
14
15
-
2.**Short Text Exclusion**: Messages shorter than 50 characters are now excluded from semantic matching. Short questions like "what about X?" and "what is Y?" have misleadingly high semantic similarity scores which caused false cache hits. These short messages still benefit from exact hash matching.
15
+
2.**Short Text Exclusion**: Messages shorter than 128 characters are now excluded from semantic matching (configurable via `min_text_length`). Short questions have misleadingly high semantic similarity scores which caused false cache hits. These short messages still benefit from exact hash matching.
16
+
17
+
3.**Stricter Default Threshold**: Default similarity threshold increased from 0.95 to 0.98 for more reliable matching.
16
18
17
19
### Changes
18
20
19
21
- Added `_extract_system_hash()` method to compute SHA256 hash of system prompt content
20
22
- Modified `_semantic_search()` to require both semantic similarity AND system hash match
21
-
- Added minimum text length check (50 chars) before semantic cache operations
0 commit comments