Definition
Semantic Caching
Semantic caching reuses a stored result when a new request is sufficiently similar and the result is still applicable. Similarity thresholds govern candidate matching. Scope checks, source versions and expiry determine which candidates can actually be reused. Benchmark savings alongside the cost of incorrect cache hits.
Identify when a similar question requires a cache miss
The requests “When can I return this order?” and “How long do I have to send this back?” can match semantically. Reuse an answer only when both requests belong to the same permitted scope and the return policy revision is unchanged. Include scope, locale and policy revision in the cache lookup. Invalidate old entries when a policy changes.
Redis documentation on thresholds, metadata and expiry
Intelligence at Scale by Shashank Agarwal
Explained in
Chapter 13: Production AI: Deployment, Monitoring, and Evaluation
The reality of running AI agents. It's nothing like the demo.
Related terms