What we covered
- Bedrock Foundation Models — hosted LLMs on the serverless Bedrock platform (examples: DeepSeek, Anthropic Claude, Sonnet, Amazon Nova Micro/Pro). These are pre-hosted: pick the model that best fits your needs (reasoning, latency, cost) instead of always choosing the largest.
- Tokens and context windows — how inputs and generated outputs consume tokens, and why both must fit within a model’s published context window.
- Prompt engineering — how to make prompts directive, unambiguous, and constrained so the model reliably returns the expected format and content.
- Building with the AWS SDK — calling Bedrock runtime methods (for example, InvokeModel or Converse) and using control-plane operations for guardrails and agents.
- Integrations and serverless architecture patterns — common flows like fetching data from S3 and exposing a model-backed API via API Gateway + Lambda.
- Safety and filtering — application-level checks (deny lists, regex, pattern matching) and Bedrock Guardrails for policy enforcement at scale.
- Retrieval-augmented generation (RAG) — combining vector search over your documents (for example, PDFs in S3) with model prompts via Bedrock Knowledge Bases.
- Agents and AgentCore — enabling models to call tools, orchestrate multi-step workflows, and interact with external APIs and databases.

Tip: For production usage, design prompts with explicit roles and output schemas (for example JSON) and include context limits to reduce hallucinations and parsing errors.
Tokens & context windows — practical reminder
- Input tokens + output tokens must fit within the model’s context window.
- When designing systems, budget tokens for context (documents, system instructions) and expected output length.
- Trim or summarize long context documents before embedding them into prompts or use RAG to include only top-k relevant snippets.
Prompt engineering best practices
- Use explicit instructions, not questions.
- Set the model’s role (e.g., “You are a technical writer…”).
- Include audience and context.
- Constrain output format and length (examples: “Return a JSON object with keys: title, summary, actions”).
- Provide examples or a template when consistency is required.
Building applications with the AWS SDK
You can interact with Bedrock programmatically via the AWS SDK to perform runtime inference or to manage control-plane resources. The following is a conceptual example showing how an application may call a model runtime method (conceptual JavaScript example).- AWS SDKs and Tools
- Amazon Bedrock documentation (start here for concrete SDK examples)
Integration patterns and architecture
- Common serverless pattern: API Gateway → Lambda → Bedrock runtime.
- Data flow example: user request → Lambda retrieves context from S3 (or a DB) → performs vector search against a Knowledge Base → constructs prompt → calls Bedrock → returns result to client.
- Monitor and log: enable model invocation logging and use CloudWatch for metrics, traces, and alarms.
Safety, filtering, and permissions
- Filter both user-supplied content and model-generated output.
- Start with simple application-level filters (deny lists, regex) and scale to Bedrock Guardrails for centralized policy enforcement.
- Apply least-privilege IAM: restrict roles and policies to only the Bedrock models, regions, and resources the application needs.
Security reminder: never grant broad Bedrock or S3 permissions to your application roles. Use fine-grained IAM policies and test guardrail policies to ensure unsafe content is blocked before it reaches downstream systems.
Retrieval-augmented generation (RAG) and Knowledge Bases
- Use vector embeddings and similarity search to locate the most relevant document passages (for example, from PDFs stored in S3).
- Build prompts that include only the highest-relevance snippets to minimize token usage and improve answer accuracy.
- Bedrock Knowledge Bases can accelerate RAG development and reduce the time-to-market vs. implementing a full RAG pipeline from scratch.
Agents and AgentCore
- Agents let models orchestrate multi-step workflows by calling tools (APIs, DBs, external services).
- Agent decision-making controls whether to call a tool, which tool to call, and how many times to iterate to achieve the goal.
- Bedrock Agents provide a serverless way to combine knowledge bases and tools; AgentCore enables advanced customization and control.
Skills you’ve gained

Next steps and recommendations
- Keep building: integrate generative AI into real projects to move beyond deterministic logic and unlock new product capabilities.
- Continue learning: follow Bedrock releases, model updates, and shared best practices.
- Experiment: try AgentCore, build Knowledge Bases, and test Guardrails in staging to validate policies and flows.
- Build a portfolio: develop small Gen AI-enabled applications to solidify skills and demonstrate value to teams or employers.
