The community’s agent course is back. After Python setup and connecting OpenRouter, this session finally gets into how a chat with an AI actually works under the hood: who says what, in what order, and why the model seems to remember you even though it remembers nothing at all. It’s a long one (almost 39 minutes), so here’s the whole thing in order.
Turns, and the message that comes first
Ariel starts on the whiteboard with emojis. I send a smiley, the AI answers with a peace sign. I write “I’m hungry” (imagine a schnitzel), it answers with a tongue. Every message like that is a turn: a human message, then an AI message.
But before all of them comes the system prompt: the place where you tell the model who it is and how to behave. You usually send it once, at the start of the conversation. “You are a helper that explains things simply.” Then the human message: “explain it to me like I’m a 10-year-old.”
To make it tangible, Ariel duplicated the course script and played with the system prompt. Without it, the answer came back as four or five paragraphs with a title. With “You are a one-line bot, you must answer only in one line,” it answered in one line. With an “emoji bot” prompt, it answered in emojis. And when he then asked it to “answer me with words,” it refused. That’s the point of a system message: the model treats it as the rules, tries to keep its content hidden from the user, and enforces it over the user’s own requests. It’s the same idea organizations rely on with tools like Copilot.
Four models, one question, very different bills
The next course example sends the same question to several models in a loop (a quick note for non-programmers: a for loop simply runs over every item in a list). The course asks “what is recursion, in one sentence.” Ariel swapped in his own setup of four models, from two heavyweight reasoning models down to GLM Flash and an old GPT Turbo, and then, because recursion is boring, a deliberately spicy political question. The cheap old model answered briefly, the stronger ones started actually expressing opinions, and one heavyweight disagreed with the question’s premise so firmly that Ariel promptly labeled it a leftist.
The real lesson was the numbers:
- Cost: each heavyweight took about 8 cents for that one question. GLM Flash cost less than two thousandths of a cent, and the old GPT Turbo around eight thousandths.
- Time: about 30 and 25 seconds for the heavyweights, 13 for GLM Flash, 4 for GPT Turbo. The longer it takes, the more the model “thought” before answering.
So picking a model is a trade-off between quality, price and speed, and you can see all three with a few lines of code.
A side question from the class: what should you use to translate a 400-page book from English to Hebrew? Ariel’s options: Google Translate, a model that specializes in Hebrew, or one of the major models.
The model has no memory. The array does.
Here’s the core idea of the lesson. The model doesn’t remember anything between requests. On the first call you send the system prompt and your message, and you get an answer. On the second call you send the system prompt, your first message, its first answer, and your new question. And so on. The whole history goes back every single time. That’s why long chats burn more and more tokens, and it works this way with every AI chat you’ve ever used.
To read the code, Ariel stopped for three programming concepts:
- Parameter: holds one simple piece of information. A number, a name like “Ariel,” a date, or a very long story. Long, but still simple.
- Object: holds several parameters inside it (and can hold other objects, but at the bottom there are always parameters).
- Array: square brackets, a known, ordered list of things, position 0, 1, 2 and so on.
And because someone asked: let (or the older var) defines a value you can change later. const defines a constant: once set, you can only read it, and trying to change it throws an error.
In the course code there’s an array called messages. You call the model with it, print the answer, then push the AI’s answer into the array, push your next question, and call again.
The clown demo, and the bug that proved the point
Ariel made his own version. System prompt: “You are a clown.” Question one: “What do you do?” (I laugh, jump, juggle). Question two: “Answer me in emojis,” and it did, with a clown, a circus, juggling and cars, all matching what it said before. Question three: “Give me a simple one-line joke.” Why did the clown bring a ladder to the circus? Because he heard the show would be uplifting. (Badum-tss, requested on the recording.)
Then he added a fourth question: “Summarize the whole conversation.” The summary mentioned the clown and the emojis and… no joke. Why? Because when he duplicated the code for round three, he printed the answer but forgot to push it into the array. As far as the model knew, the joke never happened. Add that one line, run again, and the summary covers all three rounds.
That’s the lesson in one bug: the model only knows what you send it. Miss one message, and it’s gone.
Streaming: don’t make the human wait
So far every call used invoke: do everything, return when ready. Wait, wait, boom, full answer. The course then switches to stream, where the answer comes back in chunks and prints as it arrives, like a video that starts playing before it finishes downloading. Ariel printed the chunks themselves to show what’s inside: sometimes a whole word, sometimes half a word, sometimes a longer piece.
When to use it? Humans have no patience. Streaming shows them that something is happening.
Temperature and max tokens
Temperature controls how creative the model is. At 0 it gives the most predictable answer; near 1 it gets creative. The course loop asks for a one-line headline for a time-travel story, twice per temperature. With Haiku at 0, the two answers were almost identical. At 1 they started to differ. Switching to Opus with more temperature steps showed the same pattern more clearly. The practical rule that came out of the class: high temperature for creative work, zero for something like mapping an Excel file. Ariel’s advice: don’t play with it too much.
Max tokens is not “give me a short answer.” It’s a hard ceiling. Ariel set it to 10 and asked for a five-paragraph explanation of machine learning, and the answer was simply cut off mid-sentence. The point is to cap costs.
The course also shows that you can choose the model dynamically in code, so you’re not locked to one.
Errors and costs, like a grown-up
Three error codes you’ll meet when calling an API:
- 401: bad key (the very error they hit at the start of the lesson). Ariel put in an invalid key on purpose to show it.
- 429: you’re sending too much and passed your usage limit.
- 500: a problem on the provider’s server.
His rule: if something fails, try three times, then stop. And write code that catches the error and handles it instead of crashing.
Finally, cost tracking. Each response tells you how many tokens went in and out (in his run: 23 sent, 92 received, 115 total), and since you know the model’s price list, you can calculate what every request cost. That’s where it becomes a business question. One easy saving: don’t resend the entire history forever. Send the last 10 messages; it doesn’t need 100,000 messages back.
The session ended with a news item: a frontier model managed to write and improve an AI model by itself, which Ariel thinks could change how people build small specialized models. He promised a separate video on it, then the usual close: subscribe, share with at least one friend, and the community and discount links are in the description.
๐ฅ Roast Corner
Let’s appreciate the scientific method on display here. The course says: ask four models “what is recursion.” Ariel says: boring. Let’s ask four AIs a political question, in Israel, on a recording. Sixteen cents later, the models gave four different opinions, and the only thing that came back unanimous was the bill. The fastest answer took four seconds and cost a fraction of a fraction of a cent. The slowest took thirty seconds and cost eight cents, and Ariel called it a leftist. Congratulations, you have now spent real money to recreate a family dinner.
Then the clown demo, my favorite moment in the series so far. The entire lesson is “the model has no memory, you have to remember for it.” And then the model faithfully summarizes the conversation and leaves out the joke, because the one who forgot was the human. The AI didn’t hallucinate. It was the only participant who was paying attention. Ariel, if you ever wonder why your agents keep asking clarifying questions, this is why. They’ve seen your array.
๐ค AI for Humans
This lesson is all about a model learning from patterns in data. Here’s a model that reads patterns in heat, and it might save people’s feet. Researchers from RMIT University, the University of Melbourne and the aged-care provider Bolton Clarke built THERMUL, a smartphone-based AI tool that predicts whether a diabetes-related foot ulcer is likely to heal, using a thermal image taken the first time the patient comes in.
Diabetes affects over 500 million people, and about a third will get a foot ulcer at some point, which can lead to infection, hospitalization and amputation. Normally clinicians wait about four weeks of treatment to judge whether an ulcer is healing. In a study with 110 patients at Austin Health and St Vincent’s Hospital Melbourne, the team trained the model on heat patterns of ulcers that healed and ones that didn’t, so clinicians can spot the risky ones much earlier and escalate care. Because it’s a portable, non-contact tool, it could bring specialist-level decision support to people in rural and remote areas who can’t easily reach a diabetes foot clinic. It’s still going through validation, now funded to test it in metropolitan, regional and remote services. Source: RMIT University.

๐ฌ Comments