Everything *[NYC] 2026: see what we announced. →
Skip to content

KV cache for LLMs and agents definition

A KV cache is the store of attention keys and values a language model computes for tokens it has already processed, kept in memory during inference so that each new token is generated by attending over saved state instead of recomputing the entire sequence.


A diagram explaining KV cache for LLMs and agents in terms of related concepts.

What is a KV cache in an LLM?

How is prompt caching or prefix caching different from the KV cache?

Why does the KV cache matter so much for AI agents?

How do you keep an agent's prompt prefix cacheable?

Is the KV cache the same as agent memory or a knowledge base?

How does structured content make an agent's context prefix cacheable?

Unlock New Possibilities with Sanity

With KV cache for LLMs and agents under your belt, it's time to see what Sanity can do for you. Explore our features and tools to take your content to the next level.

Last updated: