Back to glossary

Agent Caching

Storing and reusing the results of previous agent computations, tool calls, or model inferences to reduce latency and cost for repeated or similar requests. Agent caching operates at multiple levels from prompt caching to full response caching.

Agent caching dramatically reduces both cost and latency for agent systems that handle repetitive or similar requests. Prompt caching (supported natively by providers like Anthropic) stores the processed system prompt and tool definitions so they do not need to be re-tokenized on every call. Tool result caching stores API responses so repeated queries return instantly. Semantic caching matches similar (not just identical) queries to cached responses.

For high-traffic agent deployments, caching can reduce costs by 50 to 80 percent. Implement it in layers: deterministic caching for identical tool calls (same parameters always return same results), time-bounded caching for data that changes slowly (competitor prices, inventory levels), and semantic caching for model inferences on similar queries. The key challenge is cache invalidation: knowing when cached data is stale and needs refreshing. Set appropriate TTLs based on how quickly the underlying data changes, and implement cache warming for predictably needed data. Monitor cache hit rates to quantify the value of your caching strategy and identify opportunities for improvement.

Related Terms