| name | cognitive-memory |
|---|---|
| description | Intelligent multi-store memory system for OpenClaw agents with episodic logs, semantic graph memory, procedural memory, decay-aware retention, reflection workflows, and audit trails. |
A memory architecture for OpenClaw agents that goes beyond a single flat MEMORY.md file.
It organizes memory into multiple stores:
- Core memory — always-loaded
MEMORY.md - Episodic memory — append-only daily logs
- Semantic memory — graph-style entities and relationships
- Procedural memory — learned workflows and patterns
- Vault memory — user-pinned facts that should not decay
It also includes:
- Decay tracking for prioritizing recall
- Reflection workflows for consolidation
- Git + audit log for mutation traceability
- Multi-agent staging via pending memory proposals
scripts/init_memory.sh— initialize the directory structure and starter filesassets/templates/— templates for memory files and agent instruction blocksreferences/— design notes and deeper documentationSKILL.md— skill-facing usage instructionsUPGRADE*.md/ upgrade scripts — migration notes for older installs
git clone https://github.com/yankel121160-coder/openclaw-cognitive-memory.git
cd openclaw-cognitive-memorybash scripts/init_memory.sh /path/to/openclaw-workspaceExample:
bash scripts/init_memory.sh ~/.openclaw/workspaceThis creates the memory directory tree and copies starter templates without overwriting existing core files like MEMORY.md, IDENTITY.md, or SOUL.md.
Enable memory retrieval in your OpenClaw gateway/agent configuration using the current OpenClaw config path and schema for your install.
At a minimum, you want memory search enabled for:
- workspace memory files
- optionally session transcript chunks
If you are unsure about the exact config keys for your version, check the OpenClaw config schema/docs first rather than copying old config examples.
Append or adapt:
assets/templates/agents-memory-block.md
into your agent instructions (for example AGENTS.md or your agent’s system instructions).
Review and edit:
MEMORY.mdIDENTITY.mdSOUL.md
These three files define the always-loaded core memory and the agent’s stable self-model.
After initialization, the workspace looks roughly like this:
workspace/
├── MEMORY.md
├── IDENTITY.md
├── SOUL.md
├── memory/
│ ├── episodes/
│ ├── graph/
│ │ ├── index.md
│ │ ├── entities/
│ │ └── relations.md
│ ├── procedures/
│ ├── vault/
│ └── meta/
│ ├── decay-scores.json
│ ├── reflection-log.md
│ ├── reward-log.md
│ ├── reflections/
│ │ └── dialogues/
│ ├── rewards/
│ ├── pending-memories.md
│ ├── pending-reflection.md
│ ├── evolution.md
│ └── audit.log
└── .git/
User says:
Remember that I prefer TypeScript over JavaScript.
Expected behavior:
- append an episode/log entry
- update semantic or core memory if appropriate
- update decay tracking / audit trail
User says:
What do you remember about my language preferences?
Expected behavior:
- check
MEMORY.mdfirst - if needed, search semantic memory / episodic memory
- answer from the retrieved memory rather than hallucinating
User says:
Remember this workflow: run tests before every deploy.
Expected behavior:
- classify as procedural memory
- create or update a procedure file
- optionally promote to core memory if it is always relevant
- Small, always loaded
- Best for identity, active priorities, critical facts
- Chronological, append-only
- Best for decisions, events, corrections, notable interactions
- Entity/relationship oriented
- Best for people, projects, concepts, preferences, long-lived facts
- Best for repeatable workflows and heuristics
- User-pinned memory that should not be automatically decayed or forgotten
This system supports two important higher-order behaviors:
Older memories can be deprioritized rather than instantly deleted. That keeps retrieval useful without pretending every old fact matters equally forever.
A scheduled or manual reflection pass can:
- consolidate episodic logs into semantic memory
- rewrite core memory
- propose archival of stale entries
- record long-term evolution notes
See:
references/reflection-process.mdreferences/architecture.md
Sub-agents should usually read shared memory directly but write via proposals.
Recommended pattern:
- sub-agent writes proposal →
memory/meta/pending-memories.md - main/orchestrator agent reviews
- approved memories get committed into the real stores
This keeps shared memory coherent and auditable.
This repo is a memory architecture and workflow scaffold, not a full standalone memory database service.
You still need to integrate it with:
- your agent instructions
- your retrieval flow
- your OpenClaw config
- any automation for reflection / consolidation
If you want to productionize it further, add:
- a concrete OpenClaw config example for current versions
- a small end-to-end demo
- a validator that checks required files after initialization
- a graph rebuild script
- tests for init / upgrade scripts
references/architecture.mdreferences/reflection-process.mdreferences/routing-prompt.md
If you reuse this in another agent stack, keep the audit and approval model intact. That part matters as much as the memory structure itself.