A narrated, hands-on workshop · ~60 min · for first-time builders

Your First AI App

Press play and I'll build a working chat app with you, right on this page, chapter by chapter — the messages array, the system prompt, the request, streaming, what it costs, and how to ship it. By the end, the app is yours: one HTML file you can send to anyone.

13 chapters · player controls live at the bottom
💬 The app we're building SIMULATED — canned replies, no AI yet
Honesty label: this chat starts in simulated mode — the replies are canned lines built into this page, not a real AI. In chapter 6 there's an optional field where you can paste your own Anthropic API key to flip every demo live. The badge above always tells you which mode you're in.

Ch. 1 / The anatomy ▶ narrated

An AI app is three parts. You already know two.

Strip away the hype and every chat app — including the billion-dollar ones — is an interface, a memory, and a rented brain. The first two are ordinary web-page material. The third arrives over the network.

🪟

Interface

A text box, a send button, and a list of bubbles. Plain HTML — the demo above is exactly this, and you can read its source.

// you build this
🧾

Memory

One JavaScript array called messages. Every word said, by you or the AI, gets appended to it. That array IS the conversation.

// you own this
🧠

Brain (rented)

The model. You never install it — you send your messages array over the network and rent a few seconds of its attention per request.

// you rent this
No servers, no database, no framework, no build step. Everything in this course fits in one HTML file — the same kind of file this page is.

Ch. 2 / The goldfish principle ▶ narrated

The model remembers nothing. Your app fakes the memory.

Every request starts from a blank slate. The "conversation" is an illusion your app creates by re-sending the entire history with every single turn.

🪟

Your page

keeps the messages array

📦

Every turn

sends the WHOLE array, from message one

🧠

Model

reads it fresh, replies once, forgets everything

Your page

appends the reply and waits for the next turn

This one fact explains half the API. Why long chats cost more (you re-send more each turn — chapter 8 computes it). Why you can edit history (it's just your array). Why losing the array loses the conversation. The array is the app.

Ch. 3 / First skill: the messages array ▶ narrated

Watch the array build itself while you chat.

Chat on the left. On the right, the actual JavaScript array your words become — updated live after every turn. This is the exact data structure a real request carries.

The chat simulated

const messages = … (live)

Do this now: send three messages and read the array after each one. Notice the two roles — "user" and "assistant" — strictly taking turns. You are looking at the complete memory of an AI application, in one variable you own.

Ch. 4–12 / Locked

That's the free preview.

You've heard the setup. The remaining 9 chapters are where Your First AI App actually gets built — the guardrails, the hands-on builds, the full narrated walkthrough and the end-of-workshop check.

Get the full workshop → See the catalog

One file. Yours forever. Works offline, in any browser, on any device.

Transcript

Now playing
Ready — press play to begin
0.95×
🎙