A cache keyed by meaning, not exact text: embed the request, and if a past one is close enough, return its answer instead of paying for the call again.
What it is
An ordinary cache needs the same string twice. A semantic cache keys on meaning instead: you embed the incoming request, and if a past request is semantically close, you return its cached answer. "Reset my password" and "how do I change my password" become one entry. You implement it with GPTCache, a Redis vector index, or a gateway's built-in cache (Portkey and LiteLLM both ship one), so it is as much a pattern as a product.
The one job
It stops you paying for the same question asked in different words. When traffic repeats, that is the difference between billing every rephrasing and billing only the genuinely new ones.
Reach for it when
Skip it when
A minimal look
// embed the request and find the nearest past question
const q = await embed(request);
const hit = await store.nearest(q); // nearest-neighbour over cached questions
// only trust the cache above a similarity threshold
if (hit && hit.score > 0.92) {
return hit.answer; // the call you never make
}
const answer = await callModel(request);
await store.put(q, answer); // remember it for next time
The principle it teaches
The cheapest model call is the one you never make. This is Week 3's first cost lever, but it carries a Week 5 tension: a wrong cache hit is a silent quality bug, so the threshold you pick is something your evals have to police.
Where it fits your labs
This is a Week 3 tool with a Week 5 tail. Lab 3 has you add a semantic-cache step and measure the call reduction; the same lab is where you learn to guard the threshold so cheap answers do not become wrong ones.