Most guides to AI agent memory jump straight to vector databases, embeddings, and RAG pipelines. But for most autonomous agents, that's massive overkill. Here's what actually works: plain markdown files.
I've been running an autonomous AI agent 24/7 for two months. It creates YouTube content, manages social media, debugs its own infrastructure, and ships code to GitHub. Its entire memory system is markdown files on a VPS.
Vector databases are great for searching large document corpora. But an autonomous agent doesn't need to search millions of documents — it needs to remember:
For this, a well-structured markdown file loaded at the start of each session beats a vector database. It's readable, editable, version-controlled, and costs nothing.
| File | Purpose | When Read |
|---|---|---|
MEMORY.md | Curated long-term memory | Every main session |
memory/YYYY-MM-DD.md | Raw daily logs | Today + yesterday |
SOUL.md | Personality + rules | Every session |
AGENTS.md | Startup instructions | Every session |
HEARTBEAT.md | Periodic checklist | Every hour |
KANBAN.md | Task board | Every heartbeat |
This is the core. Think of it as the agent's "brain dump" — facts, decisions, lessons, and context that matter across sessions. The agent reads it at the start of every main session and updates it when something important happens.
# MEMORY.md - Long-term Memory *Last updated: 2026-03-18* ## About the Human - Name: Rasit, Berlin timezone (CET) - Prefers: concise responses, no emojis, actionable next steps ## Key Technical Facts - YouTube upload uses youtubeuploader CLI + OAuth tokens - Token file: /root/clawd/media/youtube/request.token - NEVER change model config without verifying installed version supports it ## Lessons Learned - Terminal screen recording format: 70+ views/video (vs 10-20 with stock footage) - Winning title formula: specific product + test/comparison + dollar amounts - Pollinations TTS returning 403 since Mar 13 — use built-in TTS tool instead ## Current Projects - YouTube channel: @ghostferal, 104 videos, 8,600 views, 4 subs - Content pipeline: queue → SVG video → TTS → ffmpeg → upload ## Credentials & Paths [sensitive items stored separately in TOOLS.md]
Every session, the agent appends what it did to memory/YYYY-MM-DD.md. These are raw notes, not curated. They serve as short-term memory for recent events that haven't been promoted to MEMORY.md yet.
# memory/2026-03-18.md ## Morning heartbeat - YouTube token still dead (day 7) - Built context-window-calculator.html — live on GitHub Pages - Built svg-video-pipeline blog post ## Key decisions - Pivoting fully to website content while YouTube blocked - Not pinging Rasit again about YouTube — he knows
The key insight: don't treat MEMORY.md as an append-only log. That's a vector database in disguise. Instead, maintain it like a human's mental model:
The agent does this during idle heartbeats — it reads recent daily files and updates MEMORY.md with anything worth keeping. Takes about 5 minutes of context and has zero cost beyond inference.
For truly long sessions where context gets full, OpenClaw has a memory_search tool that does semantic search across all memory files. But in practice, the agent rarely needs it — if you write MEMORY.md well, the relevant context is always in the first 2,000 tokens.
The memory files aren't injected via a vector lookup — they're loaded directly into the context window at session start. This works because:
The total memory overhead is about 8-10k tokens per session. For a 200k context model, that's 5%. Completely manageable.
After 60+ days of continuous operation with this system, the agent:
All without a single vector database query.
This approach doesn't scale to everything. Use a vector database when:
For most autonomous personal agents, markdown files are plenty. Start simple.