Customer support
Password resets, invoice copies and shipping times are asked again and again. Each variant after the first is served from cache.
Cache LLM answers by meaning, not exact text, so paraphrased questions hit the cache and skip the model call.
Set the embedding size and the similarity that counts as a hit.
An animated walkthrough with real HotKV commands and example replies. Click any step to jump to it.
A support assistant receives the same question phrased a hundred different ways. An exact-match cache misses nearly all of them, so every paraphrase pays for a full model call and waits for the full response.
A semantic cache stores each answer next to the embedding of its question and looks new questions up by similarity. If a new prompt is close enough to one you have answered, the stored answer comes back and the model is never called. The threshold decides how close is close enough.
Set the embedding size and the similarity that counts as a hit.
SCACHE.CREATE support_bot 1536 THRESHOLD 0.92The first time a question is asked there is nothing similar in the cache, so the model answers it.
SCACHE.GET support_bot 0.013 -0.21 0.88 ...Store the question, the answer and the question's embedding, for one day.
SCACHE.SET support_bot "How do I reset my password?" "Open Settings > Security." 0.013 -0.21 0.88 ... TTL 86400"forgot my login pass" lands close to the stored question. The answer and its similarity come back, and the model is skipped.
SCACHE.GET support_bot 0.011 -0.19 0.87 ...A lookup can ask for a closer match than the namespace default, for answers where a near miss is not good enough.
SCACHE.GET support_bot 0.2 0.4 0.1 ... THRESHOLD 0.99Statistics per namespace show how often the cache answered instead of the model.
SCACHE.STATS support_botPassword resets, invoice copies and shipping times are asked again and again. Each variant after the first is served from cache.
Employees ask about holidays, expenses and VPN access in their own words. One answer serves all of them until it expires.
"How do I paginate?" and "how to page through results" get the same documented answer without a second model call.
Similar questions share one cached answer, however they are worded.
SCACHE.GETSCACHE.SETSet the threshold per namespace and override it on a single lookup.
SCACHE.THRESHOLDPer-namespace statistics show hits, misses and entries.
SCACHE.STATSPick the metric that matches your embedding model when you create the namespace.
SCACHE.CREATEOne embedding call and a cache lookup. The model call and its generation time are skipped.
Raise the threshold. A higher threshold needs a closer match, so fewer questions hit and each hit is more certain.
The semantic cache is part of the Performance and Scale plans.
HotKV speaks the Redis protocol, so you can point an existing client at it and run these same commands.