OpenClaw Agent Memory in 2026: AMP, Engram, and the 3 Patterns That Actually Work
In the past 24 hours three OpenClaw memory threads landed at once: a beginner on r/AskClaw asking “how does memory even work?”, an AMP-on-MCP spec proposal on r/openclaw, and an Engram hybrid-memory release cross-posted to r/openclaw and r/clawdbot. Memory is the bottleneck builders keep hitting — once your agent runs more than a few times, it needs to remember something. The good news is that the patterns have stabilized in 2026. There are three that actually work, and most production OpenClaw agents pick one of them.
This post is the honest breakdown of those three patterns — file-based, SQL-backed, and hybrid vector — with the tradeoffs each one ships with, when it wins, and which CrewClaw templates already use them. The goal is to leave with the right pattern picked for your next agent, not a tour of every memory paper from the last year.
Why Agent Memory Is the Bottleneck
LLMs are stateless. Every call is a fresh shot — no memory of the last message, no memory of yesterday's task, no memory of who the user is unless you stuff it into the prompt. That works for chat. It breaks the moment you want an agent that does something useful over time: a CRM that remembers contacts, an inbox handler that knows which threads it already triaged, a daily briefing that builds on yesterday's notes.
The naive workaround is to dump everything into the context window. That fails for three predictable reasons: context limits cap you somewhere between 100k and 1M tokens, every token costs money on every call, and the model gets worse at long contexts faster than the marketing claims. Without persistent memory, the agent repeats work, re-asks the user the same questions, and loses any sense of progress. Memory is what turns “chat with steps” into an agent.
Pattern 1: File-Based Memory
The shape: A folder next to your agent — usually memory/, dreams/, or wiki/ — with one JSON or Markdown file per session, per topic, or per day. The agent appends on write and tails the last N entries on read.
Free
No database, no embedding bill, just disk.
10 min
Create folder, append on write, read on start.
Low
Grep and recency-tail. No semantic search.
100s
Fine for hundreds of agents, thousands of entries.
When it wins: Solo dev. Single-agent setup. Append-only logs where you mostly care about the last few entries plus a long tail you occasionally grep. Personal tools where the “query” is “what did I say to this contact last week.” You can read the memory by opening files in your editor — that alone makes debugging an order of magnitude faster than any database-backed pattern.
Sample folder structure:
agent/
memory/
contacts/
anna-chen.md
marco-rossi.md
sessions/
2026-05-22-morning.md
2026-05-21-evening.md
wiki/
preferences.md
project-status.mdThe Personal CRM template in the CrewClaw library uses exactly this pattern. One Markdown file per contact, appended on each interaction, tailed when you ask “what's the latest on Anna.” The Daily Briefing template ships the same pattern but indexed by date instead of contact.
Pattern 2: SQLite or Postgres Memory
The shape: A real database with tables for the entities your agent reasons about — messages, threads, tasks, contacts. Reads are SQL queries, writes are inserts and updates. SQLite for single-process agents, Postgres when more than one agent needs the same memory.
~$0-5
SQLite free; Postgres on the same VPS pennies.
30-60 min
Schema design, migrations, query helpers.
High
Joins, aggregates, indexes, time-range filters.
Millions
Millions of rows on a single $5/mo box.
When it wins: You need structured memory — “show me every task assigned to this contact this month,” “count unhandled threads by sender,” “list all sessions that ended in an error.” Multi-agent setups where two or three agents need to see the same state. Audit trails where you genuinely want to know what the agent did and when. SQL is the right tool for any memory question that includes the word “count,” “group,” or “since.”
Sample schema:
CREATE TABLE threads (id TEXT PRIMARY KEY, subject TEXT, sender TEXT, last_seen_at TIMESTAMP, status TEXT);
CREATE TABLE messages (id TEXT PRIMARY KEY, thread_id TEXT, role TEXT, body TEXT, created_at TIMESTAMP);
CREATE TABLE tasks (id TEXT PRIMARY KEY, thread_id TEXT, summary TEXT, due_at TIMESTAMP, done_at TIMESTAMP);
CREATE INDEX idx_threads_status_last_seen ON threads(status, last_seen_at);The Inbox Zero template uses SQLite for thread tracking — it needs to know which messages it has already triaged and which need a second pass, and that question is much cleaner in SQL than in a folder of Markdown. The Project Manager (Orion) template uses the same backing store for task state across multiple coordinated agents.
Pattern 3: Vector Store Plus Hybrid (Engram-Style)
The shape: A vector database for semantic recall — “find the past notes most similar to this question” — paired with a relational layer for structured metadata. Engram is one packaged take on this pattern; pgvector with Postgres is the do-it-yourself version. The hybrid layer is what saves it from the failure modes of pure-vector recall.
~$5-50
Embedding API plus a small DB host.
2-4 hrs
Embedding pipeline, vector DB, hybrid query layer.
Semantic
Top-K similar chunks; filter by metadata.
Big
Tens of millions of chunks with right index.
When it wins: Long-context recall where the question and the relevant memory do not share keywords. Semantic search across a big corpus — research notes, past customer threads, ingested documentation. Multi-modal memory where you store transcripts, images, and structured records side by side. Anything where “remember the conversation about pricing tiers from last quarter” needs to actually find that conversation without you knowing the date.
The Newsletter Writer template uses this pattern for source recall — it ingests articles, tweets, and notes throughout the week and retrieves the most relevant chunks when it drafts the next issue. Pure vector would surface near-duplicates; the relational layer keeps it honest by filtering on freshness and source type.
On AMP: The Agent Memory Protocol thread that landed on r/openclaw this week proposes a layer on top of MCP that standardizes how agents read and write to a memory store. The pitch is that memory becomes a portable resource — the same way MCP made tools portable across clients. It is still a draft spec. The shape is interesting because most agent frameworks today reinvent their own memory API; a common protocol would let you swap backends without rewriting the agent.
Hybrid versus pure vector: Pure vector retrieval has two well-known failure modes — it pulls semantically similar but factually wrong chunks, and it ignores structure that would have made the answer trivial (“tasks due this week” is a SQL query, not a similarity search). The hybrid pattern uses the relational layer for any question that can be answered by metadata, and falls back to vector only for the semantic tail. That single rule cuts retrieval errors more than any embedding-model upgrade.
The AMP and MCP Angle
AMP is worth understanding even if you do not adopt it today. MCP — the Model Context Protocol — solved a real problem: every agent framework used to invent its own tool-calling API, which meant connecting an agent to a new tool was bespoke work each time. MCP made tools portable. An AMP-shaped layer would do the same thing for memory: an agent declares which memory it wants to read or write, and the framework brokers that call to whatever backend (Engram, pgvector, Qdrant, file system) the user has configured.
The honest read: AMP is early. The spec might change. No major framework has adopted it as of May 2026 — the OpenClaw thread is a proposal, not a release. The reason to care now is positioning, not production use. If you build your next agent with a clean separation between “the memory API the agent calls” and “the backend the API talks to,” you can swap to an AMP-compliant backend later without rewriting the agent. That is the cheap version of future-proofing.
The Memory Pattern Decision Tree
- First agent, solo dev, want it shipped today? → File-based. Open an editor, create
memory/, ship. - Need counts, time-ranges, joins, or audit? → SQLite — or Postgres if more than one agent reads it.
- Multi-agent setup with shared task state? → Postgres. SQLite locks become painful with parallel writers.
- Long-context recall over a corpus you cannot keyword-search? → Hybrid vector — Engram or pgvector plus relational.
- Building for portability across frameworks? → Keep the memory call site isolated and watch AMP, but pick a working backend today.
The cheapest mistake is overbuilding memory before the agent has earned it. Most agents that fail in week two fail because the builder spent the first week on a vector store the agent never needed. Ship file-based, upgrade when the queries you cannot answer pile up.
CrewClaw Templates That Ship With Memory Pre-Wired
Five templates in the CrewClaw library cover the three patterns end-to-end. Each one ships with the memory layer already wired into the generated package — no separate setup step.
| Template | Memory pattern | Why this fit |
|---|---|---|
| Personal CRM | File-based | One Markdown per contact, appended on every interaction. |
| Inbox Zero | SQLite | Thread status, last-seen, and triage history queryable by sender. |
| Daily Briefing | File-based | One Markdown per day. Yesterday's log feeds today's context. |
| Newsletter Writer | Vector / hybrid | Ingests sources weekly, semantic retrieval at draft time. |
| Project Manager (Orion) | SQLite | Task state shared across coordinated agents in the bundle. |
All five are listed alongside the rest of the library at crewclaw.com/agents. Each one downloads as a runnable package — memory schema, embedding pipeline, or folder layout already in place.
Skip the memory boilerplate — start from a template
$9 single agent, $19 starter (3 agents), $29 team (5 agents plus AGENTS.md coordination). One-time pricing, no subscription. Memory layer, schema, and folder structure pre-wired in every download.
FAQ
What's the simplest memory pattern for a first OpenClaw agent?
File-based. Create a memory/ folder next to your agent, append a JSON or Markdown entry per session, and read the last N entries back into context at the start of each run. No database, no embeddings, no spec to learn. The agent gets persistent state in about ten minutes of setup. The CrewClaw Personal CRM and Daily Briefing templates both ship this pattern out of the box — clone, run, and you have a working memory layer the same afternoon.
Can I switch from file-based to vector memory later?
Yes, and most builders do exactly that. The migration path is straightforward because file-based memory entries are already structured records — JSON or Markdown with timestamps. When you outgrow it, write a one-time script that walks the folder, embeds each entry, and inserts into your vector store of choice (Qdrant, Chroma, pgvector). The agent code changes are small: swap the read function from "tail the last N files" to "semantic search for top K relevant chunks." Plan the migration around the day your file count crosses a few thousand, not before.
Does AMP work with non-OpenClaw agent frameworks?
That is the explicit goal of the proposal — AMP is being designed on top of MCP, which is itself framework-agnostic. The pitch is that an agent built in CrewAI, LangGraph, or OpenClaw could all read and write to the same AMP-compliant memory store using a shared protocol. As of the May 2026 thread on r/openclaw, the spec is still a draft and no major framework has adopted it. Watch the repo, but do not bet a production system on AMP yet — the API surface will move before the first stable release.
Will OpenClaw natively integrate Engram?
There is no confirmation as of the Engram update thread on r/openclaw and r/clawdbot. Engram is a separate hybrid-memory project that pairs a vector store with a relational layer for structured recall. It is OpenClaw-compatible at the API level — you can wire it as an external memory backend today — but it is not bundled in the OpenClaw core. If you need hybrid memory now, treat Engram as one option among Qdrant-plus-Postgres or pgvector-plus-Postgres rather than waiting on a native integration that has not been announced.
How much disk space does a year of OpenClaw memory take?
Depends entirely on the pattern. A file-based agent logging one Markdown entry per day per channel uses 5-20 MB per year. A SQLite-backed agent storing every message plus metadata for a daily-active workflow lands in the 50-500 MB range. A vector-store hybrid with embeddings, source documents, and a relational index can hit 5-20 GB across a year of heavy use. A $5/mo VPS handles all three comfortably — disk is not the binding constraint, query latency and embedding cost are.
Deploy a Ready-Made AI Agent
Skip the setup. Pick a template and deploy in 60 seconds.
Or Get the Whole Team
Multi-agent crews pre-configured to work together. Cheaper than buying singles.
Automate Content Pipeline: 4-Agent SEO + Writing + Social Team
Automate content pipeline end-to-end with 4 AI agents that handle keyword research, drafting, scheduling, and social distribution for solo founders and lean teams.
AI DevOps Automation: 3-Agent CI/CD, Code Review, and QA Team
AI DevOps automation team that runs CI/CD monitoring, PR review, and regression testing on autopilot for solo developers and small startup engineering teams.