← Back to Portfolio

🧬 Agentic AI Well Architected

Interactive Best Practices Tutorial - 20 Pillars, 4 Layers, 77 Learning Scenarios

⚡Executive Summary

Agentic AI Well Architected is an interactive demo application that teaches agentic AI best practices on AWS through side-by-side comparisons. Follow the story of AnyCompany building SupportBot - a GenAI-powered customer support assistant - from first prototype to enterprise product. Each of the 20 pillars tackles a different challenge, showing a naive approach alongside an AWS best-practice implementation with live Amazon Bedrock calls. Covers 4 layers (Model, Guardrail, Orchestration, Platform), 6 foundation models, Bedrock Guardrails with Automated Reasoning (35 formal logic rules), RAG with Knowledge Bases, multi-agent orchestration via Strands Agents, AgentCore primitives (Gateway, Memory, Policy, Evaluation, Observability), SSO authentication via Cognito, and full audit logging. All infrastructure defined in CDK.

📋Situation

The Industry-Wide Problem

Enterprise teams adopting generative AI and agentic patterns face a steep learning curve. AWS offers powerful primitives - Bedrock models, Guardrails, Knowledge Bases, AgentCore (Gateway, Memory, Policy, Evaluation, Observability) - but understanding when and how to apply each one requires deep expertise. Teams either skip best practices entirely (shipping unsafe, unobservable prototypes) or spend months reading documentation without seeing the real-world impact of each decision.

The Learning Gap

Scale of Impact: Every enterprise building on Amazon Bedrock faces the same gap between "hello world" and production readiness. Teams needed an interactive, story-driven application that lets them experience the consequences of each architectural decision with live model calls - not just read about them.

🎯Task

The Challenge: Making Best Practices Tangible

The goal was to build a comprehensive interactive tutorial where every pillar of agentic AI architecture is demonstrated through side-by-side comparison - send the same prompt through a naive implementation and a best-practice implementation, see both results in real time, and understand exactly what changed and why it matters.

The Strategic Imperative: This was not about building another demo. It was about creating a teaching platform where the consequences of skipping best practices are immediately visible - where teams can send the same prompt through both paths and see exactly what goes wrong when you skip guardrails, ignore prompt engineering, or deploy without observability.

⚙️Action

The Architecture

Full-stack serverless application on AWS integrating Bedrock models, Guardrails, Knowledge Bases, Strands Agents, and multiple AgentCore primitives:

                     CloudFront (CDN)
                    /                \
                   /                  \
         S3 (React SPA)         API Gateway HTTP API
                                      |
                                API Lambda (Node.js)
                               /    |     |    \     \
                      Bedrock  Guardrails  KB  Strands  DynamoDB
                     Converse  (Content + (S3  Agent    (Audit
                      API      Auto-Reason)Vectors)Lambda  Logs)
                                                  |
                                            S3 (Agent Results)

Authentication:
  Browser → Cognito Hosted UI → MidWay SSO (OIDC) → Callback → Lambda token exchange → JWT session

AgentCore Primitives:
  Gateway (Managed MCP) → Memory (Semantic/Session/Preferences) → Policy (Cedar) → Evaluation (LLM Judge) → Observability (OTEL)

The 20 Pillars - 4 Layers

Model Layer How You Talk to the Model

Pillar Story Beat Naive vs. Best Practice
Prompt Engineering Building the Prototype Raw user prompt vs. role-specific system prompt with constraints and structured output
Performance Efficiency Speed Matters Unconstrained verbose output vs. token-budgeted ≤100-word bullet-only responses
Cost Optimization The Bill Arrives Verbose token-wasteful prompts vs. concise prompts with model routing (Haiku vs. Sonnet)

Guardrail Layer Safety, Fairness, and Factual Accuracy

Pillar Story Beat Naive vs. Best Practice
Guardrails Keeping SupportBot On-Topic No content filtering vs. Bedrock Guardrails with topic denial, PII redaction, content policies
Responsible AI Fair Customer Decisions Generic AI responses vs. auditable decision-support with bias identification and human review triggers
Automated Reasoning Getting the Facts Right Unverified factual claims vs. 35 formal logic rules verifying AWS service limits (S3, Lambda, SQS, DynamoDB, API Gateway, SNS, Kinesis, Step Functions, EFS)

Orchestration Layer Connecting Models to Data, Tools, and Agents

Pillar Story Beat Naive vs. Best Practice
Tool Calling Reliability Real Data, Not Hallucinations Hallucinated data vs. Bedrock Converse API toolConfig with strict JSON schemas
RAG & Data Quality Company Knowledge Parametric-only knowledge vs. Bedrock Knowledge Base grounding with source citations from 4 internal docs
Multi-Agent Orchestration The Ops Agent Team Single monolithic agent vs. Strands Agent-as-Tool with specialist agents (metrics, security, cost)
MCP Integration Live Documentation Outdated training data vs. AWS Documentation MCP Server for live doc search
AgentCore Gateway Managed MCP at Scale Fragile MCP subprocesses vs. managed SigV4 auth, rate limiting, and CloudWatch observability
AgentCore Memory Persistent Agent Memory Stateless conversations vs. semantic facts, session summaries, and user preferences across sessions
Legacy Integration Old Meets New Ignores system constraints vs. adapter patterns with circuit breakers and format translation

Platform Layer Security, Identity, Governance, Evaluation, and Observability

Pillar Story Beat Naive vs. Best Practice
Identity & Multi-Tenancy Going Enterprise No access controls vs. Cognito + IAM tenant isolation, per-tenant RAG filtering and billing
Security Red-Teaming Before Launch Vulnerable system prompt vs. hardened prompt blocking prompt injection, extraction, and jailbreak attacks
Reliability Inconsistent Answers Bare model call vs. structured output with CONFIDENCE levels, failure modes, and fallback model chains
AgentCore Policy Cedar-Based Governance No restrictions on agent actions vs. Cedar authorization policies for models, KBs, tools, and token budgets
Agent Evaluation Proving Agent Quality No quality metrics vs. AgentCore Evaluation with Builtin.Helpfulness, Builtin.Correctness, custom evaluators, on-demand and online modes
Observability & Tracing Proving It Works Black-box model calls vs. AgentCore Observability with end-to-end OpenTelemetry tracing
Agent Testing Ground-Truth Validation No test coverage vs. tool call sequence validation and response content verification against ground-truth

Technology Stack

Amazon Bedrock Claude Sonnet 4 Claude Haiku 4.5 Nova Premier / Pro / Lite / Micro Bedrock Guardrails Automated Reasoning Bedrock Knowledge Bases S3 Vectors Strands Agents SDK Bedrock Agents AgentCore Gateway AgentCore Memory AgentCore Policy (Cedar) AgentCore Evaluation AgentCore Observability Amazon Cognito MidWay SSO (OIDC) DynamoDB AWS Lambda API Gateway CloudFront Amazon S3 React 19 TypeScript Cloudscape Design AWS CDK Python 3.12 Node.js 20

Automated Reasoning - 35 Formal Logic Rules

The Automated Reasoning pillar uses Bedrock's formal verification engine with 35 S-expression rules covering AWS service limits across 9 services. When the model claims "Lambda max timeout is 30 minutes," the guardrail flags it because the rule says 900 seconds (15 minutes). No statistical uncertainty, no false negatives - provable correctness.

Multi-Agent Orchestration

The Multi-Agent pillar demonstrates the Strands Agents SDK with the Agent-as-Tool pattern. An orchestrator agent delegates to 3 specialist agents, each with focused tools and constrained system prompts:

Per-tool metrics (tokens, latency, cost) are tracked and returned for trace visualization in the UI. A ToolCallLimiter hook caps tool calls at 6 per agent to prevent runaway loops.

AgentCore Gateway - Managed MCP

The AgentCore Gateway pillar shows the difference between fragile local MCP subprocesses and a managed, production-grade MCP endpoint:

AgentCore Memory - 3 Strategy Types

The Memory pillar demonstrates persistent agent memory with three strategy types, seeded with demo data via a CDK custom resource:

AgentCore Policy - Cedar Authorization

The Policy pillar demonstrates Cedar-based governance for agent actions:

AgentCore Evaluation - LLM-as-a-Judge

Authentication & Audit

Key Design Decisions

Story-Driven Learning: All 20 pillars follow a continuous narrative (AnyCompany building SupportBot) rather than isolated demos. Decisions in Prompt Engineering affect Security, which affects Reliability, which affects Observability - users experience the compound effect.

Side-by-Side, Not Sequential: The dual-panel UI shows both approaches simultaneously on the same prompt. Users see the failure of the naive approach and the success of the best practice in the same view, with metrics to quantify the difference.

Real Calls, Not Canned Responses: Every comparison uses live Bedrock ConverseStream calls. Users can modify prompts and see how both architectures respond differently to the same variation.

Parameter-Driven Auth: Authentication is a CDK context parameter, not a code branch. The same codebase serves open-access demos and SSO-protected enterprise deployments.

Formal Verification Over Statistical: The Automated Reasoning pillar uses S-expression rules for provable correctness - not embeddings or similarity scores. When it flags a hallucinated service limit, the proof is a formal logic contradiction.

📊Result

Key Capabilities

20
Pillars Across 4 Architectural Layers
77
Story-Driven Learning Scenarios
6
Foundation Models (Claude + Nova)
35
Automated Reasoning Rules (9 AWS Services)

Frontend Experience

Platform-Level Impact

Strategic Impact: Agentic AI Well Architected transforms agentic AI best practices from abstract documentation into tangible, measurable experiences. By letting users run the same prompt through both architectures side by side, it compresses months of trial-and-error learning into hours of interactive exploration across 20 pillars covering every layer of the production agentic AI stack.

🎥Demo Video

Watch the Agentic AI Well Architected application in action - explore how each pillar contrasts naive vs. best-practice approaches with live Amazon Bedrock calls:

💡Key Learnings & Best Practices

Architecture Insights

AgentCore Insights

Observability Insights

← Back to Portfolio