Table of Contents

Repeated identical prompts

IF the same full tool-call sequence recurs more than ten times across sessions in a repo → THEN add an application-layer semantic cache for that sequence → RESULT roughly half of those repeats are served from cache, and the avoided cost is attributed.

The signal in the agentic log

  • Signal: the same complete tool-call sequence repeats > 10 times across sessions within a repo.
  • Field source: ToolCalls, SessionId, RepoId, Cost.
  • The sequence is the full ordered list of tools, so this catches deterministic workflows (a build-and-test loop, a repeated review pass), not just similar prompts.

The setup

  1. Accept the semantic response caching recommendation.
  2. It recommends an application-layer cache for that sequence with a 30-day TTL.
  3. Wire the cache in front of the repeated sequence in the agent or gateway.

The result

  • The detector assumes a 50% cache hit on repeat occurrences and multiplies by the average cost per occurrence for its projection.
  • Actual hits appear as reduced call volume in the log; savings are re-measured from the calls that no longer happen.

Behind it