A chat with a model looks like it remembers what you said, but nothing on the
model's side is keeping notes. Every request starts from zero. The trick is
that a conversation is just the messages list from the last topic, grown one
turn at a time.
You already know a request carries a messages list where each entry is a
role and its content. A single turn holds one user message. To continue the
conversation, you do two things and re-send the whole list:
assistant message.user message after it.After two turns the list looks like this:
"messages": [
{"role": "user", "content": "What's a good language for a first web scraper?"},
{"role": "assistant", "content": "Python is a solid choice - it has requests and BeautifulSoup."},
{"role": "user", "content": "Show me the install command for those two."}
]
The third message says "those two" and never names the libraries. The model answers correctly anyway, because the earlier turns are sitting right there in the list it receives. The history you send IS the memory.
Leave out the earlier messages and the model has no idea what "those two" means. It never stored your first question. Each call is independent, so every time you want continuity you resend the full running list. A chat app does exactly this behind the scenes - it keeps appending to the array and posting the whole thing on every turn.
Next: that growing list can't grow forever. The limit on how much it can hold is the context window.
Your lab setup
This VM comes preconfigured with your AI keys - just type claude to get started. Your key and URL are already set as $OPENAI_BASE_URL and $OPENAI_API_KEY.