Specialist guidance for Amazon Bedrock. Covers model selection, agent design, knowledge bases, guardrails, prompt engineering, batch inference, and cost optimization.
Process
- Understand the workload: what is being built, who consumes it, and what quality bar is required
- Use the
awsknowledge MCP tools (mcp__plugin_aws-dev-toolkit_awsknowledge__aws___search_documentation, mcp__plugin_aws-dev-toolkit_awsknowledge__aws___read_documentation, mcp__plugin_aws-dev-toolkit_awsknowledge__aws___recommend) to verify current Bedrock model availability, pricing, and features (these change frequently)
- Select the right model(s) based on task complexity, latency, and cost
- Design the architecture: direct invocation, RAG, agent, or multi-agent
- Configure guardrails for user-facing surfaces
- Estimate costs using the
references/cost-modeling.md template
- Recommend monitoring and cost controls
Model Selection
The model choice is the single biggest cost and quality decision. Get this right first.
| Need |
Recommended Model |
Why |
| Classification, routing, extraction |
Nova Micro or Claude Haiku |
Fast, cheap, accurate for structured tasks |
| General Q&A, summarization |
Nova Lite or Nova Pro |
Strong quality-to-cost ratio |
| Multimodal (image + text) |
Nova Lite |
Cost-effective vision without Sonnet pricing |
| Complex reasoning, nuanced generation |
Claude Sonnet |
Best balance of capability and cost |
| Hardest problems, highest quality bar |
Claude Opus |
Reserve for tasks where Sonnet falls short |
| Embeddings |
Titan Embed v2 |
Cheaper than Cohere, solid quality for most use cases |
| Code generation |
Claude Sonnet |
Strong code quality without Opus pricing |
Note: Model availability and pricing change frequently. Verify current options via awsknowledge MCP tools (mcp__plugin_aws-dev-toolkit_awsknowledge__aws___search_documentation, mcp__plugin_aws-dev-toolkit_awsknowledge__aws___read_documentation, mcp__plugin_aws-dev-toolkit_awsknowledge__aws___recommend) before making final recommendations.
Model Selection Principles
- Start with the smallest model that could work. Upgrade only when evidence shows it falls short.
- Benchmark on real data, not generic benchmarks. A smaller well-prompted model often beats a larger general one.
- Use Bedrock's intelligent prompt routing to auto-route requests to the right model tier.
- Evaluate the Nova family before defaulting to third-party models — Nova Pro offers comparable quality to Claude Sonnet for many tasks at significantly lower cost per token, and Nova Lite/Micro provide sub-100ms latency for classification and routing tasks where you don't need full reasoning capability. Nova models also have no cross-provider data transfer fees and deeper native Bedrock integration (Guardrails, Knowledge Bases, Flows).
Bedrock Agents
Design Principles
- One agent, one job. If the agent description contains "and", consider splitting.
- Fewer tools = fewer reasoning steps = faster + cheaper. 3-5 tools is the sweet spot.
- Use direct
InvokeModel for simple tasks. Not everything needs an agent.
Architecture Patterns
Router + Specialists: A lightweight classifier (Nova Micro) routes to specialized agents. Each specialist has a focused tool set and optimized prompt. This beats one mega-agent with 20 tools.
Knowledge Base + Guardrails: For customer-facing Q&A — KB for retrieval, guardrails for safety, single model call for generation. No agent orchestration needed; use RetrieveAndGenerate API directly.
Agent with Session Memory: For multi-turn conversations — use AgentCore sessions with memory. Let the agent maintain context across turns instead of stuffing history into the prompt each time.
Action Groups
- Use Lambda-backed action groups for complex logic
- Use Return Control for client-side tool execution (keeps agent stateless, avoids Lambda cost)
- Define OpenAPI schemas tightly — vague schemas cause the model to guess (and guess wrong)
Knowledge Bases
Chunking Strategy
- Fixed-size chunking (default): Good starting point. 300-500 tokens with 10-20% overlap.
- Semantic chunking: Better quality, higher embedding cost. Use for high-value, heterogeneous documents.
- Hierarchical chunking: Best for long documents with clear structure (manuals, legal docs).
- Curate the data source — garbage in, garbage out applies doubly to RAG.
Vector Store Selection
- OpenSearch Serverless: Default choice. Managed, scales, integrates natively. See
references/cost-modeling.md for minimum costs.
- Aurora PostgreSQL (pgvector): Good if already running Aurora — consolidates infrastructure.
- Pinecone / Redis: If existing investments in these stores.
- For PoCs, share a single OpenSearch Serverless collection across multiple KBs to minimize cost.
Retrieval Tuning
- Start with hybrid search (semantic + keyword) — outperforms pure semantic for most workloads
- Tune retrieved chunk count (default 5). More chunks = more context = more input tokens. Find the minimum that gives good answers.
- Use metadata filtering to scope retrieval — avoid searching everything when the document category is known.
Prompt Engineering on Bedrock
Prompt Caching
- Bedrock caches repeated system prompts automatically for supported models
- Structure prompts: long, stable system prompt + short, variable user prompt
- Cached input tokens are up to 90% cheaper — structure prompts to maximize cache hits
Prompt Management
- Use Bedrock's Prompt Management to version and manage prompts
- Treat prompts like code — version them, test them, review changes
- Use prompt variables for dynamic content instead of string concatenation
Structured Output
- Request JSON with explicit schemas to reduce output token waste
- Use the Converse API with tool use for structured extraction — more reliable than asking for JSON in the prompt
Batch Inference
- 50% cheaper than on-demand for supported models
- Use for: document processing, bulk classification, dataset enrichment, eval runs
- Not for: real-time user-facing requests (latency is minutes to hours)
- Submit jobs via S3 input/output — fits naturally into data pipelines
Guardrails
- Apply to user-facing inputs and outputs. Skip for internal agent reasoning steps.
- Content filters are cheaper than denied topic policies — use filters for broad categories, denied topics for specific restrictions.
- Contextual grounding checks catch hallucination at inference time — useful for RAG apps.
- PII detection/redaction is built in — use it instead of building custom regex.
Diagnostic CLI Commands
Resource creation belongs in IaC. Use the iac-scaffold skill for templates.
# List available models in the region
aws bedrock list-foundation-models \
--query 'modelSummaries[].{id:modelId,name:modelName,provider:providerName}' --output table
# Quick model test (Converse API — preferred over invoke-model)
aws bedrock-runtime converse \
--model-id amazon.nova-micro-v1:0 \
--messages '[{"role":"user","content":[{"text":"Hello"}]}]'
# List agents
aws bedrock-agent list-agents --output table
# List knowledge bases
aws bedrock-agent list-knowledge-bases --output table
# List guardrails
aws bedrock list-guardrails --output table
# Check model invocation logging status
aws bedrock get-model-invocation-logging-configuration
Anti-Patterns
- Defaulting to the biggest model "just to be safe" — start small, upgrade with evidence
- Building an agent when a single InvokeModel call would do — agents compound cost per turn
- Stuffing entire documents into prompts instead of using Knowledge Bases — RAG is cheaper and more maintainable
- Ignoring prompt caching — it is automatic for supported models, just structure prompts correctly
- Using on-demand for bulk processing that could be batch — 50% savings left on the table
- One massive Knowledge Base instead of scoped, curated collections — hurts retrieval quality and costs more
- Skipping guardrails on user-facing apps — "we'll add them later" becomes a security incident
- Not monitoring token usage — costs sneak up fast during iteration, especially with agents
Additional Resources
Reference Files
For detailed cost modeling and estimation, consult:
references/cost-modeling.md — Pricing model breakdown, cost modeling template, optimization strategies, monitoring setup, and cost estimation output format
Related Skills
cost-check — Broader AWS cost analysis beyond Bedrock
iac-scaffold — IaC templates for Bedrock resource creation
security-review — Security audit for Bedrock configurations and guardrail policies
Output Format
When advising on a Bedrock solution:
| Component |
Choice |
Rationale |
| Primary model |
Claude Sonnet |
Complex reasoning required, cost-effective for the quality bar |
| Routing model |
Nova Micro |
Cheap classifier for request triage |
| Architecture |
Router + Specialist agents |
3 focused agents vs 1 mega-agent |
| Knowledge Base |
OpenSearch Serverless, hybrid search |
Best retrieval quality, managed infrastructure |
| Guardrails |
Content filters + PII redaction |
Customer-facing surface |
| Estimated monthly cost |
$X,XXX |
See references/cost-modeling.md for breakdown |
Include cost profile and watch-out-for items specific to the use case.
1---2name: bedrock3description: Deep-dive into Amazon Bedrock — model selection, agents, knowledge bases, guardrails, prompt engineering, and cost modeling. This skill should be used when the user asks to "build with Bedrock", "select a Bedrock model", "design a Bedrock agent", "set up a knowledge base", "configure guardrails", "estimate Bedrock costs", "optimize Bedrock pricing", "use prompt caching", "compare Bedrock models", or mentions Amazon Bedrock, foundation models, RAG on AWS, or generative AI on AWS.4---56Specialist guidance for Amazon Bedrock. Covers model selection, agent design, knowledge bases, guardrails, prompt engineering, batch inference, and cost optimization.78## Process9101. Understand the workload: what is being built, who consumes it, and what quality bar is required112. Use the `awsknowledge` MCP tools (`mcp__plugin_aws-dev-toolkit_awsknowledge__aws___search_documentation`, `mcp__plugin_aws-dev-toolkit_awsknowledge__aws___read_documentation`, `mcp__plugin_aws-dev-toolkit_awsknowledge__aws___recommend`) to verify current Bedrock model availability, pricing, and features (these change frequently)123. Select the right model(s) based on task complexity, latency, and cost134. Design the architecture: direct invocation, RAG, agent, or multi-agent145. Configure guardrails for user-facing surfaces156. Estimate costs using the `references/cost-modeling.md` template167. Recommend monitoring and cost controls1718## Model Selection1920The model choice is the single biggest cost and quality decision. Get this right first.2122| Need | Recommended Model | Why |23|---|---|---|24| Classification, routing, extraction | Nova Micro or Claude Haiku | Fast, cheap, accurate for structured tasks |25| General Q&A, summarization | Nova Lite or Nova Pro | Strong quality-to-cost ratio |26| Multimodal (image + text) | Nova Lite | Cost-effective vision without Sonnet pricing |27| Complex reasoning, nuanced generation | Claude Sonnet | Best balance of capability and cost |28| Hardest problems, highest quality bar | Claude Opus | Reserve for tasks where Sonnet falls short |29| Embeddings | Titan Embed v2 | Cheaper than Cohere, solid quality for most use cases |30| Code generation | Claude Sonnet | Strong code quality without Opus pricing |3132**Note**: Model availability and pricing change frequently. Verify current options via `awsknowledge` MCP tools (`mcp__plugin_aws-dev-toolkit_awsknowledge__aws___search_documentation`, `mcp__plugin_aws-dev-toolkit_awsknowledge__aws___read_documentation`, `mcp__plugin_aws-dev-toolkit_awsknowledge__aws___recommend`) before making final recommendations.3334### Model Selection Principles35- Start with the smallest model that could work. Upgrade only when evidence shows it falls short.36- Benchmark on real data, not generic benchmarks. A smaller well-prompted model often beats a larger general one.37- Use Bedrock's intelligent prompt routing to auto-route requests to the right model tier.38- Evaluate the Nova family before defaulting to third-party models — Nova Pro offers comparable quality to Claude Sonnet for many tasks at significantly lower cost per token, and Nova Lite/Micro provide sub-100ms latency for classification and routing tasks where you don't need full reasoning capability. Nova models also have no cross-provider data transfer fees and deeper native Bedrock integration (Guardrails, Knowledge Bases, Flows).3940## Bedrock Agents4142### Design Principles43- One agent, one job. If the agent description contains "and", consider splitting.44- Fewer tools = fewer reasoning steps = faster + cheaper. 3-5 tools is the sweet spot.45- Use direct `InvokeModel` for simple tasks. Not everything needs an agent.4647### Architecture Patterns4849**Router + Specialists**: A lightweight classifier (Nova Micro) routes to specialized agents. Each specialist has a focused tool set and optimized prompt. This beats one mega-agent with 20 tools.5051**Knowledge Base + Guardrails**: For customer-facing Q&A — KB for retrieval, guardrails for safety, single model call for generation. No agent orchestration needed; use `RetrieveAndGenerate` API directly.5253**Agent with Session Memory**: For multi-turn conversations — use AgentCore sessions with memory. Let the agent maintain context across turns instead of stuffing history into the prompt each time.5455### Action Groups56- Use Lambda-backed action groups for complex logic57- Use Return Control for client-side tool execution (keeps agent stateless, avoids Lambda cost)58- Define OpenAPI schemas tightly — vague schemas cause the model to guess (and guess wrong)5960## Knowledge Bases6162### Chunking Strategy63- **Fixed-size chunking** (default): Good starting point. 300-500 tokens with 10-20% overlap.64- **Semantic chunking**: Better quality, higher embedding cost. Use for high-value, heterogeneous documents.65- **Hierarchical chunking**: Best for long documents with clear structure (manuals, legal docs).66- Curate the data source — garbage in, garbage out applies doubly to RAG.6768### Vector Store Selection69- **OpenSearch Serverless**: Default choice. Managed, scales, integrates natively. See `references/cost-modeling.md` for minimum costs.70- **Aurora PostgreSQL (pgvector)**: Good if already running Aurora — consolidates infrastructure.71- **Pinecone / Redis**: If existing investments in these stores.72- For PoCs, share a single OpenSearch Serverless collection across multiple KBs to minimize cost.7374### Retrieval Tuning75- Start with hybrid search (semantic + keyword) — outperforms pure semantic for most workloads76- Tune retrieved chunk count (default 5). More chunks = more context = more input tokens. Find the minimum that gives good answers.77- Use metadata filtering to scope retrieval — avoid searching everything when the document category is known.7879## Prompt Engineering on Bedrock8081### Prompt Caching82- Bedrock caches repeated system prompts automatically for supported models83- Structure prompts: long, stable system prompt + short, variable user prompt84- Cached input tokens are up to 90% cheaper — structure prompts to maximize cache hits8586### Prompt Management87- Use Bedrock's Prompt Management to version and manage prompts88- Treat prompts like code — version them, test them, review changes89- Use prompt variables for dynamic content instead of string concatenation9091### Structured Output92- Request JSON with explicit schemas to reduce output token waste93- Use the Converse API with tool use for structured extraction — more reliable than asking for JSON in the prompt9495## Batch Inference96- 50% cheaper than on-demand for supported models97- Use for: document processing, bulk classification, dataset enrichment, eval runs98- Not for: real-time user-facing requests (latency is minutes to hours)99- Submit jobs via S3 input/output — fits naturally into data pipelines100101## Guardrails102- Apply to user-facing inputs and outputs. Skip for internal agent reasoning steps.103- Content filters are cheaper than denied topic policies — use filters for broad categories, denied topics for specific restrictions.104- Contextual grounding checks catch hallucination at inference time — useful for RAG apps.105- PII detection/redaction is built in — use it instead of building custom regex.106107## Diagnostic CLI Commands108109Resource creation belongs in IaC. Use the `iac-scaffold` skill for templates.110111```bash112# List available models in the region113aws bedrock list-foundation-models \114 --query 'modelSummaries[].{id:modelId,name:modelName,provider:providerName}' --output table115116# Quick model test (Converse API — preferred over invoke-model)117aws bedrock-runtime converse \118 --model-id amazon.nova-micro-v1:0 \119 --messages '[{"role":"user","content":[{"text":"Hello"}]}]'120121# List agents122aws bedrock-agent list-agents --output table123124# List knowledge bases125aws bedrock-agent list-knowledge-bases --output table126127# List guardrails128aws bedrock list-guardrails --output table129130# Check model invocation logging status131aws bedrock get-model-invocation-logging-configuration132```133134## Anti-Patterns135136- **Defaulting to the biggest model "just to be safe"** — start small, upgrade with evidence137- **Building an agent when a single InvokeModel call would do** — agents compound cost per turn138- **Stuffing entire documents into prompts instead of using Knowledge Bases** — RAG is cheaper and more maintainable139- **Ignoring prompt caching** — it is automatic for supported models, just structure prompts correctly140- **Using on-demand for bulk processing that could be batch** — 50% savings left on the table141- **One massive Knowledge Base instead of scoped, curated collections** — hurts retrieval quality and costs more142- **Skipping guardrails on user-facing apps** — "we'll add them later" becomes a security incident143- **Not monitoring token usage** — costs sneak up fast during iteration, especially with agents144145## Additional Resources146147### Reference Files148149For detailed cost modeling and estimation, consult:150- **`references/cost-modeling.md`** — Pricing model breakdown, cost modeling template, optimization strategies, monitoring setup, and cost estimation output format151152### Related Skills153- **`cost-check`** — Broader AWS cost analysis beyond Bedrock154- **`iac-scaffold`** — IaC templates for Bedrock resource creation155- **`security-review`** — Security audit for Bedrock configurations and guardrail policies156157## Output Format158159When advising on a Bedrock solution:160161| Component | Choice | Rationale |162|---|---|---|163| Primary model | Claude Sonnet | Complex reasoning required, cost-effective for the quality bar |164| Routing model | Nova Micro | Cheap classifier for request triage |165| Architecture | Router + Specialist agents | 3 focused agents vs 1 mega-agent |166| Knowledge Base | OpenSearch Serverless, hybrid search | Best retrieval quality, managed infrastructure |167| Guardrails | Content filters + PII redaction | Customer-facing surface |168| Estimated monthly cost | $X,XXX | See `references/cost-modeling.md` for breakdown |169170Include cost profile and watch-out-for items specific to the use case.