Multi-Turn conversations
Before we build anything of consequence, you must internalise an inconvenient truth: the Claude API remembers nothing.
No hidden transcript accumulates on Anthropic’s servers. If you want a conversation with memory, memory is your job.
Conversing with a Goldfish
In the previous lesson, we asked Claude: What is quantum computing?
Now follow up and ask it to “Write another sentence.”
Claude dutifully writes another sentence about migratory birds, perhaps, or the history of cheese. It has no idea what “another” refers to. From its perspective, this is the first thing you have ever said to it.
No quantum computing.
No context.
Just three words.
How Memory Works
- First, you must maintain the full list of messages yourself, in an ordinary array.
- Second, send that entire history along with every single request.
You send your initial user message. Then you take Claude’s reply and...