Course 15 · Lesson 1 of 8

Free preview

Choosing the Pattern — Rule, ML, or LLM/Agent

Sign in to watch this video
The written lesson, interview questions and practice are below — sign in to play the video lesson.
Sign in

Architecture starts with refusing complexity you don’t need. The first decision is the shape of the solution — and reaching for an agent when a rule would do is the most common AI-architecture mistake.

The pattern ladder

1
Rule / heuristic
deterministic, debuggable, free
2
Classic ML
patterns in tabular data, measurable
3
LLM call
language/understanding, one-shot
4
RAG
LLM grounded in your knowledge
5
Agent
multi-step, tools, loops — last resort
Every rung up adds failure modes

Each step up the ladder adds latency, cost, non-determinism, and new ways to fail. Climb only when the rung below genuinely can’t meet the requirement.

Match shape to requirement

RequirementPattern
Deterministic policy, stable rulesrule engine
Predict a number/class from dataclassic ML
Understand/transform language oncesingle LLM call
Answer from your private docs, cite-ableRAG
Multi-step task using tools + stateagent (carefully)
Takeaway

Start at the bottom of the ladder and climb only when forced. Rules → ML → LLM → RAG → agent; each rung buys capability and pays in latency, cost and non-determinism.