Semantic Cache

A cache that reuses stored results for inputs with similar meaning rather than requiring exact matches.

Last updated

Software & DataAI & Automation

In plain English

Instead of checking whether a new request is word-for-word identical to an earlier one, a semantic cache checks whether it means roughly the same thing. AI applications can use this to return a saved response without asking a language model to generate another one, when the match is close enough. Similarity alone does not guarantee that a saved response is still current or appropriate for the user.

Example

A user asks, “How can I reset my password?” If the cache already has a response to “How do I reset my password?”, the application may reuse those instructions if they still apply to the user.

Sources

  1. Microsoft Learn: Enable Semantic Caching for LLM APIs in Azure API Management
  2. Amazon Web Services: Using Amazon ElastiCache for Valkey for semantic caching
  3. Amazon Web Services: Best practices for semantic caching