Phase 1 · Building with LLMs · Prompting
Conversations and memory
APIs are stateless: how chat history and memory really work.
Open this lesson Create a free account
Why it matters
Chat is the most familiar shape for an AI product, and it rests on a fact that surprises most people: the model remembers nothing between requests. The memory you experience in a chat app is code resending the conversation every turn. Once you manage that history yourself, you control what the model sees, what it costs, and what your app remembers about a user, and you can build any multi-turn feature, from a copy assistant to an agent.
What you'll be able to do
- Keep a conversation going by appending each turn to a history list and resending it
- Explain why long conversations get slower and more expensive, and trim history to a budget
- Tell conversation history apart from long-term memory and from business data
- Build a small chat helper that manages its history
Before this lesson
Next in this phase: Images and documents