AI Architect — Master Notes
Purpose: Weekly/monthly review to retain concepts, prepare for architecture discussions, stakeholder meetings, and AI Architect interview questions. Sources: CCA-P certification, RAG/VectorDB/Agent deep dives, AI engineering roadmap. Profile: DevOps Manager → AI Solution Architect | AWS, Terraform, K8s, Jenkins, Grafana
Table of Contents
- Core AI/LLM Concepts
- RAG — Retrieval-Augmented Generation
- Vector Databases
- AI Agents
- Claude Platform & Solution Design
- Enterprise Integration & Production
- Responsible AI, Safety & Risk
- Stakeholder Engagement, Lifecycle & GTM
- Team Enablement & Operational Productivity
- Architecture Decision Frameworks
- Interview Q&A Quick Reference
- Stakeholder Meeting Cheat Sheet
- Weekly Review Checklist
1. Core AI/LLM Concepts
1.1 Four AI Properties Every Architect Designs Around
| Property | Capability | Limitation | Mitigation |
|---|---|---|---|
| Next-token prediction | Summarizing, reformatting, explaining | Precision on specifics (names, dates, stats) | Citations, uncertainty signaling, generator-verifier loops |
| Knowledge | Common, recent, consistent topics | Rare, niche, contested, fast-changing | Web search, RAG, tools, MCP → external source of truth |
| Working memory | Anything in active context window | Hard edge — outside window = no access | Progressive loading, chunking, summarizing |
| Steerability | Short, concrete, verifiable instructions | Abstract instructions, long reasoning chains | System prompts, structured outputs, code execution |
Critical: A demo running cleanly 5× is NOT evidence of determinism. Confidence ≠ validity → why human-in-the-loop matters.
1.2 Key Distinctions
- LLM alone ≠ agent. LLM = brain. Agent = brain + tools + memory + planning
- Parametric knowledge = model's training memory. Non-parametric = fetched at request time (RAG, tools)
- Live state = data that changes during conversation (order status, price). Requires tool call, NOT RAG
- Context window is NOT a data-governance boundary — anything passed is transmitted to API
- Retrieval = stable knowledge. Tool use = live state. Don't confuse them.
1.3 Token & Cost Fundamentals
- ~1 token ≈ 0.75 English words; 300-page doc ≈ 100-120k tokens; 80-page doc ≈ 29k tokens
- Model the token DISTRIBUTION, not the average — heavy-tailed inputs underestimate cost by 2-3×
- Output tokens ≈ 5× input token price at every tier
- p95 latency, never median — SLA breaches live in the tail
- Batch API = 50% discount for async workloads
1.4 Lost-in-the-Middle
LLMs recall content at beginning and end of context best, middle worst. Place most important content at head and tail. Relevant to prompt design AND RAG context assembly.
2. RAG — Retrieval-Augmented Generation
2.1 What is RAG?
Analogy: Open-book exam. Don't memorize — look up the right sections, read what's relevant, write answer grounded in source material. RAG = LLM (student with reasoning) + Vector Database (textbook).
2.2 Two Myths Debunked
- "RAG is dead" → Maturing, not dying. Corrective RAG, Self-RAG, Agentic RAG are responses to limitations
- "Bigger context windows replace RAG" → Cost (1M tokens/query is astronomical), latency (massive context = slow), accuracy (signal buried in noise). Well-built RAG wins on all three
2.3 Chunking Strategies
| Strategy | Description | When |
|---|---|---|
| Fixed-size | N-token pieces (e.g., 512) + 10-20% overlap | Quick prototyping — loses context at boundaries |
| Recursive | Split on separator hierarchy (paragraph → sentence → word) | Sane production default |
| Semantic | Embedding model detects topic shifts | Long-form prose, wandering topics |
| Layout-aware | Markdown headers, HTML tags, PDF structure | Structured docs, codebases |
| Hierarchical (parent-child) | Index small child chunks ( |
Most-adopted production pattern |
Sizing: 512-1024 tokens/chunk. Too big = signal diluted. Too small = no context. Read your actual chunks.
2.4 Embedding Models (2026)
- OpenAI:
text-embedding-3-large| VoyageAI: Voyage 3 | Open-source: BGE Large, E5 Mistral - Benchmark on YOUR domain — no universal winner
- Consistency rule: SAME embedding model for indexing AND querying — mismatch silently destroys retrieval
2.5 Vector Database Selection
| DB | Type | Best For |
|---|---|---|
| Chroma DB | Embedded, Python | Prototyping — easiest setup |
| Qdrant | Self-hosted, Rust | Performance, self-hosting — Docker in 5 min |
| Pinecone | Fully managed | Production, no infra management |
| Weaviate | Self-hosted/Managed | Hybrid search (vector + keyword) |
| OpenSearch | AWS-native | AWS ecosystem integration |
2.6 Retrieval Strategies
| Data/Query Shape | Strategy |
|---|---|
| Uniform prose, paraphrase queries | Dense vector search alone |
| IDs, model numbers, error codes | Hybrid: BM25 + dense, fused with Reciprocal Rank Fusion (RRF) |
| High-stakes precision | Hybrid + cross-encoder reranker (top 50-200; +10-20% relevance, +100-400ms) |
| Short/ambiguous queries | Query rewriting: Multi-Query or HyDE (embed hypothetical answer) |
| Live-state data | NOT RAG — tool call to live system |
Anthropic's Contextual Retrieval: Prepend chunk context before embedding + contextual BM25 + reranker → reduces top-20 retrieval failures by ~67%.
2.7 The 10 RAG Patterns
| # | Pattern | When to Use |
|---|---|---|
| 1 | Simple RAG | Prototyping only |
| 2 | RAG with Memory | Chatbot/assistant use cases |
| 3 | Branched RAG | Multi-faceted questions, multiple sources |
| 4 | HyDE | Bridges query vs document embedding gap |
| 5 | Adaptive RAG | Reduces cost — routing layer decides if retrieval needed |
| 6 | Corrective RAG (CRAG) | Quality gate — below threshold → reformulate or web search |
| 7 | Self-RAG | Model critiques own reasoning in real time. High-stakes |
| 8 | Agentic RAG | Direction the field is moving. LLM as orchestrator, loops until good enough |
| 9 | Multimodal RAG | Charts, diagrams, tables, images. Enterprise data is visual |
| 10 | Graph RAG | Knowledge graph — connecting multiple pieces. Outperforms vector search on relationships |
2.8 RAG Failure Diagnosis
| Symptom | Root Cause | Fix |
|---|---|---|
| Confident-but-wrong after corpus refresh | Retrieval/indexing broke | Re-index, check embedding consistency, chunk boundaries |
| Gradual quality drift, no code change | Retrieval drift (corpus grew, index didn't keep pace) | Check corpus/index first |
| Exact-term queries failing | Pure vector search misses exact matches | Add BM25 hybrid with RRF |
The #1 RAG mistake: Using retrieval where a tool call belongs. Symptoms: stale chunks, answers contradict database. Fix: Call the system that owns live state directly.
2.9 RAG for DevOps/SRE → AI
| RAG Component | Infra Equivalent | What You'd Build |
|---|---|---|
| Vector DB | Database cluster mgmt | Pinecone/OpenSearch on AWS with Terraform |
| Embedding pipeline | CI/CD pipeline | Jenkins: ingestion → chunking → embedding → storage |
| Retrieval API | API gateway + LB | SageMaker endpoints / EKS service |
| LLM serving | Container orchestration | K8s with GPU autoscaling (KServe/Seldon) |
| Monitoring | Grafana/Prometheus | Drift detection, retrieval quality, latency SLOs |
| Multi-tenancy | IAM + namespace isolation | IAM boundaries, VPC isolation, per-tenant indexes |
| Cost optimization | FinOps | Batch vs real-time, caching embeddings, adaptive routing |
3. Vector Databases
3.1 The Problem They Solve
Traditional DBs: exact/partial text matching — "Find documents where 'vacation' appears" works. Vector DBs: meaning-based matching — "How many days off do I get per year?" — traditional DB fails because "vacation" doesn't appear in the query.
3.2 How Vectors Work
- Convert words/sentences/images into list of numbers (vector / embedding)
- Numbers positioned in mathematical space to capture meaning
- Similar meanings → similar numbers → close together in vector space
- Classic:
vector("king") - vector("man") + vector("woman") ≈ vector("queen")
3.3 Vector DB in RAG Flow
Documents → Embedding Model → Vectors → Vector Database
User Query → Embedding Model → Query Vector → Similarity Search
→ Top Results + Query → LLM → Grounded, Accurate Response
3.4 Chunking — Critical Mistake
- Too large → lose precision (embedding averages to mush)
- Too small → lose context ("this applies to enterprise customers" — what is this?)
- Starting point: 300-500 tokens/chunk, 50-100 tokens overlap, use semantic chunker
3.5 Decision Framework
| Situation | Recommended |
|---|---|
| Learning / experimenting locally | Chroma DB |
| Performance + self-host control | Qdrant |
| Production, no infra management | Pinecone |
| Hybrid search (vector + keyword) | Weaviate |
| AWS-native ecosystem | OpenSearch / pgvector |
3.6 Beyond RAG
| Use Case | How |
|---|---|
| Music recommendation (Spotify) | Listening history → vector → match song vectors |
| Content recommendation (Netflix) | Viewing history → vector → match content vectors |
| Visual search (Pinterest) | Image → vision model → vector → find similar pins |
| Anomaly detection (Cybersecurity) | Normal traffic clusters; outliers = alerts |
3.7 Indexing Concepts
- ANN (Approximate Nearest Neighbor): HNSW or IVF indexes for fast similarity search at scale
- Distance metric (cosine/dot/L2) must match embedding model's recommendation
- Metadata filtering on index = security boundaries (tenant/ACL scoping)
- Access control belongs AT THE RETRIEVAL LAYER for confidential docs
- Store raw text separately from vectors so you can re-embed without re-parsing
3.8 Vector DB for DevOps/SRE
| Concern | Infra Experience | Application |
|---|---|---|
| Self-hosting | K8s, Docker, EKS | Qdrant on EKS with Terraform, auto-scaling |
| Managed service | RDS, ElastiCache | Pinecone (fully managed) |
| Monitoring | Grafana, Prometheus | Query latency, recall@k, index size, memory |
| Multi-tenancy | IAM, namespace isolation | Per-tenant collections, RBAC on indexes |
| Backup & DR | EBS snapshots, cross-region | Vector index backups, point-in-time recovery |
4. AI Agents
4.1 What is an AI Agent?
Analogy: LLM on its own = brilliant person locked in a room — can only talk. Agentic AI = giving that person a phone, computer, internet, calendar — can search, run calculations, send emails, write code, call APIs.
An AI agent is an LLM that can perceive its environment, make decisions, and take actions.
4.2 Four Core Components
| Component | Role |
|---|---|
| Brain (LLM) | Reasoning engine — decides what to do next |
| Tools | Functions the agent can call — search, run code, call APIs |
| Memory | Short-term: conversation history. Long-term: store/retrieve across sessions |
| Planning & Reasoning | Break big goal into smaller steps, figure out order |
Planning & reasoning is what separates a truly agentic system from one that just answers questions.
4.3 Autonomy Spectrum
| Level | Description | Risk |
|---|---|---|
| L0: Smart Chatbot | Single Q&A | Minimal |
| L1: Tool-Use | Model uses tools, you approve every step | Low |
| L2: Multi-Step Agent | Agent chains steps, you supervise at end | Medium |
| L3: Fully Autonomous | Long sequences across systems, surfaces results when done | High |
More autonomy = more capability BUT also more risk. Start Level 1-2 in production.
4.4 Four Agentic Patterns
| Pattern | Description |
|---|---|
| ReAct | Thought → Action → Observation → Thought → ... — most foundational |
| Reflection | Agent critiques itself: write draft → review → revise → repeat |
| Plan and Execute | Create full plan first, then execute. More structured, predictable |
| Multi-Agent | Multiple specialized agents coordinate. Orchestrator owns goal; subagents own sub-tasks |
Multi-agent rules:
- Subagent failure = usually recoverable. Orchestrator failure = usually unrecoverable
- Coverage check at synthesis — results returned MUST equal units dispatched
- Scope each subagent's tools to its task (least privilege)
4.5 Frameworks
| Framework | Best For | When |
|---|---|---|
| LangGraph | Production, reliability, debuggability | Control + production reliability |
| CrewAI | Role-based multi-agent | Fast prototyping, role-based architecture |
| AutoGen | Conversational multi-agent + human oversight | Research/enterprise settings |
4.6 Seven Primitives (Claude Platform)
| Primitive | Job |
|---|---|
| Tools | Act — function the model can call |
| MCP | Connect — protocol for exposing tools across clients |
| Subagents | Isolate/parallelize — scoped sub-task in separate context |
| Hooks | Guarantee — deterministic code that fires on events, model can't skip |
| Skills | Package a procedure — versioned, reusable unit |
| Agent Teams | Coordinate peers — multiple agents as coordinated peers |
| Dynamic Workflows | Compose at runtime — assemble steps at runtime |
Discipline: Use the fewest primitives necessary. Heavier = more latency, tokens, operational surface.
4.7 Production Considerations
- Autonomy vs Risk: Start Level 1-2. Human-in-the-loop for high-risk
- Observability: Agent decision traces are your new logs. Every thought, action, observation logged
- Cost control: Token usage per agent run = new compute cost metric. Adaptive routing
- Guardrails: Tool execution boundaries via IAM. Rate limiting. Circuit breakers when agents loop
- Per-turn token budgets + max tool call counts + stopping criteria — unbounded loops = #1 agent cost failure
4.8 Agents for DevOps/SRE → AI
| Component | Infra Equivalent | Build |
|---|---|---|
| Agent runtime | Container orchestration | LangGraph/CrewAI on EKS with K8s autoscaling |
| Tool execution | API gateway, Lambda | Tool functions as Lambda behind API Gateway |
| Memory (short) | Redis/ElastiCache | Conversation state in Redis with TTL |
| Memory (long) | Vector DB + S3 | Pinecone/Qdrant for semantic memory |
| Monitoring | Grafana, Prometheus | Decision traces, tool call latency, token usage, cost/run |
| Deployment | Terraform, Jenkins | Pipeline with evaluation gates and rollback |
| Guardrails | IAM, security policies | Tool boundaries, rate limiting, human-in-the-loop |
| Multi-agent | Service mesh (Istio) | Agent-to-agent communication, circuit breakers |
5. Claude Platform & Solution Design
5.1 Four Key Decisions
| # | Decision | Question |
|---|---|---|
| 1 | Decomposition | What part of the work should Claude own? |
| 2 | Pattern selection | What shape is the work? (augmented / workflow / agent) |
| 3 | Reference architecture | Can you name the reference architecture? |
| 4 | Entry point, model, context | Where does work interact with Claude? |
Order: Decomposition → Pattern → Reference Architecture → Model/Context/Entry Point. Governance constraints can rule out entry points BEFORE any other tradeoff.
5.2 Three Layers (Don't Conflate!)
| Layer | What It Is | Chosen By |
|---|---|---|
| Entry Points | What user/system interacts with | User & work |
| Build-time interfaces | How engineer programs against Claude | Engineering team |
| Delivery routes | Where API traffic terminates | Cloud commitments & compliance |
5.3 Decomposition — Who Does What?
| Owner | What Belongs Here |
|---|---|
| Claude | Language understanding, summarization, planning, drafting, tool-mediated action |
| Existing systems | Anything already reliable: order-status service, policy engine, rules table, DB of record |
| Humans | Judgment calls, exception paths, approvals, high-stakes decisions |
Delegation criteria: Reversibility, Stakes, Accountability. Key framing: Ask "where do the four properties argue for Claude over the system that already does this right?" — NOT "where can Claude help?"
5.4 Pattern Selection
| Pattern | Predictability | Autonomy | When |
|---|---|---|---|
| Augmented LLM | High | Low | Single bounded task, verifiable output |
| Workflow | Medium | Medium | Predictable shape, bounded judgment per step |
| Agent | Low | High | Steps can't be determined in advance |
Workflow Sub-Patterns
| Sub-pattern | When |
|---|---|
| Chaining | Clear stage handoffs |
| Routing | Different input types need different handling |
| Parallelization | Independent sub-tasks |
| Evaluator-optimizer | Quality verifiable but single pass insufficient |
Five-Factor Framework
| Factor | Augmented LLM | Workflow | Agent |
|---|---|---|---|
| Predictability | Low risk | Low risk | High risk |
| Error cost | Medium | Low | High |
| Observability | Medium | Low | High |
| Latency | Low | Medium | High |
| Cost | Low | Medium | High |
Agent vs Workflow rule: If you could have written the steps in code, use a workflow. Try prompting before fine-tuning: Prompt → tools/retrieval → stronger pattern → fine-tuning (last resort).
5.5 Reference Architectures
| Architecture | Key Failure Mode |
|---|---|
| Agent | Non-deterministic failures in trajectory |
| RAG | Retrieval applied to live state (most common mistake!) |
| Document processing | No exception path for low-confidence extractions |
| Customer service / ticket triage | Missing escalation path, unguarded tools |
| Coding agent | — |
Combining architectures: Do it when different parts break differently. Don't do it because you haven't decided what problem you're solving.
5.6 Model & Context Strategy
Model Selection Rules
- Start small (Haiku/Sonnet), upgrade on evidence
- Effort parameter before model switch
- Route per step: Haiku for cheap steps, Opus/Sonnet for hard steps
- Cost per completed TASK, not per token
- Latency-critical + simple = Haiku; regulated/high-stakes = Opus; everything else = Sonnet
- Model version pinning: pin versions, monitor deprecation, keep runbook, every swap re-runs eval
Price Ladder (MEMORIZE)
| Model | Input/Output per MTok | Context |
|---|---|---|
| Haiku | $1 / $5 | 200k |
| Sonnet | $3 / $15 | 1M |
| Opus | $5 / $25 | 1M |
| Fable | $10 / $50 | 1M |
Output ≈ 5× input. Batch API = 50% off.
Context Strategies
| Strategy | When |
|---|---|
| Monolithic | Bounded tasks, predictable input |
| Progressive | Most production workloads — only what next step needs |
| Retrieval (RAG) | Large corpus, can't preload |
| Compaction | Long-running, context filling |
Budget rule: Don't budget the full context window. Budget for largest realistic conversation + retrieved context + system prompt + margin. Window is a ceiling, not a target.
Extended Thinking
- Separate block of thinking tokens before final answer
- Billed as output tokens, add latency
- Decision rule: Run evals without it first. Enable only when measured accuracy gap justifies cost
5.7 Prompt Caching — HIGHEST-YIELD COST OPTIMIZATION
Pricing Multipliers (MEMORIZE)
| Operation | Multiplier | Notes |
|---|---|---|
| 5-min cache WRITE | 1.25× | Pays off after ONE read |
| 1-hour cache WRITE | 2× | Pays off after two reads |
| Cache READ (hit) | 0.1× (10%) | The big saving |
| Default TTL | 5 min | Refreshed free on each hit |
Constraints
- Min cacheable: 1,024 tokens (Sonnet); 4,096 tokens (Opus, Haiku)
- Static content FIRST, dynamic content LAST — any change to prefix = cache miss
- Cache READ tokens do NOT count toward ITPM limits → multiplies effective throughput
- Stacks with Batch API 50% discount
- Consistency window: cached content can't reflect live state within TTL
5.8 Prompt Engineering
| Technique | When | Cost |
|---|---|---|
| Zero-shot | Default — well-specified tasks | Lowest |
| Few-shot | Format/judgment easier to show than describe | Medium |
| Chain-of-thought | Multi-step reasoning, interacting conditions | Highest |
| Structured outputs | Machine-readable pipelines, extraction | Eliminates parse failures |
Progression: Zero-shot → few-shot → CoT. Lightest technique that meets requirement.
System Prompt Structure (Enterprise)
- Role & scope 2. Constraints 3. Output contract
- Underspecification = gap the model fills with its own assumption, differently each time
- System prompt instructions are guidance, NOT enforcement — anything adversarial input can talk past needs a runtime control
5.9 Entry Points & Delivery Routes
| Route | When |
|---|---|
| Anthropic first-party | No cloud preference, want newest features |
| AWS Bedrock | Existing AWS enterprise agreement |
| GCP Vertex AI | GCP ML stack |
| Microsoft Foundry | Microsoft enterprise agreement, Azure footprint |
What doesn't change: Model behavior, prompting, eval, tool use, context window. What changes: Model identifiers, version strings, regional availability. CSP routes lag first-party API by weeks.
Regulated-Industry Constraints (Rule out BEFORE other tradeoffs!)
| Constraint | What Survives |
|---|---|
| Attorney-client privilege | API/SDK behind firm's own gateway |
| HIPAA (PHI) | API/SDK on BAA-covered config (BAA is per-configuration, not per-vendor) |
| GDPR / data residency | CSP route with region pinned + DPA |
| FedRAMP | Claude for Government, Bedrock GovCloud, Vertex Assured Workloads |
6. Enterprise Integration & Production
6.1 Evals as Acceptance Criteria
If you cannot write an eval for a behavior, you have no reliable way to measure whether that behavior is present.
Eval Workflow (5 Stages)
- Define task — behavior in measurable terms + prompt
- Build golden dataset — representative inputs INCLUDING edge cases, counterexamples, adversarial inputs
- Run automated checks — code-based pass/fail on unambiguous behaviors
- Score with judge — model-based rubric scoring for interpretive behaviors
- Interpret & act — aggregate + per-category breakdown
Three Eval Types
| Type | When | Cost |
|---|---|---|
| Code-based | Unambiguous behaviors (schema, regex, exact match) | Very low |
| Model-based | Tone, reasoning, safety, ambiguous inputs | Medium-high |
| Human-review | High-stakes, novel, safety-critical | Highest |
Grading Ladder (Cheapest Reliable First)
- Code-based → 2. LLM-as-judge (calibrated, different model than evaluated) → 3. Human grading
Judge calibration: Uncalibrated judge = confident scores with no validated link to quality = worse than no automated grade. Favor volume over perfection.
Evals as Gate for Every Change
- Every change (model swap, prompt revision, retrieval config) runs through eval suite
- Eval suite must be kept current — out-of-date eval = false confidence
- Highest risk moment: evals present but out of date
- Manual spot-checks ≠ eval substitute
6.2 POC to Production — Four Dimensions Where POC Misleads
| Dimension | POC | Production Reality |
|---|---|---|
| Cost | 10-50 req/day = negligible | Billing exceeds budget |
| Latency | One request at a time | p95 under concurrent load ≠ median |
| Reliability | No retry, no fallback | Any transient failure takes down workflow |
| Failure modes | Expected inputs only | Silent degradation on edge cases |
Reliability Controls
| Control | What | Where |
|---|---|---|
| Exponential backoff | Retry with growing delays on transient errors (429, 5xx) | Close to API call |
| Fallback chains | Route to alternative model/endpoint | Orchestration layer |
| Circuit breaker | Trip on error-rate threshold; fail fast | Service boundary |
Build reliability from the start — retrofitting is much harder.
Failure Modes by Architecture
| Architecture | What Breaks First | Mitigation |
|---|---|---|
| Agent | Unbounded tool use, growing context | Per-turn budgets, max tool calls, stopping criteria |
| RAG | Retrieval quality drift | Keep retrieval quality in eval loop, monitor precision/recall |
| Document pipeline | No exception path for low-confidence | Confidence scoring → human review queue |
| Orchestrator-workers | Blurred failure boundaries, dropped subagent | Shared trace ID, coverage check at synthesis |
6.3 Use-Case Sizing & Feasibility
Scoping Sequence
- Business requirement → capability list
- Capability list → architecture sketch (Claude / systems / humans)
- Architecture sketch → boundary conditions
- Boundary conditions → scope in SOW
Three Feasibility Verdicts
- Feasible as scoped — all properties favor, cost within ceiling, latency within SLA
- Feasible with constraints — works under conditions (doc-length threshold, refresh schedule, human review gate)
- Not feasible — property limitation can't be compensated; name disqualifying constraint + scope reduction that would change verdict
ROI Mapping (4 Steps)
- Baseline from operational data, NOT intuition
- Post-deployment state in same unit — include human review cost
- Subtract run cost — value = operational gain minus recurring run cost
- Payback period + sensitivity — what if volume doubles / distribution shifts?
Common ROI Errors
- Baseline estimated rather than measured → finance team rejects
- Projection assumes full automation when design requires human review → actual hours don't fall
- Run cost from average not distribution → understates cost on heavy-tailed inputs
6.4 Enterprise Integration — Five Layers (Compliance First!)
| Layer | What Breaks When Wrong |
|---|---|
| Compliance | Built on route that fails legal/security review |
| Identity & SSO | Claude can't scope responses to authorized data |
| Authorization & policy | Users access unauthorized data through unguarded path |
| Data handling & PII | PII in plaintext in request logs |
| Observability & audit | No evidence after incident |
Identity & Authorization Rules
- Identity verified server-side, BEFORE Claude call — inject role + authorized data into system prompt
- Never trust user-asserted identity — "As a senior manager..." in user message is fakeable
- Authorization is deterministic — allowlist + identity + scope before ANY side-effecting tool call
- Context window is NOT a data-governance boundary
- Multi-tenant = separate API keys per tenant
Observability — Four Things to Log
- Request: model version, input token count, prompt identifier
- Response: output token count, latency, stop reason
- Context: user role, session ID, caching applied?
- Outcome: did downstream system accept output?
An action taken but not logged = an action that cannot be allowed.
Least-Privilege Tool Configuration
- Every tool = attack surface + cost
- If a role doesn't need a capability, REMOVE it — don't log it, don't guard it, don't confirm it
- In orchestrator-worker: scope each subagent's tools to ITS task only
6.5 A/B Testing & Observability
Four Required Components (any missing = not an experiment)
- Hypothesis — specific, falsifiable, names treatment + metric + threshold
- Random assignment — consistent per user/session
- Primary metric fixed BEFORE the run
- Sample size calculated — LLM output variance > deterministic systems → need MORE samples
Shadow testing: Run new version in parallel, serve current to all users, score offline. Use when single bad output too risky or regulated.
Observability at Scale (4 Layers)
- Request-level tracing — model, version, tokens, latency, stop reason, tool calls
- Metric aggregation — cost/request, p50/p95, task success rate, error rate
- Anomaly detection — threshold alerts + distribution comparison for drift
- Change attribution — model drift vs data drift vs model-update effects
Failure Taxonomy
| Failure | Fix |
|---|---|
| Prompt failure | Fix the PROMPT, not the model |
| Hallucination | Grounding: retrieval, tool use, verification |
| Model mismatch | Model selection gated by eval |
| Retrieval failure | Re-index, embedding consistency, chunk boundaries |
| Context failure | Reduce context, reorder (head/tail), progressive discovery |
| Orchestration failure | Shared trace ID, coverage check at synthesis |
Business Translation Layer
Map task-success → first-contact-resolution, latency → handle-time. Build at design time — funders read KPI dashboards, not traces.
6.6 MCP Essentials
- Architecture: Host → client per server → server exposes capabilities. JSON-RPC 2.0
- Three primitives: Tools (model-controlled) / Resources (app-controlled) / Prompts (user-controlled)
- Transports: stdio (local) | Streamable HTTP (remote, OAuth 2.1)
- Dynamic discovery: tools discovered at runtime
| Mechanism | Choose When |
|---|---|
| MCP | Standardized tools reused across multiple clients |
| Direct API / SDK | Full control, single integration |
| CLI | Developer-workflow tasks |
| Agent-to-agent | Delegating subtasks to peer agent (add trace IDs + contracts) |
6.7 Cost-Performance Optimization (Ordered Levers)
- Prompt caching — static prefix first (reads at 10%)
- Model tiering — Haiku for cheap steps, Sonnet default, Opus only where evals prove needed
- Effort parameter — dial within model before switching
- Batch API — 50% off for async; stacks with caching
- Output-length control — output ≈ 5× input price
- Retrieval top-k tuning — enough for recall, no more
- Token-distribution modeling — plan for heavy tail
- Per-turn budgets + stopping criteria on agents
7. Responsible AI, Safety & Risk
7.1 The Safety Stack — Four Layers
| Layer | Covers | Blind Spot | Owner |
|---|---|---|---|
| Trained behavior | Broad harm classes, every request | YOUR domain policy, data rules, auth model | Anthropic |
| System-prompt instruction | Role, tone, constraints | Adversarial inputs — guidance ≠ enforcement | Architect |
| Runtime screening | Input/output content detection | Side-effecting actions; novel attacks | Architect |
| Authorization | Whether caller may take action in context | Content quality, fairness | Architect |
Most common safety failure: Assuming Claude enforces a rule it was never given. Claude cannot enforce a rule it was never given.
7.2 Five Risk Categories
| Risk | Description |
|---|---|
| Direct prompt injection | User input overrides system instructions |
| Indirect prompt injection | Malicious instructions via retrieved content or tool outputs. Dominant enterprise vector — input screening doesn't catch |
| Token-budget exhaustion | Oversized/padded inputs consume budget |
| Tool and action abuse | Model induced to call side-effecting tool outside policy |
| Data exposure | Sensitive fields land in context windows or logs |
7.3 Three Control Points
| Control Point | When | Deterministic Check |
|---|---|---|
| Input screening | Before model call | Blocklist, regex, length/format |
| Output screening | Before response reaches user | Known strings, forbidden fields, schema |
| Tool-call authorization | Before ANY side effect | Allowlist + identity + scope (almost always deterministic) |
- No single control catches everything → deploy in series
- Fail closed for safety controls — fail open = illusion of protection
- Output screening judges TEXT, not ACTIONS — a side-effecting tool needs authorization before it runs
7.4 Fairness — Four Injection Points
| Injection Point | How Skew Enters |
|---|---|
| Retrieval corpus | Over/under-represents groups |
| Prompt framing | Encodes assumptions pushing outcomes |
| Few-shot examples | Carry corpus skew |
| Downstream routing | Different groups routed differently |
Fairness is an architectural property you instrument, not a model attribute you assume.
Decision Logging
Capture: inputs, retrieved context, model output, routing — keyed for replay. Three audiences: affected user (actionable explanation), regulator (consistency evidence), build team (full trace).
7.5 Review Routing — By Stakes, Not Volume
Route to a person when: low-confidence AND (irreversible OR high-cost) Let through: confident, reversible, low-cost
When variables conflict, cost and reversibility win. Confidence sets volume.
| Placement | Gives | Costs |
|---|---|---|
| Pre-action approval | Nothing irreversible unreviewed | Latency, doesn't scale |
| Post-action audit | Throughput high | Wrong action already landed |
| Sampled review | Quality monitoring | Bad decisions slip through |
Reviewer must see 3 things: inputs, output, reason it was flagged. Consent fatigue: Routing everything → reviewers click-approve → review collapses. Anthropic pattern: plan-level review, not per-step.
7.6 Compliance — Obligations to Controls with Evidence
Each obligation must become three things:
- Specific technical control
- Named owner
- Evidence artifact (signed agreement, config screen, authorization record, returned log query)
A control named in a design document with no owner and no artifact is a claim, not proof.
Training use ≠ retention — data may be excluded from training yet retained for logging/abuse-prevention/audit. Don't collapse these.
Compliance Map
| Constraint | Route | Key Notes |
|---|---|---|
| HIPAA | BAA-covered config ONLY | BAA is per-configuration; betas excluded; minimum-necessary PHI; server-side redaction |
| GDPR | Region-pinned CSP route | inference_geo supports "us"/"global" — EU pinning needs cloud route; includes logs and caches |
| FedRAMP | Authorized cloud only | Bedrock GovCloud, Vertex Assured Workloads; level set by workload |
| Privilege | API behind firm's gateway | Firm owns audit trail end-to-end |
8. Stakeholder Engagement, Lifecycle & GTM
8.1 Discovery — Structured Elicitation
Discovery is structured elicitation, not conversation. Three-step filter: Listen → Translate → Write down.
Four Questions
| Question | What It Captures |
|---|---|
| Must DO | Capabilities as business outcomes; split Claude / systems / humans |
| Must NOT do | Boundaries, prohibited actions, route-to-human cases (ASK — stakeholders don't volunteer) |
| Must COST | Latency target, per-interaction ceiling, volume forecast |
| Must PROVE | Evidence/audit obligations (find in discovery, not legal review) |
Translation Table
| Stakeholder Statement | Implied Constraint | Architectural Decision | Assumption |
|---|---|---|---|
| "Seamless" | Latency budget, graceful failure | Set p95 target, safe failure state | Confirm "seamless" = responsiveness + continuity |
| "Clinicians will review anyway" | Licensed human must authorize | Human-in-the-loop as mandatory gate | Confirm authority and timing |
| "Be careful with data" | Privacy proof obligation | Audit-trail as core requirement | Confirm with compliance |
Requirement vs assumption: Requirement traces to what stakeholder SAID. Unsourced assumption = most dangerous — nobody remembers deciding it.
Killer anti-pattern: Proposing architecture sketch mid-call. Plausibility ENDS the questions. Finish all four categories before proposing anything.
8.2 Tradeoffs & GTM
Three Elements (+1 Regulated)
- What do we GAIN?
- What do we GIVE UP?
- What does REVERSAL cost? ← most skipped, most often changes the meeting
- (Regulated) Compliance posture?
Reversal cost turns "what is the better technical answer?" into "what is the better business choice?"
Demo Design
| Capabilities Demo | Scenario-Specific Demo | |
|---|---|---|
| Answers | "What can this do?" | "What does this do with MY problem?" |
| Creates | Interest | Confidence |
Limit placement: Decide in advance which 1-2 limitations to name, frame as intentional scope boundaries. Buyer discovering mid-demo drops confidence; naming early reads as discipline.
Three Objection Categories
| Category | Response |
|---|---|
| Capability | Demonstrate capability |
| Governance & compliance | Show controls and evidence artifacts |
| Design-choice | Explain tradeoff + what alternative would have cost |
8.3 Feedback Loops & SLA
Feedback Loop = Decision Layer Above Observability
Five stages: Signals → Triage → Decide → Act → Review
Monitoring collects signals; feedback loop maps each signal to trigger + owner + action. A dashboard without that mapping = the eval-drift-for-12-weeks story.
SLA Names Three Things
- What's measured? 2. What counts as breach? 3. What happens on breach?
Thresholds trace to tangible sources: latency ← UX expectation; availability ← business criticality; quality ← eval acceptance criteria. Untraceable = arbitrary.
Cost Is the Expectation That Breaks Most
- Production volume = 1-2 orders of magnitude above pilot
- Pre-empt: consumption forecast at production volume + spend-control posture BEFORE first invoice
Governance Table (Before Launch)
| Signal | Trigger | Action | Regulated Checkpoint |
|---|---|---|---|
| Output quality | Score crosses threshold | Diagnose drift, iterate vs re-architect | Periodic output audit on schedule |
| Latency p95 | Crosses UX budget | Investigate bottleneck | Usually none |
| Cost/interaction | Crosses budget | Identify driver, bring tradeoff to stakeholder | Usually none |
| Data-residency | Scheduled confirmation | Confirm posture, flag drift | Residency confirmation on schedule |
Regulated reviews fire on a SCHEDULE, not a threshold.
8.4 Documentation — Handoff & Audit
Three Readers
| Reader | What They Need |
|---|---|
| Handoff recipient | Decisions + REJECTED alternatives + why each was rejected |
| Compliance reviewer | Each obligation → control → owner → evidence artifact |
| Returning architect | Dated decisions, labeled assumptions, owned open items |
Completeness Test
Can a competent Architect who was not in the room make a safe change after reading the document?
Why Rejected Alternatives Matter
Without them, a successor reverses the right decision for an understandable wrong reason — the financial-services postmortem: replacement switched context strategy to fix performance, reintroduced data-handling pattern violating residency. The diagram carried WHAT; the WHY left with the architect.
8.5 Outcome Document (6 Fields)
- Use case with scope boundary
- Metric BEFORE
- Metric AFTER (same definition)
- Auditable control (what makes comparison provable)
- Measurement owner
- Reuse potential
Volume, latency, and error rate are not business outcomes. Only before/after on the business metric proves what it's WORTH.
8.6 Deployment Lifecycle
Discovery → Design → Handoff → Monitoring → Iteration
Phase transitions are GATED by artifacts (e.g., outcome document gates expansion decision).
9. Team Enablement & Operational Productivity
9.1 Team Setup — Four Decisions
| Decision | Key Consideration |
|---|---|
| Environment | Shared baseline: CLAUDE.md, agreed tools/MCP, permission posture — versioned, reviewed |
| Rollout | Champions first, then batches — NOT all-hands switch-on |
| Skills distribution | Four mechanisms (see below) |
| Spend posture | Model defaults, allowlists, effort guidance, spend/rate/per-user caps — BEFORE first bill |
Champion-and-Batch Rollout
- Champion per department — proves workflow, absorbs friction, builds local examples
- Batch rollout — champion runs sessions for peers
- Broad rollout — every department has working example, local expert, tuned config
Four Skills Distribution Mechanisms
| Mechanism | Access | Versioning/Rollback | When |
|---|---|---|---|
| Org-provisioned Skill | Everyone in org | NO versioning/rollback | Capability needed by all, no governance |
| Plugin | Group/org targeting | Version-controlled, rollback | Scoped distribution with governance |
| Claude Code project Skills | Scoped to projects | Version with repository | Coding conventions for one team |
| API Skills | Programmatic | Explicit version pinning | Partner products calling programmatically |
Classic failure: Skill shipped with no way back — one bad edit → wrong format across every team. When shared asset needs versioning/rollback → use org-managed plugin.
9.2 Dev Workflows
- AI tooling pays off when it lives inside the existing workflow (editor, review, test loop), not a side chat window
- Two failure modes: lumpy adoption (few heavy users, rest don't use → fix with champion/batch) and stalling at basic chat (Q&A box, never reaches tool use → access ≠ adoption)
Verification Checklist (Four Dimensions — Gates Before Production)
| Dimension | Check |
|---|---|
| Correctness | Tests exist and pass; behavior matches requirement incl. edge cases |
| Security | No secrets, inputs validated, least-privilege calls |
| Maintainability | Reads clearly, follows conventions, no unexplained complexity |
| Human understanding | Developer can EXPLAIN what it does and why, including untested inputs |
Judgment erosion: Green tests ≠ understanding. If author can't explain it, HOLD the merge.
9.3 Operational Support
Support = Translation, Not Firefighting
- Team reports symptom → architect connects to architecture cause → teaches the path
- Firefighting fixes one incident; a runbook entry fixes the class
Symptom → Cause Quick Map
| Symptom | Likely Architecture Cause |
|---|---|
| Latency spike | Model tier mismatch, output length, context saturation |
| Output quality degradation (no code change) | Model/prompt drift, retrieval drift (corpus grew, index didn't keep pace) |
| Tool started failing | Tool API change, permission/scope issue, circuit breaker tripped |
| Cost spike | Volume increase, model tier escalation, caching not applied |
Self-Sufficiency Artifacts
- Runbook: captured symptom→cause→action paths — team resolves without Architect
- Escalation path: named definition of who handles what and when
- Goal: Team needs you only for NEW problems, not ones you've already taught them
10. Architecture Decision Frameworks
10.1 The Universal Decision Flow
1. Governance constraints → rule out entry points/routes BEFORE anything else
2. Decomposition → Claude / existing systems / humans
3. Pattern → augmented LLM / workflow / agent (simplest that works)
4. Reference architecture → don't invent; combine only when parts break differently
5. Model → start Sonnet, every swap = release gated by eval
6. Context strategy → progressive for production; budget for realistic, not ceiling
7. Entry point → by the work, not by what's on the shelf
10.2 Architecture Pattern Selection (7 Patterns)
| Pattern | When | Failure Mode |
|---|---|---|
| Augmented LLM | Single well-defined task | Capability ceiling |
| Workflow (chaining) | Predictable multi-step, known decomposition | Rigidity |
| Routing | Distinct input categories | Misclassification cascades |
| Parallelization | Independent subtasks | Aggregation complexity |
| Orchestrator-workers | Unpredictable subtask structure | Blurred failure boundaries |
| Evaluator-optimizer | Clear eval criteria + iterative refinement | Loop cost; no exception path |
| Agent | Open-ended, unpredictable step count | Unbounded tool use, runaway cost |
Rule: Use the simplest pattern that meets the requirement. Every added layer = cost + latency + failure surface.
10.3 Workflow vs Agent Discriminators
| Discriminator | Workflow | Agent |
|---|---|---|
| Task structure | Known, decomposable in advance | Unknown, emerges at runtime |
| Step count | Fixed/bounded | Variable/open-ended |
| Auditability | High (deterministic path) | Lower, gated by checkpoints |
| Cost predictability | Per-request known | Needs budgets, turn limits |
| Error containment | Isolated per step | Needs guardrails |
10.4 Feasibility Assessment (Four AI Properties)
| Property | Question | Compensation |
|---|---|---|
| Next-token prediction | Are instructions specific, concrete, verifiable? | Explicit schemas, structured outputs, code execution |
| Knowledge | Is needed knowledge in training or external? | RAG, tool use, MCP |
| Working memory | Does input fit? Is corpus too large? | Chunking, progressive context, retrieval |
| Steerability | Can task be precisely instructed? | Structured outputs, code execution |
10.5 RAG vs Tool Use Decision
| Need | Use |
|---|---|
| Stable knowledge (was true yesterday, will be tomorrow) | RAG (retrieval from indexed corpus) |
| Live state (current value owned by a system) | Tool call to system of record |
| Exact terms, IDs, error codes | Hybrid search (BM25 + dense + RRF) |
| Relationship questions ("how does X affect Y and Z") | Graph RAG |
| Complex multi-step queries | Agentic RAG |
10.6 Cost Optimization Decision Tree
Is system prompt long and stable? → Prompt caching (biggest lever)
Can steps use cheaper model? → Model tiering (Haiku for extraction, Sonnet/Opus for reasoning)
Need to tune within model? → Effort parameter
Async workload? → Batch API (50% off, stacks with caching)
Output too long? → Structured outputs, max_tokens budgets
Retrieval over-fetching? → Top-k tuning
Cost model from averages? → Switch to distribution modeling
Agent loops unbounded? → Per-turn budgets + stopping criteria
10.7 Safety Design Checklist
- Drew boundary between trained behavior and application layer?
- Every deployment-specific rule encoded in application layer (not assumed)?
- Three control points: input screening, output screening, tool-call authorization?
- Model-based and deterministic checks chained in series?
- Fail closed for safety controls?
- Indirect injection covered (screen retrieved content and tool outputs)?
- Tool-call authorization BEFORE action executes (not after)?
- Every blocked/failed gate logged?
10.8 Human-in-the-Loop Design
Is decision low-confidence AND (irreversible OR high-cost)? → Route to human
Is decision confident, reversible, low-cost? → Let through
When variables conflict → cost and reversibility win; confidence sets volume
Placement: pre-action (irreversible) / post-action (reversible) / sampled (monitoring)
Reviewer sees: inputs + output + flag reason (missing any = rubber-stamping)
Avoid consent fatigue: plan-level review, not per-step
10.9 12 Scenario Drill Patterns (Pre-Solve These)
- Over-privileged agent → remove unneeded tools (never log/confirm/upgrade-model)
- Repeated static prompt + cost/latency pressure → static-first + prompt caching
- Confident-wrong after corpus refresh → retrieval/indexing first (re-index, embedding consistency)
- Gradual drift, dashboards green, no code change → retrieval/model/prompt drift; missing feedback-loop trigger
- Exact-term queries failing in RAG → hybrid BM25+dense with RRF; add reranker for precision
- User claims a role in the message → server-side identity injection; never user-asserted
- Refund/side-effect executed before checks → deterministic tool-call authorization BEFORE execution
- Guardrail service erroring under load → fail closed for safety controls
- 50-session A/B "winner" → underpowered + uncontrolled distribution + no pre-specified metric = noise
- Reviewer queue of 400 with approve-button only → route by stakes; show inputs+output+flag reason
- HIPAA route selection → BAA per-configuration; betas excluded; minimum-necessary PHI
- POC → production sizing → volume × token DISTRIBUTION × tier; p95 not median; backoff+fallback+breaker from day one
11. Interview Q&A Quick Reference
Q: Explain transformer architecture at a high level
A: Transformers process input tokens in parallel (not sequentially like RNNs). Core mechanism is self-attention — each token attends to all other tokens, computing weighted relationships. Multi-head attention captures different relationship types simultaneously. Positional encoding adds sequence order. Feed-forward networks transform representations. The model predicts the next token by assigning probabilities across vocabulary. This architecture enables long-range dependencies and parallel training, which is why it scaled where RNNs/LSTMs couldn't.
Q: Fine-tuning vs RAG vs prompt engineering — when to use which?
A:
- Prompt engineering: First, always. Cheapest, fastest, most reversible. Zero-shot → few-shot → CoT
- RAG: When the model needs knowledge it doesn't have (proprietary docs, recent data, domain-specific). No model weight changes. Grounds answers in retrievable sources. Best for enterprise knowledge bases
- Fine-tuning: Last resort. When you need the model to consistently follow a specific format, style, or behavior pattern that prompting can't reliably achieve. Changes model weights. Expensive, requires data, harder to iterate. Doesn't solve knowledge gaps — it shapes behavior
Key trade-off: RAG = knowledge problem. Fine-tuning = behavior/format problem. Prompt engineering = both, try first.
Q: Design a multi-tenant RAG system with fallback mechanisms
A:
- Vector DB: Per-tenant collections/namespaces with RBAC. Metadata filtering at retrieval layer for ACL scoping
- Embedding pipeline: Jenkins CI/CD for ingestion → chunking → embedding → storage. Same embedding model for indexing and querying
- Retrieval: Hybrid search (BM25 + dense + RRF) for precision. Cross-encoder reranker for high-stakes queries
- Fallback chain: Primary model (Sonnet) → fallback (Haiku) for latency spikes → cached response for API failures
- Multi-tenancy: Separate API keys per tenant for attribution and isolation. IAM boundaries, VPC isolation
- Reliability: Exponential backoff on 429/5xx. Circuit breaker at service boundary. Fallback chain in orchestration layer
- Monitoring: Query latency, recall@k, index size, cost per tenant, retrieval quality in eval loop
- Cost: Prompt caching for stable system prompts. Adaptive RAG routing. Batch API for async workloads
Q: Vector database trade-offs (Pinecone vs OpenSearch vs pgvector)
A:
- Pinecone: Fully managed, auto-scaling, no infra to manage. Best when you want production without ops overhead. Cost scales with usage
- OpenSearch (AWS): AWS-native, integrates with existing AWS infra. Hybrid search support. More control but more operational burden. Good when already on AWS
- pgvector (PostgreSQL extension): Simplest if already running Postgres. Good for prototyping and moderate scale. No separate infrastructure. Best when vector search is secondary to relational queries
Trade-off triangle: Retrieval quality ↔ Latency ↔ Maintenance.
Q: Monitoring/observability for ML in production
A:
- Four layers: Request-level tracing → Metric aggregation → Anomaly detection → Change attribution
- Drift detection: Monitor retrieval precision/recall over time. Corpus grows without reindexing = retrieval drift. Model behavior changes on stable inputs = model drift. Input distribution changes = data drift
- SLOs for ML: Latency p95, task success rate, hallucination rate, cost per interaction. Error budgets apply
- Business translation layer: Map task-success → first-contact-resolution, latency → handle-time. Build at design time
- Feedback loop: Signals → Triage → Decide → Act → Review. Dashboard collects; feedback loop maps each signal to trigger + owner + action
Q: Design cost-optimized inference infrastructure on AWS
A:
- Model serving: EKS with GPU autoscaling using KServe or Seldon Core. Scale to zero for low-traffic
- Model tiering: Haiku for classification/extraction, Sonnet for general, Opus only where evals prove needed
- Prompt caching: Static system prompts cached. Cache reads at 10% of input rate. Static content first, dynamic last
- Batch API: 50% discount for async workloads. Stacks with caching
- Output control: Structured outputs, max_tokens budgets. Output ≈ 5× input price
- Token distribution modeling: Plan for heavy tail, not average. Average-based models underestimate by 2-3×
- Adaptive RAG: Skip retrieval for simple queries
- FinOps: Right-size instances, spot for batch, caching frequent queries, index optimization
- Per-turn budgets + stopping criteria on agents — unbounded loops = #1 cost failure
Q: Guardrail design and retrieval quality metrics
A:
- Guardrails: Three control points — input screening, output screening, tool-call authorization. Chain model-based and deterministic in series. Fail closed for safety. Screen retrieved content and tool outputs for indirect injection
- Retrieval quality metrics: Precision@k, recall@k, MRR (mean reciprocal rank), NDCG. Keep in eval loop. Monitor for drift when corpus changes
- Human-in-the-loop: Route by stakes (confidence × reversibility × cost), not volume. Reviewer sees inputs + output + flag reason
Q: How would you approach a stakeholder who says "we want AI in our product"?
A:
- Don't propose a solution. Run structured discovery: Must DO, Must NOT do, Must COST, Must PROVE
- Translate preferences into constraints. "Seamless" → p95 latency target, graceful failure path
- Decompose: What Claude owns / existing systems own / humans own
- Run feasibility through four AI properties
- Present tradeoffs with three elements: gain, give up, reversal cost
- Size the cost model before code: volume × token distribution × tier. Plan for heavy tail
- Name limitations upfront — frame as intentional scope boundaries
Q: What's the difference between a workflow and an agent?
A:
- Workflow: Fixed sequence of LLM calls. Predictable, auditable, cost-known per request. Use when you could write the steps in code
- Agent: Model plans, acts via tools, observes results, iterates in a loop. Open-ended, variable step count. Needs guardrails: max tool calls, token budgets, stopping criteria
- Decision rule: If you could have written the steps in code, use a workflow. Don't choose an agent because the task "feels" open-ended
Q: How do you handle model version updates in production?
A:
- Pin model versions in configuration
- Monitor deprecation page
- Maintain version-update runbook
- Every model swap re-runs the eval suite — treat it as a release
- Never let versions roll forward silently
- Fallback chains: Primary → alternative model → cached response
Q: Walk me through the safety stack for an AI deployment
A: Four layers, each covering a different part of the request path:
- Trained behavior (Anthropic): Broad harm classes, every request. Does NOT know your domain policy
- System-prompt instruction (Architect): Role, tone, constraints. Guidance, NOT enforcement
- Runtime screening (Architect): Input screening, output screening. Chain model-based + deterministic
- Authorization (Architect): Whether this caller may take this action. Deterministic, auditable, BEFORE action executes
Key principle: Claude cannot enforce a rule it was never given. The dangerous failure is silent — assuming Claude enforces a rule that doesn't live in any layer.
Q: How do you design evals for an LLM system?
A:
- Write eval suite BEFORE production code
- Build golden dataset from REAL input population, including edge cases, counterexamples, adversarial inputs
- Grading ladder: Code-based (cheapest) → LLM-as-judge (calibrated, different model) → Human review (last resort)
- Set threshold from business requirement, not prototype performance
- Eval = gate for every change: model swap, prompt revision, retrieval config
- Keep eval suite current — out-of-date eval = false confidence
- Multi-turn evals = separate category scoring full conversation sequences
Q: Explain data flywheel and reinforcement learning loops
A:
- Data flywheel: System generates data through usage → data improves model → better model attracts more usage → more data. Key: capture user feedback (thumbs up/down, corrections, acceptance/rejection signals) and feed back into training/eval data
- RL loops (RLHF): Human preferences on model outputs → reward model → policy optimization → improved model. In production: user feedback acts as implicit reward signal. Must be careful about reward hacking and distribution shift
- Practical implementation: Log every interaction + outcome. Periodically retrain/fine-tune on high-quality interactions. Keep eval suite current to catch regressions. Automated rollback on metric degradation
12. Stakeholder Meeting Cheat Sheet
Before the Meeting
- Run structured discovery (4 questions: Must DO, Must NOT do, Must COST, Must PROVE)
- Translate preferences into constraints (write translation table)
- Identify assumptions vs requirements (trace each to stakeholder statement)
- Size the cost model (volume × token distribution × tier)
- Prepare tradeoff presentation (gain, give up, reversal cost)
- Prepare demo with buyer's data shape (scenario-specific, not capabilities)
- Decide which 1-2 limitations to name upfront (frame as scope boundaries)
During the Meeting
- Don't propose architecture mid-discovery — plausibility ends questions
- Lead with business outcome, not technical implementation
- Present tradeoffs as a package, not a verdict: options, criteria, recommendation, residual risks
- Name reversal cost — "what does it cost to undo after the system is built around it?"
- Frame limitations honestly — upfront, clearly scoped boundary signals rigor
- Hand them peer-proof justification — stakeholder must be able to defend to THEIR leadership
Handling Objections
| Objection Type | Response |
|---|---|
| Capability ("Can it do X?") | Demonstrate capability with scenario-specific demo |
| Governance ("Can we trust it?") | Show controls, evidence artifacts, audit trail |
| Design-choice ("Why this approach?") | Explain tradeoff + what alternative would have cost |
After the Meeting
- Write translation table (statement as said | implied constraint | architectural decision | assumption)
- Document decisions with rejected alternatives and tradeoff rationale
- Capture before-metric AT THE START (for outcome document)
- Create governance table (signal → trigger → action → regulated checkpoint)
- Define SLA (what's measured, what counts as breach, what happens on breach)
Cost Conversation Framing
- Give consumption forecast at production volume (1-2 orders of magnitude above pilot)
- Name spend-control posture: caching, model tiering, budget alerts
- Frame model-tiering narrative before first invoice
- Use token DISTRIBUTION, not average (heavy tail = 2-3× underestimate)
Compliance Conversation Framing
- Each obligation → specific technical control + named owner + evidence artifact
- BAA is per-configuration, not per-vendor (HIPAA)
- Training use ≠ retention (don't collapse)
- Regulated reviews fire on a SCHEDULE, not a threshold
- Control register = audit currency (not narrative assertions)
13. Weekly Review Checklist
Week 1: Core Concepts & RAG
- Four AI properties (next-token prediction, knowledge, working memory, steerability)
- RAG architecture: ingestion → chunking → embedding → vector DB → retrieval → generation
- 10 RAG patterns (Simple, Memory, Branched, HyDE, Adaptive, Corrective, Self, Agentic, Multimodal, Graph)
- Chunking strategies (Fixed, Recursive, Semantic, Layout-aware, Parent-child)
- Retrieval strategies (Dense, Hybrid BM25+RRF, Reranker, HyDE, Multi-Query)
- RAG failure diagnosis (confident-wrong after refresh, gradual drift, exact-term failures)
Week 2: Vector Databases & Agents
- Vector DB selection (Chroma, Qdrant, Pinecone, Weaviate, OpenSearch)
- Indexing concepts (ANN, HNSW, IVF, distance metrics, metadata filtering)
- Agent components (Brain, Tools, Memory, Planning)
- Autonomy spectrum (L0-L3)
- Four agentic patterns (ReAct, Reflection, Plan-Execute, Multi-Agent)
- Seven primitives (Tools, MCP, Subagents, Hooks, Skills, Agent Teams, Dynamic Workflows)
- Production considerations (autonomy vs risk, observability, cost, guardrails)
Week 3: Claude Platform & Enterprise Integration
- Four key decisions (Decomposition, Pattern, Reference Architecture, Entry Point)
- Three layers (Entry Points, Build-time interfaces, Delivery routes)
- Pattern selection (Augmented LLM, Workflow, Agent) + 5-factor framework
- Model selection rules + price ladder (Haiku $1/$5 → Sonnet $3/$15 → Opus $5/$25 → Fable $10/$50)
- Prompt caching multipliers (1.25× write, 2× 1hr write, 0.1× read, 5-min TTL)
- Context strategies (Monolithic, Progressive, Retrieval, Compaction)
- Evals as acceptance criteria (5-stage workflow, 3 types, grading ladder)
- POC to production (4 dimensions: cost, latency, reliability, failure modes)
- Enterprise integration 5 layers (compliance first)
- MCP essentials (host-client-server, 3 primitives, transports)
- Cost-performance optimization (8 ordered levers)
Week 4: Safety, Stakeholder & Operations
- Safety stack (4 layers, who owns what)
- Five risk categories (direct injection, indirect injection, token exhaustion, tool abuse, data exposure)
- Three control points (input, output, tool-call authorization)
- Fail closed for safety controls
- Fairness (4 injection points, decision logging, 3 audiences)
- Review routing (by stakes not volume: confidence × reversibility × cost)
- Compliance (control + owner + evidence artifact; BAA per-config; training ≠ retention)
- Discovery (4 questions, translation table, requirement vs assumption)
- Tradeoffs (3 elements + reversal cost)
- Feedback loops (Signals → Triage → Decide → Act → Review)
- SLA (3 namings, traceable thresholds)
- Governance table (before launch; regulated reviews on schedule)
- Documentation (3 readers, completeness test, rejected alternatives)
- Outcome document (6 fields)
- Team setup (4 decisions, champion-and-batch, 4 skills distribution mechanisms)
- Verification checklist (correctness, security, maintainability, human understanding)
- Symptom → cause quick map
Monthly: Full Review
- Re-read all 12 scenario drill patterns (section 10.9)
- Re-read all interview Q&A (section 11)
- Re-read stakeholder meeting cheat sheet (section 12)
- Verify model lineup and caching specifics at platform.claude.com (models/prices change)
- Review architecture decision frameworks (section 10) end-to-end
- Self-test: Can you explain each concept without looking?
Key Numbers to Memorize Cold
| Fact | Value |
|---|---|
| Cache write (5-min) | 1.25× base input |
| Cache write (1-hour) | 2× base input |
| Cache read (hit) | 0.1× (10%) base input |
| Cache TTL | 5 min default (free refresh on hit) |
| Min cacheable | 1,024 tokens (Sonnet), 4,096 (Opus/Haiku) |
| Max cache breakpoints | 4 explicit |
| Price ladder | Haiku $1/$5 → Sonnet $3/$15 → Opus $5/$25 → Fable $10/$50 |
| Output vs input | ≈ 5× at every tier |
| Batch API | 50% off |
| Context window | 1M (Opus/Sonnet/Fable), 200k (Haiku) |
| Max output | 128k (Opus/Sonnet/Fable), 64k (Haiku) |
| Token approximation | ~1 token ≈ 0.75 English words |
| Cost underestimate factor | 2-3× when using averages instead of distribution |
Notes compiled from: ai-agent.md, ai-engineering.md, cert.md, rag.md, vectordb.md, CCA-P module notes (Claude Platform, Enterprise Integration, Responsible AI, Stakeholder Engagement, Team Enablement), CCAR-P Master Prep Guide, and Combined Glossary. Verify model lineup and pricing at platform.claude.com before exams or production decisions.