File-based memory compounds corrections across sessions
The simplest agent memory is a markdown file in the repo. The agent reads it at the start of every session and writes corrections to it during the session. Each fix persists; the model stops repeating old mistakes. This is the single highest-leverage habit for daily-driver agents.
File-based memory is deterministic: the same file produces the same context every time. It requires no infrastructure (no vector store, no database, no service). OpenCode Autolearn implements this for OpenCode: a plugin that observes corrections in real time, writes them to a memory.md loaded into every session, and escalates reinforced rules into AGENTS.md (see: persistent memory lets corrections compound). The tradeoff is that files cannot do semantic retrieval; the agent reads everything rather than searching for relevance. See an LLM wiki compounds where rag rediscovers.