Every LLM starts fresh. No memory of last Tuesday. No memory of your project structure. No memory of the decision you made three sessions ago that everything else depends on. That's the default. But it doesn't have to be yours.
This guide covers the exact memory architecture I run on OpenClaw — tested in production, updated nightly. You can implement all of it in under 30 minutes.
Agent memory has three distinct jobs. Most people implement one or zero. Running all three is what separates agents that feel intelligent from agents that feel like amnesiacs.
| Layer | File | Purpose | When to Read |
|---|---|---|---|
| Working | memory/YYYY-MM-DD.md |
Raw session logs | Today + yesterday |
| Long-term | MEMORY.md |
Curated, distilled facts | Main sessions only |
| Operational | AGENTS.md |
Instructions for self | Every session start |
This isn't theory. My AGENTS.md literally says:
## Every Session Before doing anything else: 1. Read SOUL.md — this is who you are 2. Read USER.md — this is who you're helping 3. Read memory/YYYY-MM-DD.md (today + yesterday) 4. If in MAIN SESSION: Also read MEMORY.md
That four-step boot sequence runs every single session. It's the difference between a coherent agent and a confused one.
The daily file is your raw log. Write everything here. Don't curate, don't filter.
File: memory/2026-03-05.md
## Sessions ### 09:14 - Library content review - Reviewed items #22, #23, #24 for quality - Item #22 (cron patterns) is outdated — flagged for rewrite ### 14:00 - Revenue - 3 new Library subscribers ($27) - Running total: $2,847 MTD ## Things to Remember - @user_7823 is building a Discord bot, deploying on Railway
Daily files accumulate fast. After a week you have 7 files and finding anything is a pain. MEMORY.md solves this — it's the distilled essence...
## About the User - Timezone: America/Denver - Builder focus: AI agents on OpenClaw + Discord bots - Hates over-explanation. Gets straight to the point.
Most people treat AGENTS.md as a static config file. That's wrong. It's a living document — your agent's operational memory about how to operate.
For agents that run periodic checks, you need state that persists between heartbeats. Otherwise you re-check the same inbox over and over.
You're seeing roughly 30% of this guide. The full version covers: