Language models don't remember between requests. Any memory an agent has is provided by its harness.
Kinds of Memory
- Working memory: the current context — task, recent steps, tool results.
- Task notes: plans, progress and findings written to files so they survive compaction or restarts.
- Long-term memory: facts and preferences kept across sessions — a user's coding style, project conventions, past decisions.
- Knowledge retrieval: searching documents or past conversations when needed.
Implementation Patterns
- Files the agent reads at the start of each session (project instructions, notes).
- Memory tools the agent calls to save and recall facts.
- Retrieval over past work using search or embeddings.
Writing Good Memories
Store durable, useful facts with enough context to be understood later. Avoid saving temporary details, duplicates or information already available elsewhere.
Keep Memory Accurate
Memories go stale. Include dates, verify before relying on remembered facts, and update or delete outdated entries.
Privacy and Control
Users should be able to see, edit and delete what an agent remembers about them. Don't store sensitive data unnecessarily.
Guard Against Poisoning
Content an agent reads can try to plant false memories. Be cautious about writing memories derived from untrusted sources.