Streaming and semantic caching 00:00:01 The cached answer from yesterday A customer repeats a question almost word for word. The cache lights up with a near-perfect match, but this morning's policy moved from version seven to version eight. Ali checks the label before pulling the old answer into the prompt. A retrieval service can improve perceived latency by streaming, and avoid repeated work by caching. Streaming changes when content becomes visible. A semantic answer cache decides whether an earlier answer is still eligible for a new request. Bind an entry to its owner, permissions, evidence revisions and the settings that produced it. Similarity can rank eligible entries. It cannot make an older or unauthorized entry eligible. 00:00:46 Read the scope before the text The new question resembles an old question. The customer's scope and effective policy revision still participate in cache eligibility. A semantic match alone is insufficient. Reject the stale entry and rebuild evidence under version eight before generation. Stream provisional text according to product policy. Record first-token and validated completion latency independently, then cache the verified result in the correct scope. 00:01:17 Trace the version behind the cache rag streaming has several clocks: retrieval completion, first generated token, first displayed token and final validation. A provisional answer can appear quickly while its citations remain unchecked. Communicate incomplete states and decide which content needs buffering until verification is complete. Retrieval finishes at 0.3 seconds, text appears at 0.8 and citations validate at 2.1. Report all three milestones with their meanings. A semantic cache reuses an answer for a sufficiently similar query. Scope cache entries by tenant, permissions, corpus revision and other facts that change the answer. “Can I return it after 30 days?” and “before 30 days?” can be close embeddings but require opposite answers. Ask two nearly identical questions with opposite before/after qualifiers. Recheck both policy scope and expected answer before reusing cached text. Define cache identity before tuning similarity thresholds. Tenant, access scope, document revision and task context can invalidate an answer even when the wording is nearly identical. Benchmark first visible content and final verified completion separately. Start two timers when the customer asks. Stop the first when text appears. Stop the second only after the current policy and its citation have been checked. A fast first timer can coexist with a slow verified answer. 00:02:52 Can a near-perfect match be served? Similarity is 0.99 but the cached answer belongs to another tenant. Can it be reused? Similarity does not transfer permission. Tenant and evidence scope are prerequisites for eligibility. Keep the speedy first text provisional until the full response and citations have passed their checks. Returning last week's answer faster is still a failure on today's question.