Add semantic-cache module: CallAdvisor over a Redis Stack vector index with a real in-process embedding model; threshold sweep (hit rate against wrong answers), 600-request replay with an illustrative cost model, tenant filter, expiry, look-alike and embedding-model-change traps; optional real local model

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01G8ikz8xdWuTP5yun8DZ1hk
This commit is contained in:
2026-10-11 09:46:19 +00:00
co-authored by Claude Sonnet 5.5
parent cdee85d3f4
commit d51ef56468
24 changed files with 1383 additions and 0 deletions
@@ -0,0 +1,14 @@
# SemanticCacheAdvisor in front of a ChatClient (threshold 0.80)
ask : How do I reset my account password?
-> model call, model calls so far 1, answer starts "[reset-password]"
ask : How do I reset my account password?
-> CACHE HIT, score 1.000, model calls so far 1, answer starts "[reset-password]"
ask : I forgot my password, how can I get back into my account?
-> CACHE HIT, score 0.919, model calls so far 1, answer starts "[reset-password]"
ask : How do I reset my router to factory settings?
-> model call, model calls so far 2, answer starts "[reset-router]"
ask : What is the capital of Australia?
-> model call, model calls so far 3, answer starts "[ood-0]"
advisor counters: 2 hits, 3 misses; model received 3 calls for 5 questions; entries in Redis: 3