FDE Times dataFDE jobs open 932▼14 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 62Companies hiring 202Remote-friendly 24%Median US pay $201kTop hirer Databricks 92
中文VI

The newspaper of the Forward Deployed Engineer

Books & courses

Semantic caching saves model calls but can serve wrong answers

A 1h24m DeepLearning.AI course taught by Redis engineers is strongest on measurement; its vendor's savings figure deserves a more skeptical hearing.

ShareLinkedInFacebookX

In brief

  • The DeepLearning.AI course is Intermediate level and runs 1h24m; both instructors work at Redis
  • Its three longest videos cover measuring cache effectiveness, improving it, and then building the cache into an agent
  • The savings of '50% or more' are Redis's own figure, so measure again on the client's logs
Two-panel slope chart using a hypothetical example of 10,000 queries. Raising the similarity threshold from 0.90 to 0.95 cuts the number of model calls avoided from 3,000 to 2,000. At the same time, the number of wrong answers falls from 120 to 20.
Raising the threshold forfeits 1,000 saved calls but removes 100 wrong answers. The figures are hypothetical; only a customer's own logs reveal the true trade-off. Source: hypothetical example in the article, based on the metrics taught in the Semantic Caching for AI Agents course (DeepLearning.AI, Redis).

Two customers type “How do I change my password?” and “I forgot my password, how do I reset it?”, and your agent calls the model twice to produce the same answer.

DeepLearning.AI’s short course Semantic Caching for AI Agents teaches you how to skip the second call. For an FDE, the more valuable lesson is knowing when skipping it gives a customer the wrong answer.

The request is familiar: a client asks whether the model bill can come down and whether the agent can respond faster. A cache is the obvious answer. Left unmeasured, it is also the quickest way to lose end users’ trust.

Who teaches it, and why listen selectively?

This is an Intermediate-level Short Course that runs 1h24m, according to the course page, and was made in partnership with Redis. It is aimed at developers and ML engineers who already know Python, embeddings and basic LLM applications. No prior knowledge of caching is required.

Both instructors work at Redis: Tyler Hutcherson, who manages the Applied AI Engineering team, and Iliya Zhechev, a Senior Research Engineer. There is nothing wrong with a vendor teaching its own tools, provided you can separate the general principles from the product promotion.

Reusing answers by meaning

The mechanism is compact. A query is converted into an embedding, which is compared with stored queries by cosine similarity. According to Redis’s blog, if the similarity exceeds a threshold, usually in the 0.85-0.95 range, the system returns the stored answer and does not call the LLM.

The fixed cost of this approach is often overlooked. Each vector search adds 5-20ms, while a hit saves 1-5 seconds. On a miss, the user still waits for the full LLM response, plus that overhead, so a cache pays off only when enough queries repeat.

Precision matters more than hit rate

The course’s running times show its priorities. Of the 7 videos, the three longest are “Measuring Cache Effectiveness” (13 minutes), “Enhancing Cache Effectiveness” (12 minutes) and “Fast AI Agent with Semantic Cache” (16 minutes). That is 41 minutes spent on measuring the cache, improving it and only then building it into an agent.

The course teaches three metrics: hit rate, precision and latency. Hit rate tells you how many calls you saved. Precision tells you what share of those hits returned the right answer; the rest were wrong.

Take a hypothetical set of 10,000 customer support queries with a threshold of 0.90 and a hit rate of 30%, which means 3,000 model calls avoided. If 4% of those hits are false positives, 120 people received the answer to a question they did not ask.

Now raise the threshold to 0.95, and say the hit rate drops to 20% while false positives fall to 1%. You avoid only 2,000 calls, 1,000 fewer than before. In return, wrong answers fall from 120 to 20.

The numbers are assumptions, but the trade-off is real, and only the client’s logs can tell you where the balance lies. Redis advises starting at a threshold of 0.90-0.95 and monitoring false positives. If the rate exceeds 3-5%, adjusting the threshold is no longer enough and the architecture has to change.

The first job at a client is therefore specific: take a sample of real logs, label which query pairs share a meaning and which do not, measure both thresholds as above, then choose on precision. Do not pick a threshold by feel during a demo.

When the data changes, so must the cache

Demos rarely deal with changing data. For fast-moving data such as prices or inventory, Redis suggests a TTL of 5-15 minutes, or invalidating the cache as soon as the source data changes. Otherwise, the agent will confidently quote a price that no longer applies.

Nor does semantic caching replace prompt caching. Prompt caching is for large, fixed context, while semantic caching is for queries that repeat the same intent. Redis calls combining the two layers “double caching”. Consider it when a client has both a long system prompt and many recurring questions.

What to discard, and what order to study in

Discard the savings figure. Redis writes that teams using semantic caching typically cut LLM costs by “50% or more”, depending on how often queries repeat. That is a vendor’s own claim, with no independent measurement behind it, so promise clients a measurement on their logs rather than a percentage.

You can watch the videos in order, but revisit the two on measuring and improving effectiveness before attempting the optional 10-minute project. Then read the comparison of prompt caching and semantic caching on Redis’s blog to see the full picture.

On a résumé, a line such as “built a semantic cache, chose a 0.92 threshold based on precision measured on a labeled set of query pairs, kept false positives below 3%” carries far more weight than “experience with Redis”. The numbers in that line must be ones you measured yourself.

The course teaches you how to make an agent faster. When a client asks “how much will we save?”, the answer can come only from their own logs.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
3 sources
Read next on the roadmap · Stage 5: DeploymentAndrew Ng's 11-hour course on why models decay after handoverMachine Learning in Production teaches scoping, baselines and concept drift well; the measurements each client needs are still yours to build.