Key Concepts
- 1**Context** (short-term): What happened in this conversation. Example: user said 'I have a $100 budget,' agent needs to remember that for the next 10 exchanges.
- 2**State** (session): Persistent data about the user's current shopping session. Example: items added to cart, filters applied, conversation history.
- 3**Memory** (long-term): Historical information about the user across sessions. Example: 'This user always buys organic,' 'They prefer Nike,' 'Allergic to shellfish.'
- 4Memory is a double-edged sword: it enables personalization (higher conversion) but creates data privacy and security risks. More memory = more breach exposure.
- 5In-context learning: You can give the agent context by putting it in the prompt. Example: 'User preferences: organic, vegan, budget $50.' The LLM reads this and reasons better. This is cheap (text in prompt) but limited by context window size (~4K-100K tokens).
- 6Vector databases (embeddings) allow long-term memory at scale. Instead of storing 10 years of history, you store embeddings of user preferences and retrieve only relevant ones. Semantic search: 'Find past purchases similar to what they're searching for now.'
- 7Privacy guardrails: Decide what to remember and what to forget. Example: remember purchase patterns, but forget credit card numbers. This requires careful system design.
Why It Matters for PMs
Personalization at scale: Memory is how you personalize 1M+ users. Without memory, every user gets generic recommendations. With memory, you're treating each user as an individual.
Compliance & privacy: GDPR, CCPA, and other privacy laws mandate that you can delete user data. If memory is baked into every decision, you can't anonymize without retraining. You need architecture that treats memory as separate, deletable, and auditable.
Cold start problem: New users have no memory. How do you personalize for them? Strategy: use short-term context (what they say this session) + cohort defaults (similar users' patterns) + light exploration (show variety, observe reactions).
Test Your Understanding
Question 1 (Multiple Choice)
What's the difference between 'context' and 'memory' in an agentic system?
Question 2 (Multiple Choice)
Why might an agent need both in-context learning AND a vector database?
Question 3 (Multiple Choice)
Under GDPR, if a user asks 'delete my data,' what must you do?
Question 4 (Short Answer)
How would you personalize recommendations for a brand-new user with zero purchase history?
Think about your answer before revealing the explanation.
Question 5 (Short Answer)
What data should an agent remember vs. forget for privacy/security?
Think about your answer before revealing the explanation.