Groundhog Day for AI agents: Prompt caching patterns for using OpenAI models on Amazon Bedrock
Machine Learning Blog
This article explains how prompt caching reduces costs for AI agents using OpenAI models on Amazon Bedrock by reusing cached prompts instead of reprocessing the same context repeatedly.
- Agents must resend entire conversation history, tools, and instructions on every turn; prompt caching stores and reuses this prefix at reduced cost
- Use explicit caching to mark static tools and instructions for reuse; use implicit caching to automatically cache growing conversation history
- Combine both modes: explicit markers for shared content and implicit mode for conversation growth across agent turns
- Keep the reusable prefix stable and byte-for-byte identical; append new information after cache boundaries to maintain reuse
- Use allowed_tools to restrict callable functions without invalidating cache; append new tools with additional_tools during sessions
- Warm shared prefixes before launching parallel helper agents to ensure cache population before concurrent requests
- Monitor cache effectiveness using cached_tokens and cache_write_tokens in response usage; track cost savings in CloudWatch metrics
- Achieved 61-64% input cost reduction in tested workloads compared to no caching
Prompt caching breaks the Groundhog Day cycle for AI agents, enabling them to reuse context efficiently and significantly reduce token costs while maintaining conversation continuity.
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
2026
2026
2026
2026
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.