Architecture note2 lab guides2 lab guides
Bedrock · Amazon Bedrock
Managed foundation models, Converse API, knowledge bases and RAG, agents, and guardrails without leaving AWS.
Outcome
- Enabled model access for Claude 3 Haiku and Titan Embeddings via console
- Verified model access via CLI (
list-foundation-models) - Made a basic single-turn Converse API call and logged token usage + cost
- Implemented streaming with
converse_streamand measured time-to-first-token - Built a multi-turn conversation loop with full history passing
- Observed input token cost compounding across turns
- Demonstrated temperature effect: determinism at 0 vs variance at 1.0
- Used system prompts to change answer persona and framing
- Extracted structured JSON output with temperature=0 and JSON parse retry logic
- Uploaded documents to S3 and created a Bedrock Knowledge Base
- Triggered an ingestion job and polled for completion
- Queried KB with
retrieve_and_generateand extracted source citations - Confirmed RAG doesn't hallucinate for out-of-KB questions
- Created a guardrail with topic denial, PII redaction, and content filters
- Tested all guardrail cases and read the intervention trace
- Enabled model invocation logging to S3 and computed total lab cost
- Cleaned up all resources in correct order