Two Ways to Give an Agent Memory
The MCP note's memory server is a tool: decisions, naming, and constraints, saved locally and retrieved later. OpenClaw's memory is Markdown in the workspace, loaded at session start, plus a flush that writes to disk before compaction. One is a server in the tool list. The other is files.
Two Ways to Give an Agent Memory
A short linking note. It only connects what the longer posts already say.
Two notes describe memory that is still there after the tab closes. They store different things, in different places.
The MCP note puts a memory server fifth. The setup snippet runs mcp-memory-keeper. It stores architectural decisions, naming conventions, stack preferences, and project constraints. The model saves context on its own and retrieves it when that context is relevant. The files stay on the machine. The example is a multi-week refactor: the assistant still knows the project uses Inversify, a service naming pattern, and which legacy APIs to avoid. The note does not describe a file format. Memory is a tool the model calls.
OpenClaw is the files themselves. They live in ~/.openclaw/workspace/. memory/YYYY-MM-DD.md is the daily log. MEMORY.md is the curated long-term file. AGENTS.md, SOUL.md, and TOOLS.md load at the start of a session, with today’s and yesterday’s daily notes. You can open them, edit a wrong line, and git-track the folder. Search sits on top: memory_search for the hybrid index, memory_get once you know the path. That weighting is lined up with production RAG in Hybrid search keeps showing up.
The flush is the part the harness note treats as a hook, not as a second product. Before compaction summarizes old messages, a silent turn writes what should survive to memory/YYYY-MM-DD.md. The reply is suppressed with NO_REPLY. Then compaction runs. The default soft threshold is 4000 tokens before the limit. One flush per compaction cycle. A read-only workspace skips it. Compaction is lossy on purpose. The flush is the copy that is not the summary.
So the MCP server is a tool in the list. OpenClaw is the workspace, and the harness decides when a write happens. The MCP note’s update records the 28 Jul 2026 spec: the protocol core is stateless, and a server that needs state across calls is told to mint an explicit handle and pass it back as a tool argument. OpenClaw’s handle is the file path. The map from the loop to that hook is From loop to harness.
ciao