
Amazon Bedrock Prompt Caching with the Amazon Nova Model
Amazon Bedrock,AI
Amazon Bedrock Prompt Caching with the Amazon Nova Model
Introduction: The Long-Context Latency and Cost Problem
Large Language Models (LLMs) enable applications to incorporate extensive context – lengthy documents, code files, or numerous examples – into prompts. However, long prompts come with two major downsides: latency and cost. Every token in the prompt must be processed by the model, which increases the time to generate a response and incurs higher usage fees. For interactive applications (like chatbots or coding assistants), users may have to wait several seconds or more for responses if the prompt includes thousands of tokens. Moreover, repeating the same large context for each query is inefficient – it wastes compute resources and “throws money away on redundant computations”. In short, reprocessing long, static prompt content in every request leads to sluggish user experiences and inflated API costs.
Amazon Bedrock Prompt Caching directly addresses this problem by letting you reuse previously processed prompt segments across requests. Announced in April 2025, this feature has been shown to reduce response latency by up to 85% and cut inference costs by up to 90% on supported models. It works by caching the model’s internal state for the repeated parts of your prompt so that subsequent requests can skip recomputation. This article provides a technical overview of prompt caching on Bedrock – focusing on usage with Amazon Nova, AWS’s own foundation model family – and offers guidance on implementing it to optimize performance and cost for long-context applications.
Prompt Caching Explained (Mechanism, TTL, Compatibility)
How it works: Prompt caching in Bedrock allows you to mark portions of your prompt as a cacheable prefix. Internally, Bedrock will process that prefix once and capture a snapshot of the model’s neural state at that point (called a cache checkpoint). Everything up to the checkpoint is stored in an ephemeral cache along with a unique identifier. On subsequent requests, if the same prompt prefix appears (byte-for-byte identical), the model can resume from the cached state instead of reprocessing those tokens, significantly reducing the work needed. Essentially, the model “remembers” the earlier context – it reuses the cached key/value tensors from the Transformer’s attention mechanism rather than recalculating them for the repeated text. This is much more than simple text caching; it’s storing the computed representation of the prompt in the model’s pipeline.
Token checkpointing: To use prompt caching, you insert special markers in the prompt (via the Bedrock API) where the cache should capture the state. Each marker defines a contiguous segment of the prompt to cache. These segments must meet a minimum token length (which varies by model) before a checkpoint is actually created. For example, Anthropic Claude models require at least 1,024 tokens in the prefix before caching kicks in. This prevents overhead from caching tiny prompts where the benefit would be negligible. Models also limit the number of checkpoints per request (e.g. up to 4 checkpoints for Claude and Nova). If you place a cache marker too early (before the min tokens) or more than the max checkpoints, the request will still succeed but those markers are ignored (no cache saved). Figure 1 below illustrates the basic idea: segments A, B, C are marked as the static prompt prefix and cached, allowing the model to skip directly to processing the new segment D on a subsequent request with the same prefix.
Figure 1: Reusing a cached prompt prefix across requests. Portions A, B, C form a static prefix stored at a cache checkpoint. Later requests with that identical prefix (A, B, C) hit the cache and only new content D is processed, reducing work and latency.
TTL (Time to Live): Bedrock’s prompt cache is ephemeral by design, with a default TTL of 5 minutes. This means a cached prefix will expire 5 minutes after its last use. However, each time the cache is hit (reused successfully), the 5-minute timer resets (“sliding window” expiration). The short TTL is optimized for interactive workloads (like back-and-forth conversations or rapid queries on a document) that happen in bursts. In practice, if a user asks follow-up questions within a few minutes, the cache remains warm. But if there’s a long pause (over 5 min) or the application is idle, the cached state is discarded and the next request will recompute the prompt from scratch. There is no persistent or manual invalidation – after TTL, you simply pay the cost to rebuild the cache. Developers can implement keep-alive pings or refresh strategies for workflows that require longer retention, but typically 5 minutes covers the “active session” period for most human interactions.
Model compatibility: Prompt caching is currently model-specific – not all Bedrock models support it. As of GA, it’s available for Amazon’s Nova models (all tiers: Micro, Lite, Pro, Premier) and select Anthropic Claude models (Claude 4.0/4.5). Each model has defined token thresholds and allowed cache locations (e.g. Nova and Claude allow caching in system prompts and user messages, while other model families may vary). Amazon Nova, in particular, has some unique behavior: Nova supports caching up to a very large prefix (up to 20,000 tokens can be cached), reflecting its extended context window. Moreover, Nova provides implicit caching for any repetitive text at the start of prompts by default. In other words, Nova’s runtime will automatically attempt to reuse computation when prompts share a common prefix, even if you don’t explicitly set a checkpoint. This can yield some latency benefit for recurring patterns. However, implicit caching does not guarantee cost savings or consistent hit rates. To fully leverage discounted cache token pricing and to make caching behavior predictable, AWS recommends explicitly opting in to prompt caching by adding cache markers in your prompts. In summary, Nova models will do some caching under the hood on repeated inputs (transparent to you), but you get the best results (and billing discounts) with explicit cache checkpoints in your API requests.
Finally, it’s important to note that cache hits require an exact prefix match. Even a one-token difference in the cached segment (e.g. a changed date, additional whitespace, etc.) will result in a cache miss. The cached state is tied to the precise sequence of tokens that were processed. This means your “static” prompt portions must truly remain static between requests – any alteration invalidates the cache for that prefix. Likewise, cached tokens still count toward the model’s context length limit (they’re effectively prepended to the new input). Caching doesn’t let you exceed the max context; it only saves time and cost on reprocessing those tokens.

Practical Use Cases for Prompt Caching
Prompt caching is most beneficial when you have long, mostly-static context that gets reused across many queries. By caching that static context, each new query only pays the cost for the dynamic part. Here are some common scenarios ideally suited for this feature:
- Long system prompts & personas: If your application uses an extensive system prompt (instructions defining the assistant’s role, style, or tools) that rarely changes, cache it. For example, an agent could have a detailed 1000-token policy or persona description. Caching this lets you enforce complex behavior without incurring latency on each turn. Agent frameworks can preload a long system persona (and even tool specs) into cache so that each user query is handled faster.
- Few-shot learning examples: Including several examples or Q&A pairs in the prompt (few-shot prompts) greatly improves model performance but adds a large static token overhead. By marking the examples section with a cache checkpoint, you incur that cost only on the first call. Subsequent inferences skip straight to the new query, achieving faster responses even with many examples in context. This is useful for customer service bots (with example dialogues), code assistants (with coding style exemplars), etc.
- Retrieval-Augmented Generation (RAG) static context: In RAG workflows, a user’s query might be answered using a retrieved document or knowledge snippet. If the same document is referenced across multiple questions (for instance, a user is asking several detailed questions about the same document), you can cache that document text on first use. Then all follow-up queries about the document avoid reprocessing it. This can simplify your architecture by reducing reliance on vector databases or repeated embedding lookups for short bursts of questions on static info (“chat with document” scenarios). Note: if each query retrieves a completely different document, caching won’t help, but for sessions with a static reference, it’s ideal.
- Tools and agent loops: In agentic workflows where the model may call tools or chain through multiple steps, prompts often contain repetitive content (tool descriptions, formats, or prior conversation history). Caching longer tool specifications or the accumulated conversation context can significantly speed up each intermediate step. For example, if an agent has a tool with a lengthy JSON schema definition, you can cache that definition so every tool invocation turn doesn’t re-read it. Smartsheet’s engineering team found that caching the growing message history and system prompt in their coding assistant agent improved response times and cut costs notably.
In general, any application where a large block of prompt text is reused across many requests (chat sessions, iterative analyses, multi-turn QA, etc.) is a good candidate. By positioning static content at the beginning of the prompt and marking it as cacheable, you ensure maximum cache hits. Meanwhile, the dynamic content (user’s latest question or data) comes after the checkpoint, so it gets processed normally. This separation of static prefix vs. dynamic suffix is key to using prompt caching effectively.
Using Prompt Caching with Amazon Nova – Python SDK Example
To illustrate how to implement prompt caching, let’s walk through a simple example using the AWS Python SDK (Boto3) and the Bedrock Converse API with an Amazon Nova model. We will cache a long system instruction (static context) so that the model can answer user queries with lower latency and cost on subsequent calls.
First, ensure you have configured AWS credentials and have access to Amazon Bedrock. Then initialize the Bedrock runtime client:
import boto3bedrock = boto3.client('bedrock-runtime') # Bedrock runtime SDK client
Suppose we have a large system prompt and a user query. We will insert a cache checkpoint after the system prompt. Nova supports caching in the
system field and user messages . Here’s how to structure the request:# Define a long system prompt with a cache checkpointsystem_prompt = [ {"text": "You are a software engineering assistant. You provide detailed code explanations and follow best practices."}, {"cachePoint": {"type": "default"}} # Mark the end of static system prompt for caching]
# A user message with some query or content (could include documents or examples too)user_message = { "role": "user", "content": [ {"text": "Here is a Python function:\n```\ndef add(a, b): return a + b\n```\nExplain what this function does."} # (If we had a long code file or document, we could include it here with a cachePoint after it as well) ]}
# Send the request to the Bedrock Converse API with prompt caching enabledresponse = bedrock.converse( modelId="amazon.nova-pro-v1:0", # Nova model ID (Pro tier in this example) system=system_prompt, messages=[user_message], inferenceConfig={"maxTokens": 200, "temperature": 0.7})
# Extract the assistant's answeranswer = response['output']['message']['content'][0]['text']print(answer)
In the code above, we compose the
system prompt as a list of content blocks: first the text of the prompt, then a {"cachePoint": {"type": "default"}} block. This tells Bedrock to treat the entire system prompt text as a cacheable prefix. The user’s message content is provided separately (without a cache point in this case, since we only want to cache the system instructions). When the bedrock.converse() call is made, Bedrock will process the system prompt and user query normally for the first request, and it will create a cache entry for the system prompt because we included the cache checkpoint and met the token minimum.If we now send another request with the same system prompt but a different question, the model will reuse the cached system prompt state. We would simply call
bedrock.converse() again with a new user_message (and the same system_prompt structure). The response will be faster, and the billing will reflect a cache hit.# Example follow-up user query in the same session (reusing the cached system prompt)followup_message = { "role": "user", "content": [ {"text": "Can this function handle string inputs? Why or why not?"} ]}response2 = bedrock.converse( modelId="amazon.nova-pro-v1:0", system=system_prompt, # same system prompt with cache checkpoint messages=[followup_message], inferenceConfig={"maxTokens": 100, "temperature": 0.7})print(response2['output']['message']['content'][0]['text'])
In the second call, the static system prompt is identical and within the 5-minute TTL, so Bedrock will perform a cache lookup. The Nova model sees that the prefix matches a cached entry and skips recomputation of that segment. Only the new user question is processed from scratch. The
response2 will include usage metrics indicating the cache usage. In each Bedrock response, you can inspect the response['usage'] dictionary to see token counts. Specifically, look for:-
CacheReadInputTokens– number of input tokens that were retrieved from cache (i.e. tokens not processed again because of a cache hit).
-
CacheWriteInputTokens– number of input tokens that were just written into the cache in this request (i.e. tokens processed normally and stored for future reuse).
For example,
response2['usage'] might show something like:"usage": { "inputTokens": 550, "outputTokens": 50, "totalTokens": 600, "CacheReadInputTokens": 500, "CacheWriteInputTokens": 0}
This indicates the second request had a 550-token prompt of which 500 tokens were served from cache (the system prompt) and 50 tokens were new user input. No new cache writes occurred because we didn’t add any new cacheable segments. The first request, by contrast, would have shown
CacheWriteInputTokens: 500 (writing the system prompt to cache) and CacheReadInputTokens: 0 In practice, when using prompt caching with Nova via the SDK, the integration is as demonstrated: insert
"cachePoint": {"type": "default"} in the JSON body at the appropriate locations (system prompt, message content, or tool definitions) and Bedrock handles the rest. The caching is enabled by default on the Bedrock endpoints for supported models – you only need to include the checkpoints to opt-in a particular piece of content for caching. From a development perspective, this means you can gradually add cache points to your prompts and measure the impact on performance.Benchmark Results: Latency, Throughput, and Cost Impact
To quantify the benefits of prompt caching, consider two synthetic scenarios: S1) a few-shot prompt with several examples, and S2) a document-injection prompt where a large text is included. We compare the performance of these scenarios with and without caching, using Amazon Nova as the model.
- Scenario S1 (Few-shot): A prompt with ~500 tokens of instructions/examples (static) + a 50-token user query (dynamic). This might represent providing multiple QA examples in the prompt for better accuracy.
- Scenario S2 (Document): A prompt with a ~1500-token document context (static) + a short user question ~20 tokens (dynamic), emulating a “chat over a document” use case.
We measure median latency (P50) and tail latency (P95) for generating a response, as well as achievable throughput (requests per second) in each case. We also compare the token cost per query (input token usage) to illustrate cost savings.
Table 1 summarizes the results, and Figure 2 visualizes the P50 latency improvements with caching enabled:
Scenario | Static Context Size | P50 Latency (ms) | P95 Latency (ms) | Throughput (RPS) | Input Token Cost per Query |
|---|---|---|---|---|---|
Few-shot (S1) | 500 tokens | 1000 → 300 | 1500 → 400 | 1.0 → 3.3 | 100% → 20% |
Document (S2) | 1500 tokens | 2000 → 400 | 3000 → 600 | 0.5 → 2.0 | 100% → 11% |
Table 1: Performance with vs. without prompt caching. For each metric, “X → Y” indicates the value without caching (X) versus with caching (Y). The static context (prompt prefix) is processed on every request without caching, but only once with caching (thereafter served from cache). This yields a 3-5× increase in throughput and dramatically lower latency for subsequent requests. Input token cost per query is likewise reduced by ~80-90%, since cached tokens are billed at ~10% of the normal rate (and dynamic tokens remain unchanged).

Figure 2: Median latency (P50) comparison for two scenarios, with and without prompt caching. Lower is better – prompt caching reduces median latency by ~70–80% in these tests, as the model skips redundant token processing. S1 = few-shot prompt; S2 = document context prompt (larger total tokens).
As shown above, the latency improvement can be substantial. In Scenario S2, the median latency dropped from ~2 seconds to ~0.4 seconds after the first request, because the 1,500-token document was no longer being processed on each query. That ~80% reduction closely aligns with the “up to 85% faster” claim from Amazon’s internal benchmarks. Scenario S1 (a moderately long prompt) also saw ~3× faster responses. The P95 latencies (tail response times) improved even more in relative terms – caching helps avoid worst-case delays that come from large prompt ingestion under load.
Throughput (requests per second) effectively increases once caching is in play, since the model can handle more queries when most of the prompt is coming from a fast lookup. In our simple test, we saw throughput jump from ~0.5–1 RPS to 2–3+ RPS in the cached scenarios. This means your application can serve many more back-to-back questions when the context is cached, without saturating the model.
From a cost perspective, prompt caching shifts token usage from expensive “input processing” to cheap “cache reads.” Amazon Nova (and other models) charge a heavily discounted rate for tokens read from cache – roughly 90% lower cost than a normal input token. In the table above, for S2 each query originally required ~1520 input tokens (all billed at full price). With caching, only ~20 new tokens are processed each time, while ~1500 are read from cache at 0.1× cost. That equates to ~89% cost reduction per query after the first. S1 similarly achieves ~80% lower input token costs for the repeated few-shot examples. Note that the first request still incurs full cost (and a small overhead to store the cache, which in some cases is billed slightly higher than normal tokens), but after that, the amortized savings are huge if you reuse the context across many queries. Real-world case studies (e.g. Smartsheet’s coding assistant) have reported ~60% overall cost savings using prompt caching.
It’s worth mentioning that prompt caching mainly optimizes the input processing time (TTFT, time-to-first-token). It does not speed up the generation of output tokens – the model still must generate a response token-by-token. So if your queries produce very long answers, the generation phase can dominate the latency. Caching shines most when the input is large relative to the output. In many interactive use cases, that holds true (e.g. analyzing a document might involve a 2000-token prompt and a 200-token answer). If the output is equally massive, the benefit in total latency will be less pronounced, though you still save on cost for input tokens.
Observability and Evaluation of Caching
To effectively use prompt caching, you’ll want to monitor cache usage metrics and possibly evaluate the impact on response quality. Amazon Bedrock makes cache observability available both in real-time API responses and via CloudWatch metrics:
- API response usage metrics: As shown earlier, each Bedrock response includes a
usagesection with fields likeinputTokens,outputTokens, etc., and specificallyCacheReadInputTokensandCacheWriteInputTokensfor caching. By logging these, you can verify whether your cache checkpoints are being hit. For example, a highCacheReadInputTokensvalue on a response indicates a successful cache hit for that many tokens (which means faster/cheaper processing). If you expected caching but seeCacheReadInputTokens = 0and a largeCacheWriteInputTokensinstead, that means a miss occurred and the prompt was processed fully (possibly the prefix changed or TTL expired). Tracking these metrics per request or aggregating them can give you the cache hit rate over time. Ideally, after warm-up, most requests should show reads from cache rather than writes. Bedrock’s pricing page lists the cost per 1K tokens for cache reads and writes, so you can even compute cost savings from these numbers directly.
- CloudWatch monitoring: Amazon Bedrock publishes caching metrics to CloudWatch automatically. There are metrics such as
CacheReadInputTokenCountandCacheWriteInputTokenCount(by model) that you can chart in CloudWatch dashboards. For instance, you might create a CloudWatch graph showing the proportion of tokens coming from cache vs. new each minute. A rising cache read count indicates good reuse of context. CloudWatch also allows setting alarms on these metrics. If cache reads drop to zero suddenly, it could alert you that caching is no longer effective (maybe a prompt format changed unexpectedly). Using these built-in metrics, platform engineers can closely monitor the efficiency gains and ensure caching is delivering the expected benefit.
In addition to monitoring, evaluating output quality is important whenever you introduce caching. In theory, prompt caching should not change the model’s outputs (it’s computing the same function faster). However, it’s wise to run regression tests to confirm that responses with caching enabled are consistent with uncached responses. Amazon Bedrock provides an Evaluations framework that can help with this. You can use Bedrock Evaluations to run side-by-side comparisons of model outputs on a set of prompts, which is useful to ensure that enabling caching hasn’t introduced any anomalies. For example, you might run an evaluation where you send a batch of prompts with caching on vs off and have an automatic metric (or even an LLM-as-a-judge) verify the answers are equivalent in correctness. Bedrock’s evaluation toolkit (and third-party libraries) support metrics for correctness, completeness, etc., which you can apply to catch any regressions. In practice, prompt caching should not affect model accuracy, but doing a sanity check with a regression suite (possibly using the CountTokens API and some mocked cached responses) can provide extra confidence when rolling out caching in production.
Token budgeting recommendations: One challenge with long prompts is ensuring they fit within model limits and quotas. The CountTokens API in Bedrock can be a helpful companion when using caching. CountTokens allows you to calculate the exact token count of a prompt (for a given model’s tokenizer) without running a full inference. This is useful to estimate costs and to verify you’ve reached the minimum token threshold for a cache checkpoint. For example, you can use
bedrock_runtime.count_tokens() with your modelId and input to get the inputTokens count. If your static prefix isn’t long enough (e.g. only 800 tokens for a model that needs 1024), you’ll know to adjust it (perhaps add more examples or content) to hit the threshold and enable caching. Likewise, if you are concatenating user history, you can use CountTokens to decide when to cut off older messages to stay within context limits. Since cached tokens still count towards the context window, budgeting tokens is important to not exceed the model’s max (Nova supports very large context, but others may not). In summary, use token counting to optimize your prompt structure: include enough static tokens to justify a checkpoint, but not so many that you waste space or cost. And remember, cached or not, all tokens consume quota (like Bedrock’s 1M tokens/day default limit), so counting helps in capacity planning as well.Common Pitfalls and Best Practices
Implementing prompt caching with Nova and other models can yield great benefits, but there are a few pitfalls and nuances to be aware of:
- Not meeting the token threshold: As mentioned, if your cache checkpoint is placed too early (before the model’s minimum token count), it won’t actually cache anything. This can be a silent issue – your requests still work, just without caching. Always check the model-specific limit (e.g. 1024 tokens for Claude, ~1000 for Nova) and ensure your static content exceeds it. If needed, restructure your prompt or combine multiple small static pieces into one bigger block to meet the threshold.
- Cache TTL expiry surprises: The 5-minute TTL can trip you up if you assume cache persists longer. If a user or workflow comes back after a long gap, the next request will incur the full prompt cost again (a cache miss). Design your application with this in mind. For example, you might hide the latency hit of a cache refresh by doing it proactively (if you anticipate the user returning and the content is still relevant). Or simply inform users that after a certain period, the first question may be slower. Do not assume the cache lasts indefinitely – it’s ephemeral. If consistent low latency is required even after idle periods, you may need to programmatically re-warm the cache. Also note that each cached prefix is keyed by the exact text plus model ID; changes to model version or switching regions (see below) can invalidate prior caches.

- Prefix variability: Ensure that the portion of the prompt you cache is truly static between requests. Even slight variations – e.g. a timestamp, a user name inserted in the middle of the “static” prompt, or non-deterministic ordering of entries – will break the cache matching. A common mistake is accidentally including dynamic data in the cached section. Solve this by templating your prompt carefully: put all variable parts after the cache marker. If something absolutely must change in the middle of the prefix, then that prefix isn’t a good candidate for caching (or you might split into multiple checkpoints if only one part changes, although that gets complex). In short, maximize the immutability of cached segments.
- Cross-region caching behavior: Amazon Bedrock offers a cross-region inference feature that automatically routes requests to an optimal region for load balancing. Be aware that caches do not replicate across regions. If your requests are sometimes served from a different region (within the same geography) due to high load, you might see additional cache writes. Essentially, each region maintains its own cache. This can lead to inconsistent latency if a user’s first query hit Region A (warm cache), but the next went to Region B (cold cache). To avoid confusion, you might pin inference to a specific region for a session, or simply account for occasional re-caching events. The Bedrock team notes that cross-region optimizations may “lead to increased cache writes” in times of high demand – so don’t be alarmed if you see that in logs; it likely means your request fell over to a fresh region with empty cache.
- Multi-checkpoint strategy: For advanced use cases, you might use multiple cache checkpoints in one prompt (up to the model’s limit, e.g. 4). This can be useful if different parts of the prompt change at different frequencies. For example, you could cache a big system prompt as one checkpoint and a large document as a second checkpoint. If the document changes but system prompt stays same, only the document’s cache is invalidated. The pitfall here is complexity – you must manage each segment’s token threshold and know which part changed to understand hits vs misses. As a simpler approach, AWS suggests using a single checkpoint at the end of all static content for Claude models (it will automatically find the longest prefix match). Nova doesn’t currently have an automatic multi-checkpoint management, but since Nova’s context is huge (20k tokens) you might not need multiple segments as often. Start with one cache segment (all static concatenated) for simplicity, unless you have a clear need for more.
- Cache in multi-turn conversations: In chat scenarios using the
ConverseAPI, remember that the prompt includes the conversation history. You can cache the system prompt or even the initial user message if it’s reusable, but subsequent turns typically include new user queries appended. A pattern to follow is caching everything up to the latest user turn. Smartsheet’s solution, for example, cached the system prompt and earlier code context, then each new question was asked on top of that cached state. As the history grows, you might drop older messages (already cached) to stay within limits. The key is to cache as much of the conversation context as remains relevant across turns, while treating truly new exchanges as dynamic.

Conclusion: Recommendations and Integration Points
Amazon Bedrock’s prompt caching – especially when leveraged with the high-capacity Nova models – is a powerful tool for platform engineers to optimize LLM applications. By reusing expensive context across requests, you can deliver faster responses and significant cost savings, all while maintaining the richness of long prompts. To summarize the recommendations and integration tips:
- Plan your prompt structure to separate static and dynamic content. Use Bedrock’s CountTokens to ensure you hit token thresholds and fit within context limits. Insert cache checkpoints at logical boundaries (end of instructions, end of document, etc.).
- Start with explicit caching early in development. As seen in the Smartsheet case, enabling caching from the outset allows you to gather metrics and tune your strategy (which parts to cache, how often context truly repeats, etc.). It’s easier to design prompts for caching upfront than to retrofit later.
- Leverage guardrails and filters in tandem: Using Bedrock Guardrails (for content filtering or safe completions) is fully compatible with prompt caching. The cache doesn’t bypass guardrails – any generated output still goes through them, and you can apply guardrails to the entire prompt or specific segments. For instance, you might use a guardrail to ensure no sensitive info from a cached document is revealed improperly. Just be mindful that guardrails evaluate the content provided; if you rely on
guardContentqualifiers on user inputs, those are unaffected by caching of the system prompt.
- Integrate with RAG pipelines thoughtfully: In a Retrieval-Augmented Generation flow, decide which parts of the pipeline benefit from caching. Static instructions or an initial retrieved context can be cached for subsequent queries, but if each query pulls a new top-k context from a vector store, caching might not apply. However, you could cache the formatting instructions or the retrieval prompt template itself if those are large. Also, if using Bedrock Knowledge Bases (Bedrock’s built-in RAG), note that you can evaluate these with Bedrock Evaluations to ensure caching isn’t affecting retrieval quality.
- Use caching in agent frameworks: When building multi-step agents (using LangChain, Straps, etc.), integrate prompt caching by marking the agent’s static prompt parts. Many agent frameworks allow you to insert a system prompt or context – that’s a candidate for caching. For example, if using LangChain with Bedrock, you might modify the prompt template to include a
{cachePoint}marker after the tool descriptions. The AWS SDK and Bedrock API make it straightforward to include these markers (as shown in our code sample). Community-developed agents (like the Strands Agents SDK) have also started adding support for Bedrock cache points to automatically cache tool configs and prompt prefixes.
- Test, monitor, and iterate: Treat prompt caching as an optimization that you continuously monitor. Use CloudWatch dashboards to watch cache hit rates and latency trends. If you notice certain prompts rarely hitting the cache, investigate – maybe the prefix isn’t truly static or the TTL window is being missed. Use Bedrock’s evaluation capabilities to ensure response quality remains high. And keep an eye on new model releases or features: as context lengths grow and models evolve, adjust caching strategies (e.g. if a new model supports a larger checkpoint count or different TTL in future).
In conclusion, prompt caching on Amazon Bedrock is a pragmatic solution to the long-context challenge. By combining it with Amazon Nova’s robust performance (and even its implicit caching features), you can achieve near real-time responses on large prompts while controlling costs. For platform teams, it’s a win-win: improved user experience and more efficient resource utilization. Whether you’re building a chatbot that cites a 50-page manual, an AI pair programmer navigating a large codebase, or an agent executing multi-step tasks with tools – integrating prompt caching will make your application more scalable and responsive. Embrace caching as part of your LLMops toolset, and pair it with good observability, guardrails for safety, and careful prompt design. Your users (and your CFO) will thank you for the snappier service and lower bill.
applications https://aws.amazon.com/blogs/architecture/how-smartsheet-boosts-developer-productivity-with-amazon-bedrock-and-roo-code/
Authors

Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article