🎒 Machines That Talk · Day 4

The Context Backpack

A chatbot has no real memory. Everything it "knows" in a chat has to be stuffed into one backpack it carries each turn — and the backpack has a size limit. Pack too much and stuff falls out. Meet the context window.

↓ start packing
🎒 Lab · Pack the Backpack

Everything the AI sees must fit in here

Tap a message to pack it into the backpack (or take it out). Each one has a token size. The AI can only "see" what fits under the limit. Change the model to get a bigger backpack!

Model backpack size:

🎒 Backpack fill (800 token limit):

0 / 800
Pack the messages you think the AI needs. Watch the meter — if you go over the limit, the oldest messages get dropped and the AI literally can't see them anymore.
🐞 Break-It Challenge

Overflow the backpack

Tap to jam a huge pasted article into the backpack on the tiny model. Watch what happens to your actual question at the bottom.

Whoa. When the input is bigger than the context window, the model can't read all of it. It either refuses, or silently drops the oldest part — so it "forgets" the start of your chat. That's why long conversations start losing track of what you said earlier!
🏷️ The pro wordThe size of the backpack is the context window, measured in tokens. Everything counts toward it: the system prompt, the whole chat history, any documents, AND the space reserved for the answer. When you go over, something has to give — and what happens depends on where you are: a raw API usually rejects the request, a chat app quietly drops or summarizes old messages (truncation), and a coding agent compacts old files and history. Either way, the window is working room, not permanent memory.
🎯 Boss Build · Smart Packing

Pack only what matters

The tiny backpack (800 tokens) can't hold everything. You MUST include the ⭐ starred messages and leave at least 150 tokens free for the AI's answer. Drop the junk, keep the gold. Solve it to win!

not solved yet
🚀 Beyond the Basics

How the pros really do it

Real chatbots fight the backpack limit every single turn. Here's how, from crude to clever:

✂️

Just cut the oldest (what you saw)

Drop the earliest messages when full. ✅ Dead simple. ⚠️ The bot "forgets" how the chat started.

📝

Summarize the past (the common trick)

Replace old messages with a short summary. ✅ Keeps the gist, saves tokens. ⚠️ Details get blurry.

🪟

Bigger windows (the frontier)

Models that hold 200K–1M+ tokens. ✅ Huge memory. ⚠️ Slower and pricier — attention cost grows fast.

🏷️ Pro names to look upManaging what stays in the window is context management (or memory management). Tricks include truncation, summarization / compaction, and sliding windows. Big-window models advertise a long context (e.g. 128K, 200K, 1M tokens).

🎉 Day 4 Complete!

You learned the context window — the AI's backpack. Everything it sees must fit: system prompt, history, documents, and room for the answer. Go over, and it forgets or refuses. This is why long chats drift and why "just paste the whole book" doesn't always work.

Day 5: Chat Gets Pricier Every Turn →
Tomorrow: since the whole backpack gets re-sent every turn, we'll watch a long chat's cost snowball. 📈
AI Adventure · Machines That Talk · Day 4 — made for young inventors 🚀