Agent Memory Systems: How to Make AI Remember Preferences and Context
Ever had an AI forget everything you discussed last month? You restart a project, explain all the context again, and it's like starting from zero. That experience is the root cause of AI's biggest capability gap: if an agent can't remember past interactions, it will always be a "one-off tool" — never a "personal assistant." Memory systems aren't a nice-to-have. They're the divide between "usable" and "genuinely helpful."
Memory systems need to solve three different time-scale problems. Current session continuity (seconds to minutes): the last three sentences must be accessible. Cross-session relevance (days to weeks): last week's decisions affect this week's tasks. And user preference persistence (months to years): your code style preferences, output format habits, and decision-making tendencies.
Three mainstream approaches exist. The simplest is note-taking: the system extracts key information during normal conversations and writes to a local file. Say "I prefer Python over Node" once, and the agent writes that preference to the user profile file. At session start, it reads the file and adjusts behavior. The advantage: transparency. You can open the file and see exactly what the agent remembered — and delete anything you don't want stored. The disadvantage: coarse granularity. When to remember, how to resolve conflicts — all hardcoded in rules.
The second approach is vector memory: historical conversations get embedded and stored in a vector database. At session start, semantic search retrieves the most relevant historical information. We ran controlled experiments at different granularity levels: storing every individual conversation was too fragmented; storing weekly summaries lost too much detail. Daily memory nodes proved the best balance — regardless of how many conversations occurred in a day, only that day's summary gets stored. Time-decay weighted retrieval ensures recent context ranks higher.
The third approach is structured knowledge graphs: entities, events, decisions, and preferences are organized as nodes and relationships. "Qin Ce manages KAIHE content operations" and "KAIHE A1 targets Mac Mini as an AI development machine" — the agent can infer: "Qin Ce might be interested in AI development machine performance comparisons." The most intelligent approach, but also the most expensive to build and maintain. Still experimental.
Three practical recommendations. Don't store raw chat logs — store decision outcomes plus context summaries. Chat history has low information density; summaries don't waste context window. Prune stale memories regularly — not all memories deserve permanent storage. Technical evaluations from three months ago are probably irrelevant. Give users an "erase what I just said" operation — the ability to delete specific memories is more important than memory itself.
The ultimate goal isn't storing more. It's remembering what matters, forgetting what doesn't. Sounds simple. It's not. The best current approach is "summarized vector memory plus local file persistence" — which is exactly OpenClaw's LCM design.