AI agents are stateless by default. Every time a session ends, the context is gone. Memoryz solves this by giving your OpenClaw agent a persistent, human-readable memory system -- an Obsidian-style markdown vault with automatic capture, recall, and tiered lifecycle management. Memories are organized across Hot, Warm, and Cold tiers so the agent always has fast access to recent context while older knowledge gracefully ages into long-term storage.
- OpenClaw installed and running
- Node.js 18+
git clone https://github.com/nicepkg/memoryz.git
cd memoryznpm install
npm run buildopenclaw plugins install ./memoryzFor development (symlink mode -- reflects source changes immediately):
openclaw plugins install --link ./memoryzAdd the following to plugins.entries.memoryz.config in your ~/.openclaw/openclaw.json:
{
"vaultPath": "~/.openclaw/memoryz",
"summarizer": {
"provider": "rules"
},
"tiers": {
"hotMaxAge": 7200000,
"warmMaxAge": 604800000,
"coldArchiveAge": 2592000000,
"hotMaxNotes": 50
},
"recall": {
"enabled": true,
"maxPointers": 5,
"maxTokens": 800
},
"capture": {
"enabled": true,
"minLength": 20,
"maxPerTurn": 3
},
"consolidateIntervalMs": 1800000
}openclaw restart
openclaw plugins info memoryz
openclaw memoryz statusIf everything is working, you should see per-tier note counts in JSON format.
| Operation | Trigger | Description |
|---|---|---|
| CAPTURE | After each turn (agent_end) |
Extracts important info from conversation and saves as hot/ notes |
| RECALL | Before each turn (before_prompt_build) |
Searches relevant memories and injects them into system context |
| CONSOLIDATE | Periodic (agent_end, throttled) |
Moves notes across Hot > Warm > Cold tiers, merges duplicates, adds wikilinks |
| FORGET | Manual or CLI | Archives notes with 30+ days of no access and no links |
<vault-path>/
├── hot/ # Recent memories (accessed within 2 hours)
│ └── INDEX.md # Auto-generated, injected into recall context each turn
├── warm/ # Medium-term memories (2 hours - 7 days)
├── cold/ # Long-term memories (7 - 30 days)
├── archive/ # Archived (30+ days, forget target)
└── _index/
├── entities.json # Entity index
├── tags.json # Tag index
└── access-log.jsonl # Access log
Each note is composed of YAML frontmatter and a Markdown body.
---
id: a1b2c3d4e5f6
type: fact
tier: hot
created: 2026-03-09T12:00:00.000Z
last_accessed: 2026-03-09T12:00:00.000Z
access_count: 1
source_session: explicit
entities: [OpenClaw, Memoryz]
tags: [plugin, memory]
access: public
---
# Memoryz is a persistent memory plugin for OpenClaw
Uses an Obsidian-style markdown vault with
hot/warm/cold tiers for automatic memory management.Frontmatter Fields:
| Field | Type | Description |
|---|---|---|
id |
string | 12-character UUID-based unique ID |
type |
enum | event, fact, preference, decision, entity, insight |
tier |
enum | hot, warm, cold |
created |
ISO 8601 | Creation timestamp |
last_accessed |
ISO 8601 | Last access timestamp |
access_count |
number | Access count |
source_session |
string | Session key that created this note (or "explicit") |
entities |
string[] | Related entities |
tags |
string[] | Tags |
access |
enum | public or owner-only |
Once the plugin is registered, the agent has access to these tools:
| Tool | Description |
|---|---|
memoryz_search |
Search the vault (weighted entity/tag/fulltext). Params: query, tier?, limit? |
memoryz_read |
Read a specific note in full. Params: path |
memoryz_remember |
Explicitly store a memory ("remember this"). Params: text, entities?, tags?, access? |
memoryz_forget |
Delete a memory note. Params: path |
memoryz_status |
Vault statistics (note counts per tier, recent access log) |
openclaw memoryz search <query> # Search the vault
openclaw memoryz search <query> --limit 20 # Limit results
openclaw memoryz status # Per-tier stats (JSON)
openclaw memoryz consolidate # Manual consolidation
openclaw memoryz forget --stale # Archive stale notesAll settings live under plugins.entries.memoryz.config in your openclaw.json.
| Key | Type | Default | Description |
|---|---|---|---|
vaultPath |
string | required | Path to the vault directory |
consolidateIntervalMs |
number | 1800000 (30 min) |
Minimum interval between consolidations (ms) |
accessControl |
boolean | false |
Enable owner-only access filtering |
| Key | Type | Default | Description |
|---|---|---|---|
provider |
enum | "agent-model" |
"rules", "openai-compatible", or "agent-model" |
baseUrl |
string | -- | OpenAI-compatible API URL (required for "openai-compatible") |
model |
string | -- | Model name (required for "openai-compatible") |
apiKey |
string | -- | API key (required for "openai-compatible") |
Provider Comparison:
| Provider | Description | Cost | Latency |
|---|---|---|---|
rules |
Rule-based extraction, no LLM needed | 0 | <10ms |
openai-compatible |
Any OpenAI-compatible API (vLLM, Ollama, OpenAI, etc.) | varies | ~1s |
agent-model |
Auto-detects API keys (Anthropic, OpenAI) and uses the cheapest available model | low | ~1s |
| Key | Type | Default | Description |
|---|---|---|---|
hotMaxAge |
number | 7200000 (2h) |
Notes accessed within this window stay in hot |
warmMaxAge |
number | 604800000 (7d) |
Notes accessed within this window stay in warm |
coldArchiveAge |
number | 2592000000 (30d) |
Notes older than this become archive candidates |
hotMaxNotes |
number | 50 |
Maximum notes in hot tier |
| Key | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
Enable automatic recall |
maxPointers |
number | 5 |
Max note pointers returned per recall |
maxTokens |
number | 800 |
Token budget for recall context injection |
| Key | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
Enable automatic capture |
minLength |
number | 20 |
Minimum text length to capture (chars) |
maxPerTurn |
number | 3 |
Max notes captured per turn |
Config string values support ${VAR} patterns resolved from environment variables.
Allowed variables: HOME, USER, OPENCLAW_MEMORYZ_VAULT_PATH.
{
"vaultPath": "${HOME}/.openclaw/memoryz"
}To run Memoryz across multiple machines, install the plugin on each node individually.
# 1. Copy the source to each node
for host in <node1> <node2> <node3>; do
scp -r ./memoryz user@${host}:~/memoryz
done
# 2. Install on each node
for host in <node1> <node2> <node3>; do
ssh user@${host} 'openclaw plugins install ~/memoryz && openclaw restart'
doneReplace <node1>, <node2>, <node3> with your target hostnames or IP addresses, and user with the appropriate SSH user.
Notes:
- Each node maintains its own local vault (vaults are not shared via NFS or network mounts).
- Cross-node memory sharing is handled via inter-agent communication (A2A).
npm install # Install dependencies (including devDependencies)
npm run build # TypeScript build
npm test # Run tests (vitest)
npm run test:watch # Watch mode- Runtime:
@sinclair/typebox0.34.48,openai^6.27.0 - Dev:
typescript^5.8.0,vitest^3.0.0,@types/node^22.0.0
┌─────────────────────────────────────────────────────────┐
│ OpenClaw Agent │
│ │
│ before_prompt_build ──┐ ┌── agent_end │
└────────────────────────┼──────┼────────────────────────┘
│ │
┌─────▼──────▼─────┐
│ Memoryz │
│ │
│ ┌────────────┐ │
│ │ RECALL │◄─┼── context injection
│ └────────────┘ │
│ ┌────────────┐ │
│ │ CAPTURE │──┼── memory storage
│ └────────────┘ │
│ ┌────────────┐ │
│ │ CONSOLIDATE│──┼── tier migration/merge
│ └────────────┘ │
│ ┌────────────┐ │
│ │ FORGET │──┼── archive
│ └────────────┘ │
└────────┬─────────┘
│
┌────────▼─────────┐
│ Markdown Vault │
│ │
│ hot/ warm/ │
│ cold/ archive/ │
│ _index/ │
└──────────────────┘
│
┌────────▼─────────┐
│ Summarizer │
│ (rules / openai-compatible) │
└──────────────────┘
Memoryz does not replace existing memory plugins. It registers with kind: null and can coexist with them.
| Plugin | Approach | Characteristics |
|---|---|---|
memory-core |
File-based search | Built-in to OpenClaw |
memory-lancedb |
Vector DB semantic search | Requires embeddings |
| memoryz | Markdown vault | Human-readable, structured, tiered memory |
MIT