Install
openclaw skills install memory-architectRestructure flat MEMORY.md files into a tiered memory system with an entity graph. Use when: (1) MEMORY.md is growing unwieldy or exceeds 150 lines, (2) user asks to organize/restructure/tier memory, (3) context compaction is losing important details, (4) you need structured entity lookup (people, projects, properties, contacts) instead of scanning markdown. Triggers on organize my memory, memory is too big, restructure memory, tier my memory, make memory more efficient.
openclaw skills install memory-architectSplit a monolithic MEMORY.md into three tiers plus a structured entity graph.
MEMORY.md → Router (30 lines max). Points to tiers.
memory/protocols.md → HOT: Stable workflows, shortcuts, procedures. Read on session start.
memory/active.md → WARM: Current projects, waiting-on, live context. Check before acting.
memory/archive.md → COLD: Completed work, historical reference. Search when needed.
memory/ontology/graph.jsonl → Structured entities + relations (JSONL append-only)
Read the full file. Classify each section:
| Content type | Tier | Examples |
|---|---|---|
| Stable workflow / procedure | protocols | Emoji shortcuts, deploy steps, tool usage rules |
| Active project / waiting-on | active | Current builds, pending replies, live URLs |
| Completed work / reference data | archive | Done tasks, contact lists, account tables, old decisions |
| Named entity with properties | ontology | People, orgs, projects, properties, locations |
Write each tier file with a header comment explaining its purpose and update frequency.
protocols.md rules:
active.md rules:
archive.md rules:
For each named person, organization, project, property, or location, create a JSONL entry:
{"op":"create","entity":{"id":"p_alice","type":"Person","properties":{"name":"Alice","email":"alice@example.com","role":"Engineer"}},"timestamp":"2026-01-01T00:00:00Z"}
{"op":"relate","from":"p_alice","rel":"member_of","to":"org_acme","timestamp":"2026-01-01T00:00:00Z"}
ID conventions:
p_shortnamegrp_name or org_nameproj_nameprop_name or loc_nameRelation types: member_of, owns, collaborates_on, interested_in, guides, uses, listed_by, located_at
Replace MEMORY.md with a ~25-line index that:
wc -l MEMORY.md memory/protocols.md memory/active.md memory/archive.md memory/ontology/graph.jsonl
Targets: MEMORY.md under 30, protocols under 100, active under 80, graph = 1 line per entity/relation.
memory/protocols.md (always)memory/active.md (always)memory/archive.md — only on memory_search or explicit requestgrep "p_forrest" memory/ontology/graph.jsonl
grep '"type":"Project"' memory/ontology/graph.jsonl
cat memory/ontology/graph.jsonl | jq -r 'select(.entity?.type=="Person") | .entity.properties.name'