generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 551
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Problem Statement
Strands currently supports "default" caching of system prompts, but it does not allow users to control which parts of the system prompt should and should not be cached. When using dynamic system prompts, where some of the prompt is static, but a portion is dynamic, the ability to control which portion of the prompt gets cached is essential to be able to leverage prompt caching.
Proposed Solution
Bedrock supports granular caching today by accepting an array of content blocks in its system prompt parameter. For example:
[
{"text": "static portion of my prompt"},
{"cachePoint": {"type": "default"}},
{"text": "dynamic portion of my prompt"},
]Strands should consider accepting such an array for its own system prompt param. Here's how this could look:
a = Agent(
model=BedrockModel(
model_id="anthropic.claude-sonnet-4-20250514-v1:0",
),
system_prompt=[
{"text": "static portion of my prompt"},
{"cachePoint": {"type": "default"}},
{"text": f"dynamic portion of my prompt: {something_random()}"},
],
)Use Case
See above.
Alternatives Solutions
No response
Additional Context
No response
flowconic, markgofigr, haandol and rickkk856
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request