A truly useful AI assistant needs to remember who you are. Your preferences, your habits, the details you've shared across dozens of conversations. Without memory, every interaction starts from zero.
Building memory into an LLM system sounds straightforward until you try it. Loading memories is easy. Knowing which memories to load when you have thousands? That's where things get complicated. And what happens when a user's preferences change, or they tell you something that contradicts what you stored last month? Suddenly you're not just adding memories, you're managing a living database that needs to update, correct, and prune itself over time.
This workshop takes you through the complete journey of building a production-ready memory system using AI SDK. You'll start simple and progressively tackle the harder problems that real memory systems face. You will:
- Load and format memories from a database, injecting them into your system prompt so the LLM can reference past conversations
- Extract permanent memories from conversations using generateObject(), writing prompts that distinguish lasting preferences from temporary context
- Extend your memory schema to support updates, deletions, and additions, handling the case where "permanent" facts about users change over time
- Refactor memory extraction into a tool call, giving the LLM agency to decide when memories actually need updating instead of running extraction on every message
- Implement semantic recall using hybrid search (embeddings + BM25) to retrieve only the most relevant memories for each conversation
By the end of this workshop, you'll have a memory system that learns about users, evolves as their preferences change, and scales beyond the naive "load everything" approach. You'll have the foundation to eval and tune your memory extraction for production use.