AI EngineeringZero to ProductionHome·About·What’s new·Contact
Part 0 · Concepts (read before you code)

Agentic AI Foundations

From zero to understanding your first AI agent — the mental model, the vocabulary, and the moving parts. Python is the most important place to start, so this page opens with the complete Python curriculum, then covers the "what and why" that makes the hands-on chapters click. Every concept is tied to the course capstone: an AI DevOps Engineer you'll assemble in Part V.

🐍 Python first⏱️ ~30 min read🧠 Concepts🏗️ Capstone threaded

By the end of this page you'll understand

  • The difference between a chatbot and an agent — and why it matters.
  • The seven building blocks every agent is made of.
  • How an agent works step by step (the loop).
  • Why "LLMs are the brain, agents are the doers."
  • The common agent workflow patterns — and which ones the DevOps agent uses.

0 · Start here — learn Python first 🐍 intermediate

Here's a trap I've watched sink a lot of motivated people. They arrive excited about agents, skim the concept pages, and dive straight into Chapter 4 to "build an agent." Two hours later they're stuck — not on anything about agents, but on a dictionary that won't unpack, a for loop that indents wrong, an import that fails. The AI part was never the blocker; the Python underneath it was. They bounced off the language, not the idea. This section exists so that never happens to you.

Python is the most important thing to start with. Every lab, every project, and the entire capstone in this course are written in Python — so before the concepts click into working code, get comfortable with the language. The course ships a complete, self-contained Python curriculum: 20 hands-on lessons from absolute basics all the way to expert AI-engineering, each linked to where the course actually uses it.

Think of Python here the way a chef thinks of knife skills. Nobody signs up for cooking school because they're passionate about chopping onions — they want to make the beautiful dish. But every dish runs through the knife, so the chef who skipped knife practice is slow, frustrated, and cutting themselves all night. Python is your knife. Agents, RAG, tool-calling, evals — the "beautiful dishes" of this course — are all expressed in Python, so an hour spent getting fluent now pays itself back tenfold when the interesting chapters stop fighting you and start flowing.

And to name the fear directly, because it stops people: you do not need to be a "real programmer" to do this. Agentic AI code is mostly plain, readable Python — functions that call an API, dictionaries that hold a message, loops that repeat until done. If you can read the labs in this course and follow what each line does, you're ready; you don't need years of software engineering behind you. The curriculum below is deliberately laddered so an absolute beginner can start at P1 and climb, while someone already fluent can skim and skip ahead. Either way, treat Python as the ground you stand on, not a detour — the concepts on the rest of this page will feel abstract until you've seen them land in code you can run.

one laddered path · start where you fit, climb from there ① FundamentalsP1–P6 · basics → applied ② DSAD1–D6 · from scratch ③ Advanced AI EngA1–A8 · async → MLOps Python is a ladder, not a wall. The curriculum climbs in three tiers — fundamentals, then data structures, then advanced AI engineering — so you enter at your level and rise, rather than facing all of it at once.
🗺️ How to read this diagram

Read it bottom-left to top-right, following the arrows as rising rungs on a staircase.

  • The bottom box is tier ① Fundamentals (P1–P6) — the language basics every lab uses. This is where an absolute beginner starts.
  • The middle box is tier ② Data Structures & Algorithms (D1–D6), built from scratch so the later cost/scaling reasoning makes sense.
  • The top box is tier ③ Advanced AI Engineering (A1–A8) — async, tensors, tokenization, MLOps — the material the agent/RAG chapters lean on.
  • The arrows rising left-to-right are the payoff: each tier stands on the one below it, so the path only ever climbs; someone already fluent can skim the lower rungs and jump in higher.

In short: Fundamentals → DSA → advanced — one climbing path. Start at the rung that fits you and go up.

👉 Your first stepOpen the Complete Python Curriculum — all of Python under one link, in order. New to Python? Work it top to bottom. Already fluent? Skim it and jump straight to the concepts below. Either way, this is the foundation everything else stands on.
P
① Fundamentals (P1–P6)

Basics, data & structures, functions/OOP, advanced, expert, real-world engineering. Start at P1 →

D
② Data Structures & Algorithms (D1–D6)

Complexity, stacks/queues/lists, hashing, trees/heaps, graphs, sorting/searching — from scratch. Start at D1 →

A
③ Advanced AI Engineering (A1–A8)

Async, numerics/tensors, tokenization, validation, vector DBs, MLOps. Start at A1 →

The full curriculum — and every individual lesson — is always in the left menu at the top, above the course chapters. Come back to it whenever you hit Python you want to understand more deeply.

1 · What is Agentic AI? intermediate

Start with a moment you've probably had. You paste a stack trace into a chatbot and it writes you a beautiful three-paragraph explanation of what's wrong and exactly which commands to run. Helpful — but then you open the terminal, you run the commands, you read the output, you come back and paste the next thing. The AI knew the answer the whole time; you were its hands and feet. An agent is what you get when the AI grows its own hands and feet — when it can run those commands, read that output, and decide the next step, all without you shuttling text back and forth.

Here's the everyday analogy that makes the line crisp. A chatbot is a brilliant consultant on the phone: ask anything, get expert advice, but they never leave their desk — nothing in your world actually changes until you go do it. An agent is a contractor you hand a key: you describe the outcome you want ("get the leaking pipe fixed"), and they show up, inspect, decide what tools to grab, do the work, check it held, and only call you when they need a sign-off. The consultant tells; the contractor does. That single difference — action toward a goal — is the whole subject of this course.

The common mistake beginners make is assuming "agent" just means "a smarter chatbot" or "a chatbot with a longer memory." It doesn't. A chatbot could have a genius-level IQ and a perfect memory and still be a chatbot, because it never touches the world — it only ever produces text for you to act on. What flips it into an agent isn't raw intelligence, it's agency: the wiring that lets it call tools, observe real results, and loop until the job is done. Keep that test in your pocket as you read on: after the AI finishes, has anything actually changed out in the world? If the answer is "no, it just told me things," you have a chatbot; if the answer is "yes, it gathered evidence and opened a fix," you have an agent. The two side-by-side cards below make the contrast concrete before we pin down the definition.

Chatbot: advises, then stops AI: "here's advice" YOU run the steps world unchanged until you act Agent: acts toward the goal plan → use tool world changes:PR opened loops until done, no human relay The test is "did anything change?" A chatbot hands back advice and stops — you are its hands. An agent carries its own decisions into the world with tools and loops until the goal is met.
🗺️ How to read this diagram

Read the two columns top to bottom: the left is a chatbot's flow, the right is an agent's, split by the dashed divider.

  • Left column: the AI produces advice (top box), then the red box shows you doing the actual steps. The arrow stops there — nothing in the world moved on its own.
  • Right column: the agent plans and calls a tool (top box), and the green box is a real change in the world — a PR opened. Notice there is no "you run it" box.
  • The curved arrow on the right loops the agent back to plan again: it observes the result and keeps going until the goal is met, with no human relaying text between steps.

In short: Chatbot = advice → you act. Agent = it acts and loops. Agency, not IQ, is the dividing line.

🤖 Chatbot

Answers questions. You ask, it replies. One turn, no action in the world. It knows things and talks — that's it.

"How do I debug a crash-looping pod?" → a paragraph of advice.

VS

🦾 Agent

Plans, uses tools, takes action, completes tasks. You give it a goal; it figures out the steps, uses tools to do them, checks its work, and delivers a result.

"This pod is crashing" → it gathers logs, diagnoses, and opens a fix PR.

Agentic AI is AI that can take action toward a goal. It can plan, use tools, remember context, and complete multi-step tasks — not just chat about them.

🏗️ The capstoneA chatbot could describe how to fix a broken deployment. The AI DevOps Engineer will actually do it — gather the evidence, diagnose, and open the fix as a reviewable PR. That's why it's an agent problem, not a chatbot problem.

2 · Why Agentic AI matters intermediate

Picture the last time a real task ate your afternoon. Not one hard question — a chain of small ones. An alert fires; you pull logs; the logs point at a bad deploy; you check what changed; you cross-reference the runbook; you draft a fix; you get someone to review it. Any single step, a chatbot could have helped with in seconds. But you were the one carrying the thread across all of them — holding the context, deciding the next move, gluing the pieces together. That gluing-together is exactly the work agentic AI is built to take off your plate.

Here's why that's a bigger deal than "a faster chatbot." A one-turn assistant helps with steps; an agent owns outcomes. The analogy is the jump from a calculator to a spreadsheet: a calculator answers one sum at a time and you copy each result forward by hand, while a spreadsheet holds the whole model, re-runs when something changes, and hands you the finished answer. Agents do that for multi-step work — they keep the context, sequence the steps themselves, and adapt when a step surprises them. The value isn't that they're smarter per step; it's that you stop being the human clipboard shuttling state between steps.

The mistake to avoid is reaching for an agent for everything, because "agentic" is the exciting word. If a job is genuinely one-shot — "summarize this paragraph," "classify this ticket" — an agent is overkill: more moving parts, more cost, more ways to fail, for a task a single call already nails. Agents earn their complexity precisely when the task is multi-step, uncertain, and stateful — when you don't know step 3 until you've seen the result of step 2. The three capabilities below — automation, planning, decision-making — are the levers that make that possible, and they're worth reading as "what an agent can do that a lone LLM call cannot."

Without an agent — you carry the thread across every step alert pull logs check deploy draft fix 👤👤👤👤 With an agent — one actor holds the context end-to-end Agent: keeps state · sequences steps · adapts → outcome Agents own outcomes, not steps. A chatbot helps with each step but leaves you shuttling state between them; an agent holds the whole chain, sequencing and adapting itself.
🗺️ How to read this diagram

Compare the two rows top vs bottom: the top is life without an agent, the bottom is life with one.

  • The top row of boxes is one real task broken into steps — alert → pull logs → check deploy → draft fix — connected by arrows meaning "then."
  • The 👤 markers under each box are you: without an agent, a human has to carry the context from each step into the next, gluing them together by hand.
  • The single green bar at the bottom is the agent: it absorbs the whole chain into one actor that keeps state, sequences the steps, and adapts — so the 👤 relay disappears.

In short: Without an agent you are the human clipboard between steps; an agent owns the entire multi-step outcome so you don't have to.

⚙️
Automation

Handles repetitive, multi-step work end-to-end without a human driving each step.

🗺️
Planning

Breaks a fuzzy goal into concrete steps and sequences them itself.

🧩
Decision-making

Chooses what to do next based on what it observes — not a fixed script.

It's the direction the whole field is heading: from "AI that tells you how" to "AI that does it, with you supervising."

🏗️ The capstoneToday, triaging an incident or reviewing an infra change eats a senior engineer's time. An agent that gathers context and proposes a fix the moment an alert fires turns an hour of toil into a 60-second review — that's the automation + decision-making value, made concrete.

3 · The building blocks of an agent advanced

The word "agent" can feel like a black box — magic in, results out — and that vagueness is what makes it intimidating. So let's break the box open. An agent isn't one mysterious thing; it's a small kit of ordinary parts wired together, and once you can name the parts, the magic turns into engineering you can actually build. That's the whole aim of this section: replace "an agent, somehow" with "these seven pieces, connected like so."

Think of it like the parts of a car. A car isn't a single indivisible marvel — it's an engine, a steering wheel, wheels, a fuel tank, a dashboard, brakes, and a driver, each with one clear job, combining into something that gets you places. An agent is the same: a goal (where you're going), planning (the route), tools (the engine that does work), memory (the trip so far), decision-making (the steering), action (actually moving), and a human-in-the-loop (the driver who can grab the wheel). Learn the parts once and every agent you ever meet — simple or frontier — decomposes into the same kit.

The mistake here is skipping straight to "tools" and ignoring the rest, because tool-calling is the flashy part everyone demos. But an agent that can call tools with no memory forgets what it just learned; one with no human-in-the-loop happily runs a destructive command; one with no real decision-making is just a fixed script wearing a costume. The seven blocks matter together — the reliability and safety of a real agent live in the unglamorous ones (memory, decision-making, the human checkpoint) as much as in the exciting one. Read the cards below as a checklist you'll return to: every agent you build in this course, up to the capstone, is these same seven pieces, and you'll construct each by hand later. Right now, just get comfortable naming them and what each is.

the AGENT 🎯 Goals 🗺️ Planning 🔧 Tool usage 🧠 Memory 🧩 Decision-making 🎬 Action 🧑‍⚖️ Human-in-the-loop Seven parts, one machine. An agent isn't magic — it's Goals, Planning, Tool usage, Memory, Decision-making, Action, and a Human-in-the-loop wired around a core. The unglamorous blocks (memory, decisions, the human check) carry the reliability.
🗺️ How to read this diagram

Read it from the centre outward: the middle box is the agent, and each surrounding box is one of the seven parts feeding into it.

  • The centre box "the AGENT" is the machine you're building — everything else plugs into it, like parts of a car around the driver.
  • The seven labelled boxes around it are the blocks: Goals (top), Planning, Tool usage, Memory, Decision-making, Action, and Human-in-the-loop.
  • The connecting lines show every block wiring into the same core — the point of the picture is that they work together, not that tools alone make an agent.
  • The green Human-in-the-loop box is highlighted because it is the safety checkpoint before anything irreversible — one of the "unglamorous" blocks that actually makes an agent trustworthy.

In short: Name the seven parts and the black box disappears — an agent is these pieces wired around a core, reliability living in the boring ones.

🎯
Goals

What the agent is trying to achieve. → "produce a broadcast-ready cut."

🗺️
Planning

Deciding the steps to get there.

🔧
Tool usage

Calling external tools — search, APIs, code, media processors.

🧠
Memory

Remembering context across steps and sessions.

🧩
Decision-making

Choosing what to do next based on results.

🎬
Action

Actually executing a step in the world.

🧑‍⚖️
Human-in-the-loop

A human checks or approves before risky/irreversible steps.

Where you'll build each block
BlockBuilt in
Tool usage, ActionChapter 4 (agent + tools)
MemoryChapter 4 (stateful agent)
Planning, Decision-makingChapter 4 (the loop)
Human-in-the-loopChapter 4 & 6 (approval gates)
GoalsChapter 2 (system prompt) & every chapter

4 · How an agent works (step by step) advanced

If you take one thing from this entire page, take this loop. Everything else — the seven blocks, the workflow shapes, the capstone architecture — is detail hanging off this single skeleton. An agent gets a task, makes a plan, picks a tool, does something, checks whether it worked, and then — the crucial part — decides whether to go around again. Miss the loop and you've missed what an agent is; get the loop and the rest is just filling it in.

The homely analogy is how you actually fix things in real life. Say your car won't start. You don't run a fixed script; you loop: guess it's the battery (plan) → grab the jump leads (choose tool) → try a jump (act) → still dead? (check) → new guess, maybe it's the starter (plan again) → and round you go until it turns over. Each attempt teaches you something that reshapes the next attempt. That "try, look at what happened, adjust, try again" rhythm is precisely the agent loop — and it's why an agent can handle a messy problem whose steps nobody could write down in advance.

The mistake to watch for is picturing an agent as a straight pipeline — task in one end, answer out the other, done. That's a workflow, not an agent, and it breaks the instant reality doesn't match the plan: the very first tool call returns something unexpected and a straight pipeline just barrels on with garbage. The loop is what buys robustness — the "check the result" step catches the surprise, and the "improve and repeat" arrow feeds it back into a fresh plan. Read the diagram below with your eye on that curved arrow returning to the start: the five steps in a row are the easy part, but the arc looping back is the whole point.

1Get task 2Break intosteps 3Choosetool 4Do it 5Checkresult 6 improve & loop
🗺️ How to read this diagram

This is the single most important picture in the chapter: it shows the agent loop — the repeating cycle an AI agent runs to get a job done. Read the five numbered circles left to right, then follow the coloured arrow that curves back to the start.

  • Circle 1 — "Get task" (the filled purple one) is where a job arrives, e.g. "an alert just fired." That's the agent's goal for this run.
  • Circles 2→5 are the thinking-and-doing steps, and the straight blue arrows between them mean "then": 2 Break into steps (make a plan) → 3 Choose tool (which command fits?) → 4 Do it (actually run the tool) → 5 Check result (did that work? is the evidence solid?).
  • Circle 6 (the small green circle, lower right) is the decision point after checking: is the task finished, or not yet? The green arrow labelled improve & loop leads into it.
  • The dashed teal arrow sweeping from 6 back up to circle 2 is the loop: if the task isn't done, the agent takes what it learned and plans again, repeating the cycle. That "check, then improve and repeat" arrow is exactly what makes an agent smarter than a one-shot script.

In short: An agent = plan → pick a tool → act → check → repeat until done. A plain program runs its steps once in a fixed order; an agent keeps looping and adjusting based on what it sees, so it can handle messy, real-world tasks.

Task → break into steps → choose the right tool → do the step → check the result → improve and repeat until done. That "check & improve" loop is what makes an agent more than a script.

🏗️ The capstone, as these steps 1 alert fires → 2 plan: gather logs, events, recent deploys → 3 choose tool (kubectl? aws?) → 4 run it → 5 check (root cause found? evidence solid?) → 6 propose the fix as a PR. Identical shape.

5 · LLMs vs AI Agents advanced

People blur these two words constantly, and the blur causes real confusion — so let's separate them for good. "LLM" and "agent" get used almost interchangeably in casual talk, but they're different layers of the same system, and mixing them up is why beginners can't tell why their "agent" didn't do anything. An LLM is a component; an agent is the machine built around that component. One thinks; the other acts.

The cleanest analogy is a brain in a jar versus a whole person. A large language model is an astonishing brain: it understands language, reasons, weighs options, and produces the right decision — but sitting in its jar it can't pull a lever, read a dial, or open a door. It can only say what should be done. An agent is that brain given a body: eyes to observe (read tool output), hands to act (call tools), a notebook to remember (memory), and the nervous system that keeps the cycle going (the loop). The intelligence lives in the brain; the doing lives in the body wrapped around it.

Here's the mistake this framing kills: expecting an LLM, by itself, to change something in the world — and being baffled when it just describes the change instead. That's not a failure, it's the LLM doing exactly its job: it decides, it never executes. If you want a file written, a command run, a PR opened, you (or the agent scaffolding you build) must hand the model tools and wire up the loop that carries its decisions into action. Getting this distinction bone-deep is what the rest of the course rests on: the LLM is the smartest part but the least capable on its own, and the engineering — the part you're here to learn — is everything that turns a decision into a done thing. The two cards below name the split; the one-liner that follows is worth memorising.

the AGENT (the body) wraps the LLM (the brain) 🧠 LLMdecides only 🔧 tools — call APIs/CLIs 🧠 memory — carry state 🔁 loop — execute & repeat The brain decides; the body does. The LLM (inner box) only produces decisions. Wrapping it with tools, memory and a loop is what turns those decisions into real actions — that wrapper is the agent.
🗺️ How to read this diagram

Read it inside-out: the big outer box is the whole agent; the small box inside it is the LLM.

  • The inner amber box "LLM" is the brain — it reasons and decides, but "decides only": on its own it never touches the world.
  • The three boxes on the right are what the agent adds around the brain: tools (to call APIs/CLIs), memory (to carry state), and the loop (to execute and repeat).
  • The arrows from the LLM to those boxes are decisions flowing outward into action — the model says what, and the wrapper makes it happen.
  • The big surrounding box is the payoff: brain + tools + memory + loop together = the agent. Take away the wrapper and you're left with a brain in a jar that can only talk.

In short: LLM = decides; agent = the body of tools, memory and a loop that carries those decisions into the world.

🧠 LLM — the brain

Understands language and generates text. It can suggest what to do, reason about a problem, and decide — but it can't act on the world by itself.

+

🦾 Agent — the doer

An LLM plus tools, memory, and a loop. It takes the brain's decisions and actually executes them, step after step, until the task is complete.

The one-liner to rememberLLMs are the brain; agents are the doers. This is the single most important idea for the capstone: the LLM decides what to do about a broken deployment, but real tools (kubectl, terraform, git) do it. The agent is the wiring between them.

6 · Common agent workflows expert

Once you've built a couple of agents, a quiet realization arrives: you keep drawing the same handful of diagrams. The task changes — support triage, incident diagnosis, research synthesis — but the wiring falls into a few recurring shapes you've seen before. That's not a coincidence; it's the good news. You don't invent a new architecture per problem. You recognise which of a small set of proven shapes fits, and reach for it. This section names those shapes so you stop reinventing them.

Think of them like sentence structures in a language. English has only a few basic patterns — statement, question, command, conditional — yet they compose into infinite sentences. Agent workflows are the same small grammar: chaining (a fixed line of steps), routing (classify, then branch), the ReAct loop (reason → act → observe, repeat), and the orchestrator (fan work out, gather it back). Every elaborate agent you'll ever read about is these primitives, combined and nested. Learn the grammar once and you can parse — and design — any agent you meet.

The mistake nearly everyone makes first is defaulting to the loop for everything, because the ReAct loop is the one that feels "agentic." But the loop is also the most expensive and least predictable shape — every iteration is another model call and another chance to wander. If a task's steps are actually known and fixed, plain chaining is cheaper, faster, and easier to debug; if it's a clean either/or, routing beats looping. The skill isn't always using the fanciest shape — it's matching the shape to the task, saving the loop for problems whose steps genuinely can't be known in advance. As you read the four shapes below, don't memorise them; just tune your eye to recognise them, because you'll meet all four again when you build Chapter 4.

Chaining — step → step → step Routing — pick a branch ReAct loop — reason ⇄ act ⇄ observe reason act observe → loop Orchestrator — fan out, gather plan Four recurring agent shapes. Chaining runs fixed steps in order; routing picks a branch by classification; the ReAct loop alternates reason→act→observe until done (Ch 4's loop); the orchestrator plans, fans out subtasks, and gathers results. Real agents combine them.
🗺️ How to read this diagram

This diagram is a quadrant — four small mini-diagrams, one per corner — each showing a common shape that agents are wired into. In every mini-diagram a box is a step and an arrow means "flows to." The coloured word above each corner names the pattern.

  • Top-left — Chaining: three boxes in a straight row with arrows (step → step → step). The steps always run in the same fixed order, like an assembly line.
  • Top-right — Routing: one box splits into two, so the arrows fan out. The agent first classifies the input, then picks one branch to follow — like a switch that sends easy vs. hard questions down different paths.
  • Bottom-left — ReAct loop: a reason box and an act box with an arrow that curves back on itself (labelled observe → loop). The agent reasons, acts, looks at the result, then reasons again — this is the same loop as the first diagram, and it's what Chapter 4 builds.
  • Bottom-right — Orchestrator: a plan box with arrows fanning out to three boxes. One "manager" step splits the work into subtasks, runs them, and gathers the results back together.

In short: These are just four ways to connect the boxes: chaining = fixed line, routing = pick a branch, ReAct = loop, orchestrator = fan out and gather. Real agents mix and match them — you don't have to memorise them now, just recognise the shapes when you meet them in Chapter 4.

PatternWhat it doesThe DevOps agent
PlannerBreaks the goal into a task list first, then executes.Plans the full provisioning before writing Terraform
ExecutorCarries out each planned step with tools.Runs get-logs → describe → check-recent-deploys
Reflection loopReviews its own result and redoes weak parts."Does this terraform plan destroy anything? Reconsider."
ReActAlternates reasoning and acting, step by step.Inspect → hypothesize → gather more evidence → conclude
Multi-stepChains many sub-tasks into one bigger job.Diagnose → fix → open PR → verify, end-to-end
Where you'll build theseChapter 4 builds the Executor + ReAct loop directly. Chapter 5 (evals) is where the Reflection loop gets real teeth — you can't "review your own work" reliably without a way to measure quality.

7 · The capstone through this lens expert

Every concept on this page has been building toward one payoff, so let's cash it in. Abstract ideas — brain vs. doer, the loop, the seven blocks, the workflow shapes — only truly stick once you watch them assemble into something real. So here we take the whole vocabulary and point it at the concrete thing you'll build: the AI DevOps Engineer. If the earlier sections felt theoretical, this is where the theory grows a spine.

Here's the analogy that keeps the capstone honest, and it's the one misconception worth killing before you write a line of it. The agent is a surgeon, not a scalpel. A surgeon doesn't cut with their hands — they decide where to cut and wield precise instruments to do it, and a good operating theatre has checklists and a second pair of eyes before anything irreversible happens. Our agent is exactly that: the LLM is the surgeon's judgment (diagnose, decide, plan), the real tools — kubectl, terraform, aws, git — are the instruments that actually cut, and a human sign-off is the theatre checklist. The mistake that sinks people is imagining the AI itself "does" the infrastructure work by magic; it doesn't. It reasons and orchestrates; boring, battle-tested CLIs do the doing. That's not a limitation to apologise for — it's what makes the whole thing trustworthy enough to ship.

The course's destination (Chapter 8) is an AI DevOps Engineer — an agent that onboards into any company's stack and diagnoses, proposes, and (carefully) executes infrastructure work. Here's the honest architecture, using every concept above.

an alert flows down through six layers to a safe, proven fix Trigger — alert / Slack / PR (webhook) Knowledge — this company's runbooks (RAG) Brain — diagnose & decide a plan (Claude) Hands — kubectl · terraform · aws · git Review — human approves state changes Trust — evals prove it correct & safe Six layers, top to bottom. Trigger → Knowledge → Brain → Hands → Review → Trust. The purple brain only decides; the amber hands (real CLIs) do the work; the green review gate keeps state changes human-approved.
🗺️ How to read this diagram

Read the stack top to bottom, following the arrows — an alert enters at the top and a proven fix comes out the bottom.

  • Trigger (top) is what starts a run — an alert, a Slack command, a PR — caught by a webhook.
  • Knowledge gives the agent this company's runbooks and conventions via RAG, so it isn't guessing.
  • The purple Brain is the LLM (Claude): it diagnoses and decides a structured plan — but notice it's not the layer that touches infrastructure.
  • The amber Hands are the real CLIs — kubectl, terraform, aws, git — that actually do the work the brain decided on.
  • The green Review gate is the human sign-off before any state change; Trust at the bottom is the eval suite that must prove an operation safe before it's ever automated.

In short: Trigger → Knowledge → Brain → Hands → Review → Trust — the brain decides, boring CLIs do the doing, and humans plus evals guard every real change.

The crucial truthThe LLM/agent is the decision-maker, not the tool. It reasons about the problem and orchestrates real tools; the actual work is done by kubectl, terraform, aws, git. It's a textbook agent where the tools happen to be infrastructure CLIs — which is why it fits this course so cleanly.
LayerRoleTechCourse link
TriggerFire on an alert / Slack command / PRwebhook → handleryour AWS repo
KnowledgeKnow this company's runbooks & conventionsRAGCh 3
BrainDiagnose & decide → a structured planClaude (structured JSON)Ch 2 + Ch 4
HandsInspect & act (read-only free; writes gated)kubectl, terraform, aws, gitCh 4 tools
ReviewHuman approves any state changepolicy / approval gateCh 4 + Ch 6
TrustProve decisions are correct & safeevalsCh 5
Two honest scoping rules
  • Read-only first, gated writes later. The agent starts by diagnosing — it can't change anything. It earns the right to act one operation at a time, on evidence. Prod stays human-approved indefinitely.
  • Copilot, not lights-out. The win is turning an hour of toil into a 60-second PR review — not an unattended agent running terraform apply on prod. Full autonomy comes only where evals prove an operation safe.
🎬 Have a different project in mind?The same lens works for any agent — an audio/video editing agent, a customer-support agent, a research agent. The layers (trigger → knowledge → brain → gated tools → review → evals) don't change; only the tools do. Learn the pattern here; apply it to whatever you build.

What's next expert

You now have the mental model. Two ways forward:

Learn with the end in mindAs you go through the hands-on chapters, keep the capstone in view. When Chapter 4 says get_weather, picture kubectl_get or terraform_plan. Every lab ends with a "🏗️ Toward the capstone" note showing exactly how it plugs into the AI DevOps Engineer.

🪜 Practice ladder beginner → industry

Six graded exercises, easy to real-world. Try each before opening its solution.

Exercise 1 · Chatbot or agent?Beginner

Context: The first fork in agentic AI is deciding whether a job even needs an agent. A chatbot answers in one turn; an agent plans, uses tools, and acts toward a goal — and confusing the two leads to over- or under-engineering.

Your task: Classify each request as a chatbot job or an agent job and justify each in one line: (a) “explain how to fix a crash-looping pod,” (b) “this pod is crashing — gather logs, diagnose, and open a fix PR.”

Requirements:

  • Label (a) as chatbot: one turn, answers a question, takes no action in the world
  • Label (b) as agent: given a goal, it plans, uses tools, acts, and delivers a result
  • Justify each in a single sentence tied to the lesson's definition
  • Name the distinguishing test: does it act toward a goal or merely describe how?

💡 Hint: Ask of each: after the reply, has anything changed in the world? Only the agent gathers logs and opens a PR.

Show solution

(a) Chatbot. It answers a question in one turn and takes no action in the world — you ask, it replies with a paragraph of advice.

(b) Agent. You give it a goal and it plans steps, uses tools (gather logs), takes action (diagnose), and delivers a result (opens a PR). It acts toward a goal, not just chats about it.

The lesson's one-liner: a chatbot could describe how to fix a broken deployment; the agent actually does it. That difference — plan, use tools, take action, complete multi-step tasks — is what makes (b) an agent problem.

Exercise 2 · Name the seven building blocksIntermediate

Context: Every agent, including the course capstone, is assembled from the same seven pieces. Being able to name them and point at a concrete instance of each is the vocabulary the rest of the course assumes.

Your task: List the seven building blocks of an agent from the lesson, then give one concrete capstone example each for the Tool usage and Human-in-the-loop blocks.

Requirements:

  • Enumerate all seven: Goals, Planning, Tool usage, Memory, Decision-making, Action, Human-in-the-loop
  • One-line description of what each block is
  • Tool usage example is a real infra CLI call (e.g. kubectl get or terraform plan)
  • Human-in-the-loop example gates a state change (a human approves before terraform apply)
  • Reflect the lesson's rule: read-only diagnosis is free, writes are gated

💡 Hint: The blocks map onto the loop: goal in, plan, pick a tool, act, remember, decide, and a human checkpoint before anything irreversible.

Show solution

The seven building blocks:

1. Goals             - what it's trying to achieve
2. Planning          - deciding the steps to get there
3. Tool usage        - calling external tools (APIs, code, CLIs)
4. Memory            - remembering context across steps/sessions
5. Decision-making   - choosing what to do next from results
6. Action            - actually executing a step in the world
7. Human-in-the-loop - a human approves risky/irreversible steps

Tool usage (capstone): the agent calls real infrastructure CLIs — e.g. kubectl get to pull pod logs/events or terraform plan to preview a change. Human-in-the-loop (capstone): before any state change (a terraform apply on prod), a human reviews and approves the proposed fix PR — read-only diagnosis is free, writes are gated.

Exercise 3 · Encode the agent loop as pseudocodeAdvanced

Context: The agent loop — get task, plan, choose tool, act, check, repeat — is the single most important picture in the chapter. Turning it into runnable code makes concrete what separates an agent from a one-shot script.

Your task: Write a small pure-Python skeleton that expresses the lesson's loop using stub functions — plan, choose_tool, act, and check — driven by an agent(task) that runs.

Requirements:

  • Model all six steps: receive task, plan, choose tool, act, check, loop on the decision
  • Use a while loop that re-plans when check says not done
  • Carry state across iterations in a memory list (the observe step)
  • Stubs may be trivial, but the program must run and terminate
  • Make clear how this differs from a fixed script that runs its steps once

💡 Hint: The distinguishing feature is the while + check: an agent re-plans based on what it observed, rather than executing a fixed sequence once.

Show solution
def plan(task, memory):        # step 2: break into steps
    return ["gather_logs", "diagnose"]  # stub plan

def choose_tool(step):         # step 3
    return {"gather_logs": "kubectl", "diagnose": "llm"}[step]

def act(tool, step):           # step 4: do it
    return f"ran {tool} for {step}"

def check(results):            # step 5: is evidence solid / task done?
    return len(results) >= 2   # stub: done once we've acted twice

def agent(task):
    memory = []                # step 1: get task -> goal for this run
    while True:
        for step in plan(task, memory):
            tool = choose_tool(step)
            memory.append(act(tool, step))     # observe -> memory
        if check(memory):                      # step 6: done?
            return memory
        # else: improve & loop -- plan again with what we learned

print(agent("fix crash-looping pod"))

This mirrors the diagram exactly: circle 1 is receiving the task, 2–5 are plan → choose tool → act → check, and circle 6 is the decision point whose dashed arrow loops back to plan when the task isn't done. The distinguishing feature versus a plain script is the while loop with check: an agent re-plans based on what it observes, rather than running a fixed sequence once. memory is what carries context across iterations.

Exercise 4 · Match the four workflow shapes to tasksExpert

Context: Agents are wired into a few recurring shapes — chaining, routing, the ReAct loop, and the orchestrator. Recognising which shape fits a task is what lets you pick an architecture instead of reaching for the loop every time.

Your task: For each of the four workflow shapes, describe its structure in one line and give a task where it is the right fit.

Requirements:

  • Cover all four: chaining, routing, ReAct loop, orchestrator
  • Chaining = fixed steps in order; routing = classify then pick a branch
  • ReAct loop = reason → act → observe, curving back until done
  • Orchestrator = a planner fans work to subtasks, then gathers results
  • Each fit example should genuinely suit that shape (e.g. incident diagnosis for ReAct)

💡 Hint: The key contrast: chaining runs a fixed line once, while the ReAct loop's “check then improve” wins when the steps aren't known in advance.

Show solution
ShapeStructureGood fit
ChainingFixed steps in order (step → step → step), like an assembly line.A known, stable transform: extract → summarize → format a report.
RoutingClassify the input, then pick one branch.Support triage: send easy FAQs one way, complex tickets another.
ReAct loopReason → act → observe, curving back on itself until done.Incident diagnosis where steps aren't known in advance and depend on what you find.
OrchestratorA planner fans work out to subtasks, then gathers results.Research across many sources in parallel, then synthesize.

The key contrast the lesson draws: chaining runs a fixed line once; the ReAct loop's "check then improve and repeat" wins on messy, real-world tasks whose steps aren't known up front, because it gathers more evidence and adjusts. Real agents mix and match these shapes.

Exercise 5 · Map the capstone onto trigger-knowledge-brain-hands-review-trustProfessional

Context: Real agent deployments are judged on their architecture, not their demo. The AI DevOps Engineer's six layers — trigger, knowledge, brain, hands, review, trust — are the honest blueprint the whole course builds toward.

Your task: Lay out the six-layer architecture of the AI DevOps Engineer, naming the role and tech for each layer, then state which layer is the “brain” and why the LLM is not the tool.

Requirements:

  • Name all six layers with their role and tech (webhook, RAG, Claude, CLIs, approval gate, evals)
  • Identify the brain as the LLM/agent that diagnoses and decides a structured plan
  • Explain that the brain orchestrates tools but doesn't do the work itself
  • Name the real tools that do the work: kubectl, terraform, aws, git
  • Tie it to the lesson's one-liner: LLMs are the brain; agents are the doers

💡 Hint: The agent is the wiring between a decision and the CLIs that execute it — a textbook agent where the tools happen to be infrastructure CLIs.

Show solution
LayerRoleTech
TriggerFire on an alert / Slack command / PRwebhook → handler
KnowledgeKnow this company's runbooks & conventionsRAG
BrainDiagnose & decide → a structured planClaude (structured JSON)
HandsInspect & act (read-only free; writes gated)kubectl, terraform, aws, git
ReviewHuman approves any state changepolicy / approval gate
TrustProve decisions are correct & safeevals

The brain layer is the LLM/agent — it reasons about the problem and orchestrates the real tools, but it doesn't do the work itself. The actual changes are made by kubectl, terraform, aws, git. That is the crucial truth from the lesson: "LLMs are the brain; agents are the doers" — the agent is the wiring between a decision and the CLIs that execute it, which is why it's a textbook agent where the tools happen to be infra CLIs.

Exercise 6 · Defend the scoping rules to a skeptical execIndustry scenario

Context: The moment an agent can touch production, the argument shifts from capability to safety. An exec pushing for unattended writes on prod is the pressure every real agent team faces — and the lesson's two scoping rules are the defensible answer.

Your task: An exec wants the DevOps agent running terraform apply on prod unattended “to save time.” Using the lesson's two scoping rules, write a short rebuttal and the safe path to more autonomy.

Requirements:

  • Invoke rule 1 — read-only first, gated writes later; prod stays human-approved
  • Invoke rule 2 — copilot, not lights-out; the win is a 60-second PR review, not autonomy
  • Explain why unattended terraform apply on day one makes one bad plan catastrophic
  • Give a staged path: diagnose → open a PR → build evals → auto-approve narrow, proven ops
  • State the principle: autonomy is granted by measurement (evals), not by exec urgency

💡 Hint: Anchor the rebuttal in the Review and Trust layers — full autonomy comes only where evals prove a specific operation safe, lower environments first.

Show solution

Rebuttal, grounded in the lesson's two honest scoping rules:

  1. Read-only first, gated writes later. The agent starts by diagnosing — it can't change anything. It earns the right to act one operation at a time, on evidence. Prod stays human-approved indefinitely. Handing it unattended terraform apply on prod on day one inverts this and makes a single bad plan catastrophic and irreversible.
  2. Copilot, not lights-out. The real win is turning an hour of toil into a 60-second PR review — not an unattended agent mutating prod. Full autonomy comes only where evals prove a specific operation safe.

Safe path to more autonomy: (1) ship read-only diagnosis that opens a reviewable fix PR; (2) build the eval suite (the "Trust" layer) so you can measure correctness and safety per operation; (3) auto-approve only the narrow operations whose evals prove safe, in lower environments first; (4) keep prod state changes human-gated behind the approval policy. Autonomy is granted by measurement, not by exec urgency — the same discipline the capstone's Review and Trust layers exist to enforce.

Knowledge check check yourself

✓ Knowledge check

The lesson's one-liner is 'LLMs are the brain; agents are the doers.' What does an agent add to an LLM, and why does that distinction matter for the DevOps capstone?

Show answer
An agent wraps the LLM with tools, memory, and a loop so it can actually execute the brain's decisions in the world. It matters because a chatbot can only describe how to fix a broken deployment, whereas the agent gathers evidence, diagnoses, and opens the fix as a PR — real tools (kubectl, terraform, git) do the work the LLM decides on.
✓ Knowledge check

Contrast the ReAct-loop pattern with a plain chaining workflow. When does the loop's 'check then improve and repeat' give an agent an edge over a fixed sequence of steps?

Show answer
Chaining runs a fixed sequence once, in order; the ReAct loop alternates reason -> act -> observe, re-planning based on what it sees each step. The loop wins on messy, real-world tasks whose steps aren't known in advance — it can gather more evidence and adjust, where a fixed chain would just run its predetermined steps regardless of results.
© 2026 studybydoing.in · AI Engineering: Zero to Production · All rights reserved. · About · Privacy Policy · Terms · Contact
Educational content, provided as-is and without warranty. Code samples are examples — review, test, and adapt them before using in production. See the Terms of Use & Disclaimer. Use at your own risk.
© studybydoing.in