Install
openclaw skills install @mozz0/josh-learnsMemory system for AI agents on OpenClaw-like hosts. File-based multi-layer memory: fresh daily layer (5-day rotation), mesh graph, auto-log of every exchange, cross-layer grep search, compliance check, crash-gap recovery from session transcripts, automation-registry lookup. Search before answering, log after answering. Local-first, $0 to run, survives restarts.
openclaw skills install @mozz0/josh-learnsA local-first, file-based memory system for AI agents running on OpenClaw-like hosts. All state lives in plain Markdown + JSON on disk — no database server, no cloud dependency, no API cost. The bundled scripts are small, dependency-free Python (standard library + grep only).
Core philosophy: memory is files, not sessions. Sessions are ephemeral — they die on crashes, compaction, restarts, and reinstalls. Files survive all of those. If something isn't written to a file, it effectively didn't happen. This skill exists to make writing and finding those files automatic.
| Layer | Location | Purpose |
|---|---|---|
| Fresh | memory/fresh/today.md … 4-days-ago.md | Rolling 5-day window of recent context; read first at session start |
| Daily log | memory/YYYY-MM-DD.md | Timestamped record of every logged exchange, one file per day |
| Mesh graph | memory/mesh.json | Lightweight node/edge index with timestamps for long-lived topics |
| Rolling log | memory/LATEST.md | The most recent exchanges in one place |
| Checkpoints | memory/checkpoints/ | Crash-recovery snapshots (latest.json + timestamped history) |
| Decisions | memory/decisions/ | Dated decision records with mesh nodes |
| Quarters | memory/quarters/ | Optional meaning-based day summaries (4 per day) |
| Command | Source | What it does |
|---|---|---|
mem-bridge | memory/bridge.py | Fresh-layer rotation, today-file creation, checkpoints, decision capture, mesh timestamps, session wrap |
auto_log | scripts/auto_log.py | Append one timestamped entry to today's daily log + LATEST.md |
memory_search | scripts/memory_search.py | Cross-layer search: fresh → daily logs → mesh (grep-based, $0) |
memcheck | scripts/memory_check.py | 10-point compliance check of the whole memory chain |
The scripts respect the OPENCLAW_WORKSPACE environment variable and default to ~/.openclaw/workspace (or your host's agent home). memory/ and scripts/ are relative to that workspace root.
memory/bridge.py → <workspace>/memory/bridge.pyscripts/memory_search.py, scripts/auto_log.py, scripts/memory_check.py → <workspace>/scripts/PATH (e.g. ~/.local/bin or ~/.npm-global/bin):
ln -s "$(pwd)/memory/bridge.py" ~/.local/bin/mem-bridge
ln -s "$(pwd)/scripts/auto_log.py" ~/.local/bin/auto_log
ln -s "$(pwd)/scripts/memory_search.py" ~/.local/bin/memory_search
ln -s "$(pwd)/scripts/memory_check.py" ~/.local/bin/memcheck
mem-bridge init-auto
memory/fresh/today.md, resumes the latest checkpoint, and logs the startup.Before answering any question about the past, prior work, people, decisions, or plans:
memory_search "<keywords>"
memory/checkpoints/, and mesh nodes by related keyword.After any turn that contained something worth remembering — decisions, results, plans, corrections, context, or user preferences:
auto_log "what was said, done, or decided"
This appends one timestamped entry to today's daily log (memory/YYYY-MM-DD.md) and to the rolling LATEST.md. It is the last step of the turn, so the log always reflects the final state. Do not log trivia; do log anything future-you would need to reconstruct the conversation.
bridge.py keeps a 5-day fresh window. Each startup, init-auto (or init) checks whether memory/fresh/today.md already contains today's date string; if the file is stale, it rotates: 4-days-ago ← 3-days-ago ← … ← yesterday ← today, then creates a fresh template for today. Rotation is idempotent — running it twice on the same day changes nothing.
Other bridge commands: mem-bridge log <msg>, mem-bridge decision <topic> <body>, mem-bridge quarter <1-4> <summary>, mem-bridge checkpoint <context> [node], mem-bridge resume, mem-bridge touch <node_id>, mem-bridge wrap, mem-bridge mesh [N], mem-bridge summarize, mem-bridge daily.
When memory health is in doubt (missing files, rotation broken, tools lost from PATH), run:
memcheck
It runs 10 checks: auto_log writes, bridge init, today.md presence/age, the 5 fresh files, core agent files, mesh.json, the raw log, the local secret store, tools on PATH, and the heartbeat file — then prints a pass/warn/fail summary. The core-file and directory lists encode one workspace's conventions: treat it as a template and adjust the lists to your own layout if your agent home differs.
When a conversation is missing from the file layers (an LLM crash ate the turn, or the machine powered off before the periodic dump), recover it from the gateway's transcript store — never rebuild from guesses.
sessionId per sessionKey (for the main chat this is your agent's main session key).sqlite3 refuses to open the live DB while the gateway holds it:
mkdir -p /tmp/db-inspect
cp <openclaw-state>/agents/<agent-id>/agent/openclaw-agent.sqlite* /tmp/db-inspect/
~/.openclaw/), find the agent's agent/ folder, and copy every *.sqlite* file. The schema is transcript_events with session_id, seq, created_at, and an event_json payload column.+0300 in this example):
date -d "YYYY-MM-DD HH:MM:SS +0300" +%s%3N # repeat for start and end
event_json holds {"message":{"role":"user","content":...}}):
sqlite3 /tmp/db-inspect/openclaw-agent.sqlite \
"SELECT seq, created_at, substr(event_json,1,400) FROM transcript_events \
WHERE session_id='<session-id>' AND created_at BETWEEN <t0> AND <t1> \
AND event_json LIKE '%\"role\":\"user\"%' ORDER BY seq;"
sqlite3 /tmp/db-inspect/openclaw-agent.sqlite \
"SELECT event_json FROM transcript_events WHERE session_id='<session-id>' \
AND seq BETWEEN <a> AND <b> ORDER BY seq;" > /tmp/db-inspect/convo.jsonl
role, timestamp, and content — for assistant entries, only the parts where type == "text".<project>/IDEA.md).Rule (Sep 2026): user ideas discussed in-session get written to a file the same session — files survive, sessions don't. If the user asks "remember the idea we discussed" and the files have a gap, run this recovery before answering.
Recurring reminders/automations often hold the only record of an old plan — and their payload text goes stale. When the user references a project and memory_search returns nothing (the files were never updated), check the automations registry before answering "no record":
0 12 * * 1 = every Monday).createdAtMs plus the payload text; convert the timestamp with python3 -c "import datetime; print(datetime.datetime.fromtimestamp(<ms>/1000))".Rule: memory_search only greps file layers — automation payloads live outside them. An empty search result does not mean there is no record.
secrets/, *.env) that is git-ignored and never referenced in log payloads. As a rule: log that an action happened, not the credentials it used.memcheck verifies a local secret store exists; that check is about confirming your agent's credential store is intact — it never reads or prints secret contents.Source: https://github.com/mozz0/MeshMorize
Released under the MIT License. See LICENSE in the repository.