The same 2,000 tokens are prefilled a thousand times an hour. Caching their KV by content turns that into one prefill and a table lookup, and a radix tree is what makes multi-turn and branching agents share it too.
Every request shares a 2,000-token system prompt. How does prefix caching exploit that, and how does the radix tree work?
The same 2,000 tokens are prefilled a thousand times an hour. Caching their KV by content turns that into one prefill and a table lookup, and a radix tree is what makes multi-turn and branching agents share it too.
Updated Sep 2026 · Grounded in real AI infrastructure interview loops and written to a senior-engineer editorial bar, with every number worked and every diagram hand-built.
The concepts behind this question
Ranked by how closely each one overlaps this question's topic, so the first card is the thing to read if the answer above moved too fast.
Scored on the compute and memory saved per hit with numbers, on how the tree matches prefixes at token granularity, and on the eviction and branching behavior that plain hash caching cannot do.
No comments yet — be the first to share your approach.
