Learning Agents 101 for Normies

Agents 101 for Normies

What happens when you press Enter — traced from the top of the stack to the bottom.

Who are you?

  • A professional with solid tech literacy — but not a developer.
  • Someone who uses AI tools and wants to understand what's actually happening, not just what they're told to click.
  • Someone who hears "agentic," "AI-first," and "we're building our own agent" at work and wants a real mental model — not a buzzword.

What this is

A deconstruction of a live demo — step by step, layer by layer, all the way down. The goal is to become a knowledgeable, discerning buyer of the AI tools you already use and will be asked to use or evaluate.

Not vibe-coding. Not hype. The math stays out. The mechanism stays in.

How we'll do it

We start with a real demo — an AI morning briefing running live. Then we follow that prompt all the way through the stack, from the software that received your command down to the GPU operation that produced each word.

2
The
Demo
3
Layer 4
Guardrails
4
Layer 3
Harness
5
The
Loop
6
Layer 2
Context
7
Layer 1
Inference
8
Layer 0
Model
Buyer's
Map

What's out of scope

  • Building AI tools for other people — that's a later session.
  • The math (vectors, matrix operations) — we name the operations, not derive them.

The Demo

One command. Six tools. A complete morning briefing.

You type /start-my-day. The agent runs this SOP — in order, without you touching anything else.

1
💬
Sweep Slack
DMs, channels, threads, group chats. Flag anything needing action.
2
📧
Sweep Email
Priority inbox. Identify actionable items.
3
🎫
Create Tickets
Collaboration items become Jira tickets. High-confidence: auto-create. Low: ask first.
4
📋
Check Jira
Read colleague comments. Identify actions needed from me.
5
🎧
Check Zendesk
Complaints, requests, and defects assigned to me.
6
📰
Fetch News
Domain and industry digest.

What just happened

The agent read six separate tools — each one a real API call to a live service — synthesized everything it found, and returned a single briefing grouped by urgency. It followed the playbook, flagged the items that needed action, and stopped.

That's not impressive because of AI. It's impressive because of everything around the AI: the software that received your command, assembled the instructions, called the tools one by one, managed the loop, and delivered the result.

Now let's follow that prompt. All the way down.

Structure: Each screen traces one layer the prompt passed through, in the order it actually passed through them — starting with what ran before the model ever saw your message.

Layer 4 — Input Guardrails

First stop. Before the model sees your message, this runs.

Your prompt
Input Guardrail safety · policy · jailbreak detection
✓ passes → Model
✕ blocked → "I can't help with that"

What it checks

The moment you press Enter, your message passes through a filter. It is not the model. It is a separate system that runs before the model ever reads your words — and it is silent unless your message gets blocked.

What the filter checks depends on who built the product. The base API (Anthropic, OpenAI) enforces the vendor's safety policies — content that could cause harm, attempts to override the model's core instructions, content the vendor prohibits. A product built on top can add its own rules: topic restrictions, age-appropriate content filters, compliance guardrails.

Why it exists

AI products process millions of requests. A small fraction of users probe for weaknesses — attempts to get the model to ignore its instructions, generate prohibited content, or leak information it shouldn't. The guardrail catches these before the expensive GPU operation runs. Cheaper to filter here than after the model has already responded.

What this means for you

Most of the time: nothing. Your message goes through. When it doesn't, you get a refusal — often with no explanation of which rule triggered it.

For an organization deploying AI: this layer is where content restrictions, topic limitations, and compliance rules should live. Not all products surface these controls to administrators. That's a buyer question.

Note: The same system runs on the model's output — it gates what you see as well as what the model reads. Screen 9 covers the output side and what to ask about both ends.

Layer 3 — The Harness

The software that wraps the model, assembles the page, and runs the loop.

The model is an amnesiac

The AI model — the neural network itself — does one thing: it reads a page of text and writes a reply. Then it forgets everything. It has no memory of past conversations. It cannot open a file, make an API call, or send an email. On its own, it just takes text in and returns text out.

A page of text
🧠 Model
A reply
…then forgets it ever happened

The harness assembles the page

Every time you interact with an AI product, software builds a fresh page for the model and slides it under its nose. That software is the harness. It bundles your question, the conversation so far, your standing instructions, any files, and the skill's playbook — and hands it all to the model as one large block of text.

System prompt (Anthropic's baseline)
Skill: Start My Day (your playbook)
Conversation history
Your message: /start-my-day
Harness
The page
everything the model sees

The model sees only what's on this page. Nothing else. The harness decides what goes on it — and that decision is most of the product.

The model is not the product. The harness is.

Everything you think of as "the AI being smart" is mostly the harness doing its job. Two products running the same model can behave completely differently because their harnesses are completely different.

Context engineering Assembles what the model reads each turn
Memory & state Fakes continuity across a stateless model
Tool execution Runs tools when the model requests them
Identity & permissions Who you are, what you're allowed to do
Cost routing Easy work → cheap model; hard → expensive
Guardrails Filters what the model surfaces
Evals & logging Records answers so you can tell when it's wrong
The UI Chat window, uploads, citations, buttons
Domain adaptation Your terminology, sources, and output style

The Loop

One iteration. For the morning briefing, this cycle runs at least 6 times.

Layer 3 Harness Reads skill · detects tool calls · controls the loop
External Tool Execution Slack · Gmail · Calendar · Jira · Zendesk · News
Layer 2 Context Tool result appended · page grows each iteration
Layer 1 Prefill Only new tokens · prior context KV cached
Layer 0 Model Decode one token at a time · tool call or done?
×6+
per briefing
tool call issued tool result append result KV cached tokens out
An agent is a controlled loop, not a single API call.
A chatbot responds once and stops. An agent keeps going until the skill's goal is met — or until it hits a configured limit. The morning briefing ran this cycle 7 times: one per tool, plus a final synthesis pass.
Use the buttons to walk through one iteration of the loop.

Layer 2 — Context

The page the model reads. Everything it knows lives here — and only here.

The context is the model's entire world

The model has no external knowledge during a request. It cannot look things up. It cannot remember your name from last week. All it knows on any given call is what appears on the page the harness assembled — the context. If it's not on the page, it doesn't exist.

This is why the harness rebuilds the context on every loop iteration: after the Slack tool returns results, those results get appended to the page. The model reads them on the next decode pass. Without that append, the model would have no idea what Slack returned.

Three ways to put things in context

1 — Prompting Free · instant · most leverage

You write instructions, examples, or constraints directly. System prompts, skills, the anatomy of a good prompt — all prompting. This is what the morning briefing skill is: a block of text the harness injects onto the page before your message arrives.

2 — RAG Retrieval-Augmented Generation · moderately complex

At query time, retrieve relevant documents from a database and stuff them onto the page alongside your question. This is how "your company's documents" get into the context — not by training the model on them, but by fetching and injecting them at runtime. Updatable without retraining.

3 — Fine-tuning ⚠ Different — not context

Fine-tuning changes the model's weights, not the page. It does not add knowledge reliably — research shows fine-tuning on new facts can increase hallucination, because the model learns the pattern of confidently asserting things, then applies it to things it doesn't actually know. Reach for RAG first. Fine-tune only when prompting and RAG have proven a specific gap they can't close.

The context window is finite

Every model has a context limit — a maximum number of tokens (text chunks) that can appear on the page at once. When the limit fills, one of two things happens: older content gets dropped silently, or the model starts degrading. That's context rot. The Bonus screen demonstrates it interactively.

In the morning briefing, each tool result appends to the context. Six tools, six results — the page grows with each loop iteration. Long or verbose tool results can eat the context window quickly.

Layer 1 — Inference

Where the context becomes computation. The serving infrastructure you don't see.

Two operations, very different speeds

When a prompt arrives at the serving infrastructure, it runs two distinct operations in sequence.

Prefill
All input tokens at once

The entire context — every token on the page — is processed in one parallel pass through the model. Parallel means fast: it doesn't matter if the context is 100 tokens or 10,000, the GPU handles them simultaneously.

The result: a KV cache — a stored computation of every token's relationship to every other token. This is the expensive part of a turn, but it only runs once.

Parallel · fast
Decode
One token at a time

The model generates the response token by token — each new token depends on all prior ones. This cannot be parallelized. Output length directly determines how long decode takes and how much it costs.

This is why a three-sentence answer is faster than a three-paragraph one — even if the input prompt was the same.

Serial · output-length-dependent

The KV cache and why loops are fast

Without the KV cache, each loop iteration would re-process the entire context from scratch — every prior message, every tool result, every token. For the morning briefing, that would mean re-running prefill on a growing context six times.

Instead: the serving engine stores the computed key-value pairs from the first prefill. On subsequent loop iterations, only the new tokens (the tool result just appended) need to be prefilled. Everything else is read from cache. This is why adding a tool result mid-loop costs much less than the initial context load.

If you're using an API, this layer is invisible

When you call Claude, GPT, or Gemini via API, Layer 1 is entirely abstracted. The API endpoint receives your context and returns tokens. The serving engine — vLLM, TensorRT-LLM, or whatever the vendor runs — handles prefill, decode, batching, and caching behind the scenes.

You only care about this layer if you're evaluating self-hosted models: open-source weights (Llama, Mistral, Qwen) running on your own GPU fleet. Then Layer 1 choices dominate your infrastructure costs and latency budget.

Layer 0 — The Forward Pass

The atom. Every token the model generates runs this sequence once.

Six operations, one token out

When the model decodes a token, it runs a fixed pipeline. This runs once per output token — thousands of times across a full conversation.

Tokenize Text → chunks. Not words — sub-word pieces. "unbelievable" might be 3 tokens. This is why models count tokens, not words.
Embed Each token → a vector (a position in a high-dimensional space). Tokens with similar meanings cluster nearby.
Forward Pass The transformer processes all tokens together. Attention lets each token "look at" every other token in context — this is where relationships, references, and reasoning happen.
Softmax Output is a probability distribution over the entire vocabulary — every possible next token, with a likelihood score.
Sample Pick one token from the distribution. Temperature controls how much you explore low-probability options vs. always picking the most likely one.
One token out Appended to context. Then the loop runs again for the next token.
↺ repeat until the model outputs a stop token or the harness intercepts a tool call

Why this matters — three consequences

Probabilistic, not deterministic

The model samples from a distribution — the same prompt can produce different outputs on different runs. It is not a search engine returning the "correct" answer. It is generating the statistically likely next token given everything that came before. This is why it can be confidently wrong.

Sequential generation can't be parallelized

Each token depends on all prior tokens, including the ones the model just generated. You cannot generate token 50 before tokens 1-49 are done. Longer outputs always take longer — and cost more, since inference is priced per output token.

Everything in context influences every token

Attention is computed across the full context on every forward pass. A message from 40 turns ago can influence what the model generates today. This is also why context fills with noise over a long conversation — old, irrelevant tokens still consume attention and can distort the output. That's context rot.

Buyer's Map

What "agent" actually means when someone says it — and what to ask at each layer.

When someone says "agent," they mean one of three things

Same word. Three very different things. Now that you have the stack, you can disambiguate.

A product A finished app for one job Travel booking · customer support bot You're the buyer "We're buying an AI agent for our support team" — this meaning.
A framework A platform to build your own AutoGen · LangGraph · OpenClaw You (or IT) build on top of it "We need to be agent-first" — usually means this.
A primitive Model + harness + tools + loop Inside Claude Code — what this workshop traces You configure it in minutes "We're offering our own agent" — could mean any of these three.

Questions to ask at each layer

When evaluating any AI product or platform, the stack tells you what to investigate. Here are the load-bearing questions by layer.

Layer 4 Guardrails
  • What does this product filter by default?
  • Can administrators configure the content policy?
  • What happens when a user or student hits a guardrail?
  • Are filtered requests logged or auditable?
Layer 3 Harness
  • What tools can the agent access, and who controls that list?
  • Who writes and maintains the playbooks (skills / system prompts)?
  • Is there a loop limit — max tool calls before it stops?
  • What happens when a required tool is unavailable?
Layer 2 Context
  • Does this use RAG, fine-tuning, or prompting — or a combination?
  • What's the context window size? What happens when it fills?
  • Does filling the context mean my data leaves my environment?
  • Can I inspect what's in the context on any given request?
Layer 1 Inference
  • Is this API-based or self-hosted?
  • Who operates and maintains the inference infrastructure?
  • What are the latency and throughput SLAs?
Layer 0 The Model
  • Which model is running? (GPT-4o, Claude 3.7, Llama 3.3?)
  • What's the training data cutoff?
  • Open-source weights or closed API — and why does that matter for your use case?
  • What's the benchmark performance on tasks like yours, not on general leaderboards?

The leverage gradient

Cost and effort climb as you go deeper into the stack. The common mistake: teams over-invest in Layers 1 and 0 (self-hosting, fine-tuning) and under-invest in Layers 2 and 4 (context quality, evals and guardrails). The leverage is almost always higher up the stack — prompting and RAG before fine-tuning, evals before infrastructure.

Layer 4 · Layer 3 · Layer 2 High leverage · low cost · start here
Layer 1 · Layer 0 High cost · specialized need · exhaust the layers above first

Bonus: Why Long Chats Go Bad (Context Rot Simulator)

Watch a conversation fill the AI's memory. Every message re-sends everything.

This is a toy example with a 3,000-word limit. Real systems handle 100K–1M+ tokens, but the exact same problem shows up at scale.

Simulated Chat
Words in the AI's memory (tokens)
0
of 3,000-word memory (scaled for demo)
AI's memory used
0%
Who's filling the memory?
0
Your messages
0
AI replies
Each message you send transmits
0
words to the AI (tokens)
Context is fresh. Quality is high.
Key insight: AI replies are 2–4x longer than yours. Its own words fill the memory faster than anything you type.
What better tools do for you

Notice the only fix this demo offers is manual: start a new chat. Stronger harnesses fight the rot for you — they trim long outputs, skip files they've already read, and boil older turns down to a running summary so the important parts survive. That same summary is what gets saved between sessions: it's why you can close a Project or a chat and pick it up days later. The tool kept the gist, not the full transcript.

Shopping signal: does the tool manage its own context and remember across sessions — or is it on you to notice the rot and start over?

110 switch screens