Memory is the difference between an AI agent that learns and one that loops forever making the same mistakes. Without persistent memory, every session starts from zero. With proper memory, your agent becomes genuinely useful over time.
The LLM decides what's worth remembering. Important context slips through. Critical decisions vanish. Six months of work disappears because no one explicitly saved it.
You have a memory file. The agent never reads it. It answers from context instead of searching memory. The information exists but might as well not.
Long sessions trigger summarization. Older messages get compressed or removed. Anything not explicitly saved to a file is gone forever.
Raw notes of what happened each day. Create memory/YYYY-MM-DD.md for every day the agent runs. Write immediately—don't wait until end of session.
# 2026-02-26
## Tasks Completed
- Fixed redirect issue on clawdiator.com
- Published 3 articles (AI immune system, memory systems, consulting guide)
- Email poller running every 15 min
## Decisions
- Chose to implement Layer 3 verification first (highest impact)
- Deferred pricing page redesign until MRR > $5000
## Issues
- Cron job failed silently at 2am (needs watchdog)
MEMORY.md is your long-term store. This isn't raw logs—it's distilled wisdom. Update it weekly by reviewing daily logs and extracting what matters.
# MEMORY.md — Curated Wisdom
## Key Decisions
| Date | Decision | Rationale |
|------|----------|-----------|
| 2026-02-26 | Immune system first | Prevents silent failures |
| 2026-02-25 | Daily logging mandatory | Context compaction is real |
## Critical Lessons
- Always verify filesystem before marking task complete
- Context compaction destroys unsaved information
- Feedback loops prevent amnesic loops
Every approval and rejection gets logged with a reason. Store in feedback.json:
{
"decisions": [
{
"timestamp": "2026-02-26T08:00:00Z",
"action": "article_publish",
"topic": "AI immune systems",
"approved": true,
"reason": "High-value, SEO-optimized, fills content gap"
},
{
"timestamp": "2026-02-25T14:00:00Z",
"action": "social_post",
"content": "Generic hype tweet",
"approved": false,
"reason": "Too promotional, no value add"
}
]
}
For larger deployments, add vector-based memory search. This lets the agent find relevant past decisions without reading every file. Tools like qmd provide local BM25 + vector search.
Before answering ANY question about prior work, decisions, people, or preferences:
memory_getEvery session should begin with a consistent memory load:
1. Read SOUL.md — Who am I?
2. Read USER.md — Who am I helping?
3. Read memory/YYYY-MM-DD.md (today + yesterday) — Recent context
4. If main session: Read MEMORY.md — Long-term memory
This prevents the "fresh start" problem where agents forget everything from previous sessions.
Weekly, during a heartbeat:
Think of it like a human reviewing their journal and updating their mental model.
Get a complete memory system configured for your AI agents.