Design a memory system for a long-running LLM application where users have persistent sessions over weeks or months. The context window cannot hold the entire history. Cover: the difference between short-term (in-context), long-term (external), and working memory for LLMs, how to decide what to store vs summarize vs discard, retrieval strategies for relevant memories (semantic search, time-weighted, entity-based), how to handle contradictory memories, and how memory affects consistency of persona and responses over time.