📈 Machines That Talk · Day 5

Chat Gets Pricier Every Turn

Here's the thing nobody tells you: an AI has no memory, so to keep a conversation going, your app re-sends the ENTIRE chat every single turn. That means turn 10 pays for turns 1–9 all over again. Watch the snowball roll.

↓ start chatting
📈 Lab · The Snowball Chat

Every turn re-sends the whole chat

Press Send next message. Each turn, the AI re-reads everything said so far (that's the growing bill) and adds a reply. Watch the per-turn cost climb even though your messages stay small.

💸 Cost of each turn (re-sending everything so far):

🧮 This turn's input: 0 tokens
= system + everything said so far + your new message
🧾 Total spent so far: $0.00
0 turns
🐞 Break-It Challenge

Chatty vs. Efficient

Two people get the same help. One dribbles it out over 10 tiny back-and-forth turns; the other asks one clear question. Compare the bills!

🗣️ Chatty: —
🎯 Efficient: —
🏷️ The pro wordThe AI is stateless — it remembers nothing between calls. To fake memory, the app resends the whole conversation history every turn. So cost grows roughly with the square of the chat length: a chat twice as long costs about four times as much in total. That's why trimming old messages saves real money.
🎯 Boss Build · Beat the Budget

Get the answer for less

Goal: get help planning a party. You have a $0.02 budget. Choose a strategy and see if you come in under budget. Find the cheapest way that still works — solve it to win!

Budget: $0.02 · best so far: —
🚀 Beyond the Basics

How the pros really do it

Every serious AI app fights the snowball. Here's the toolkit, cheap trick to pro move:

🔁

Resend everything (the naive way)

Send the full history each turn. ✅ Simple, never forgets. ⚠️ Cost explodes as chats get long.

📝

Summarize old turns (the fix)

Compress old messages into a short recap. ✅ Big savings. ⚠️ Loses fine detail.

Cache the prefix (the pro move)

Reuse the unchanged start of the prompt at a discount. ✅ Cheaper & faster. ⚠️ Only helps repeated prefixes.

🏷️ Pro names to look upThe pattern is stateless models + resent conversation history. Money-savers: context compaction / summarization, prompt caching (KV-cache reuse), and sliding-window memory. Chat UIs hide the resend; the API makes you send it yourself.

🎉 Day 5 Complete!

You saw the snowball: because the AI is stateless, every turn re-sends the whole chat, so long conversations get expensive fast. Now you know why pros summarize, trim, and cache — and why one clear message often beats ten chatty ones.

Day 6: The Creativity Dial →
Next up: we leave money for a bit and play with the AI's creativity dial — same model, boring to bonkers. 🎛️
AI Adventure · Machines That Talk · Day 5 — made for young inventors 🚀