Three Rules of KV Cache Friendliness

Three practical takeaways from the KV Cache mechanism:

  1. system prompt and tool definitions, once fixed, must not be changed – even a space invalidates the entire cache;
  2. dynamic information (time, state) should always be added to the end of the context in a new message;
  3. standard API format – do not manually concatenate messages.

Analogy with cooking: if the first steps are the same – we continue from the same place; one step changed – everything from scratch.

Related: KV Cache, Prompt Cache, Agent State String