Agentic AI

Agentic AI - from Agents, Design Patterns, RAG, and Memory to Evals, Security, and System Design

Chapters

  1. 01
    What Is an AI Agent?

    Agent = Model + Harness, and Agency ≠ Authority

    15 min read
  2. 02
    Levels of Automation

    Autonomy is a dial, not a switch: set a level per decision, and justify it

    14 min read
  3. 03
    Workflow Design Patterns

    When code picks the next step: six workflow shapes, and where they live in real agents

    10 min read
  4. 04
    Agentic Design Patterns

    When the model holds the pen: six agentic patterns, and the fence each one needs

    10 min read
  5. 05
    Retrieval-Augmented Generation

    Semantic Chunking, Sparse(BM25) & Dense retrieval, Reciprocal Rank Fusion, Cross Encoder (Reranking), and Hallucination Checks

    14 min read
  6. 06
    Type Safety, Loop Control & State

    Pydantic, Outlines, LMQL, Loop Control, and State Management

    12 min read
  7. 07
    Context Management

    6 Strategies: Offload, Reduce, Retrieve, Isolate, Cache, and Consolidate, 5 Failures: Poisoning, Clash, Confusion, Confusion, and Rot

    14 min read
  8. 08
    Memory Management

    Working memory, Long-term memory: Episodic, Semantic, and Procedural, and Dreams

    13 min read
  9. 09
    Hallucination Checks

    Check each claim against what the agent saw, not how sure it sounded: NLI, token confidence, and repair-trim-withhold

    11 min read
  10. 10
    LLM as a Judge

    A judge is an instrument: biases, Cohen's kappa, psychometrics, and why A-vs-B beats a score

    10 min read
  11. 11
    Agent Security Principles

    OWASP Top 10, PII redaction, Prompt injection, Content noderation, RBAC, and the Gatekeeper

    11 min read
  12. 12
    Evals

    Evaluating an AI Agent: Deterministic Checks, DeepEval, Promptfoo and an Eval harness

    11 min read
  13. 13
    Observability & Analytics

    Analytics Dashboard(Rill), Langsmith trace, and Logging

    10 min read
  14. 14
    Model Context Protocol

    MCP Server, Client and Ops Agent

    11 min read
  15. 15
    System Design Patterns

    Timeouts, Retries, Circuit Breakers, Bulkheads, Idempotency, Saga, Rate Limit, Dead Letter Queue, and Hedging

    12 min read
  16. 16
    Build vs Buy

    You can rent intelligence, you can't rent accountability: build, adopt, buy or partner, per component, with the arithmetic

    11 min read

This course includes

16 articles
3h 9m reading time
0 videos • coming soon

Course content

16 sections • 237 topics • Read: 3h 9m • Video: coming soon

What Is an AI Agent? 15 Topics, Read: 15 mins
Overview
Customer Support Agent
What Is an Agent?
Agent = Model + Harness
Agency Is Not Authority
The Agency Principle
Why Delegation Is Risky: Fiduciary Duty and Information Asymmetry
Four Standings of an Act
Where Authority Lives: The Gatekeeper
Delegation Has a Price: Agency Costs
The Agent as a Graph
Summary
Further Reading
Levels of Automation 14 Topics, Read: 14 mins
Overview
One Agent, Three Answers
Autonomy Is a Dial, Not a Switch
Sheridan's Ten Levels of Automation
Where the Human Sits
The Ironies of Automation
Function Allocation: Code, Model or Person?
Three Questions per Decision
Recording the Decision: The Autonomy Decision Record
Our Two Agents, and Where the Dial Lives
Summary
Further Reading
Workflow Design Patterns 17 Topics, Read: 10 mins
Overview
Who Decides the Next Step?
Sequential Pipeline
Conditional Branching
Parallel Fan-out / Fan-in
Map-Reduce
Iterative Loop with a Fixed Cap
Human-in-the-Loop
The Patterns in Real Agents
Summary
Further Reading
Agentic Design Patterns 18 Topics, Read: 10 mins
Overview
When the Model Holds the Pen
The Tool-Use Loop
ReAct: Reasoning and Acting
Reflection and Self-Critique
Evaluator–Optimizer
Planning and Decomposition
Orchestrator–Subagent
The Patterns in Real Agents
Every Loop Has a Fence
Summary
Further Reading
Retrieval-Augmented Generation 17 Topics, Read: 14 mins
Overview
The Model Doesn't Know Your Business
Weights and Index
An Analogy: The Reference Library
The Anatomy of a RAG Pipeline
Chunking: Where Meaning Changes
Sparse and Dense Retrieval
Combining Results: Reciprocal Rank Fusion
Reranking: Bi-Encoders vs Cross-Encoders
Retrieved Is Not Prompted
Generate, Then Ground
RAG as Semantic Memory
What Stays Out of the Index
How RAG Fails, and the Guards
Summary
Further Reading
Type Safety, Loop Control & State 9 Topics, Read: 12 mins
Overview
Type Safety: Validate After, or Constrain During?
Pydantic: The Schema Is the Code
Loop Control: One Governor, One Verdict
Duplicate Detection and Convergence
State: A Guardrail That Forgets Isn't One
The Run Lifecycle: Stop, Resume, Abort
Summary
Further Reading
Context Management 13 Topics, Read: 14 mins
Overview
Context
Why Manage It?
Position Matters: Lost in the Middle
Six Strategies, Six Prices
How the Strategies Compose
Five Ways a Window Fails
Protecting the Window
Our Implementation: One Window, Five Stages
The Context Score
Strategies and Detectors in Code
Summary
Further Reading
Memory Management 17 Topics, Read: 13 mins
Overview
An Agent That Learns While It Sleeps
Two Kinds of Remembering
Four Memories
Working Memory
Episodic and Semantic Memory
Procedural Memory: Skills and AGENT.md
Reading Memory: Which Memory Comes Back?
Writing Memory: Every Write Is Governed
Dreams: Consolidating After the Work
A Dream, Step by Step
What a Turn Leaves Behind, and Why This Design
Summary
Further Reading
Hallucination Checks 14 Topics, Read: 11 mins
Overview
Shape vs Truth
Hallucination
Why It Costs
Where the Check Sits: After the Model, Before the User
NLI: Premise, Hypothesis, Verdict
Atomic Claims, Three Classes
Where NLI Falls Short
Records Are Read, Not Inferred
Token Confidence: The Model's Own Doubt
Hallucination Check Methods
Two Levels, One Card; Repair, Trim, Withhold
Summary
Further Reading
LLM as a Judge 12 Topics, Read: 10 mins
Overview
LLM as a Judge
Four Known Biases
Why Raw Agreement Lies
Cohen's Kappa
Psychometrics: Treat the Judge Like a Test Instrument
Why A vs B Beats a Score
Our Judges: One Skeleton for the Platform
Kappa in Every Eval Run, and the Independent Auditor
Summary
Further Reading
Agent Security Principles 14 Topics, Read: 11 mins
Overview
The Forged Approval, Again
Why Agents Are Different
Six Principles
OWASP Top 10 for LLM Applications (2025)
Personal Data: Four Places PII Leaks
Prompt Injection: Direct and Indirect
Authority Comes From the Source
Content Moderation
RBAC: Roles Are What You Are, Permissions Are What You May Do
Beyond RBAC: The Gatekeeper
Where We're Thinner
Summary
Further Reading
Evals 16 Topics, Read: 11 mins
Overview
Every Control Makes a Claim
Tests Are Not Evals
Eight Principles
Grade the Outcome, Not the Path
Balance the Set; Keep a Control
pass@k vs pass^k
Three Graders, Three Questions
DeepEval: Judged Quality, the pytest Way
Promptfoo: Red-Team the Agent with the Same Rules
Our Eval Harness: Run Once, Grade Twice
Summary
Further Reading
Observability & Analytics 12 Topics, Read: 10 mins
Overview
One Id, Three Views
Observability
What a Trace Is
Our Trace Id, in Four Places
OpenTelemetry and the GenAI Conventions
Analytics Is a Platform Contract
Dashboards as Code: From a Turn to a Tile
LangSmith: One Run per Turn
Summary
Further Reading
Model Context Protocol 15 Topics, Read: 11 mins
Overview
One Server, Any Client
Model Context Protocol (MCP)
Host, Client, Server
Discover, List, Call
The Protocol Connects; It Doesn't Trust
The Ops Agent: Questions Answered From Data
Two Walls Around run_query
Our Server and a Governed Client
stdio vs Streamable HTTP
Moving Our Server to HTTP
Summary
Further Reading
System Design Patterns 18 Topics, Read: 12 mins
Overview
It Does Not Pay Twice
Why Agents Need Resilience More
Failures Crack and Spread
Timeout, and Little's Law
Retry with Backoff and Jitter
Circuit Breaker
Bulkhead
Idempotency
Saga
Putting It Together: The Order Is the Design
Summary
Further Reading
Build vs Buy 16 Topics, Read: 11 mins
Overview
Point of View
Four Options, Per Component
What the Data Says (and Doesn't)
ROI, Payback, NPV
Total Cost of Ownership
Break-Even Volume
Eight Factors Beyond Price
What to Build: The Control Plane and the Data
What to Buy or Adopt
The Recommendation
Summary
Further Reading