Install
openclaw skills install @onurkarali/brain-memoryRecall and store persistent memories in the user's brain (~/.brain) with the brain CLI: deterministic recall with spreading activation, spaced reinforcement after presenting results, and classified model-driven memorization across life domains (personal, family, social, professional).
openclaw skills install @onurkarali/brain-memoryThe user has a persistent, neuroscience-inspired memory system — a single
global ~/.brain/ directory shared across all their AI agents. Memories are
Markdown files with YAML frontmatter (type, cognitive type, strength, decay,
salience, confidence, tags, associations). Recalled memories get stronger;
ignored ones fade. Use the brain CLI for every operation — never compute
scores or write memory files by hand.
Run the deterministic recall engine:
brain recall "<query>" --project <project> --task <task_type> --top 10
It returns a scored JSON array (id, title, path, type, score,
relevance, decayed_strength, context_match, spreading_bonus,
confidence, tags). Scoring combines TF-IDF relevance, decayed strength,
spreading activation, context match, and salience — the same ranking on
every agent.
Read the top-scoring memory bodies from ~/.brain/<path> (score > 0.3).
Decide how to respond:
~/.brain/_archived/, then suggest other keywords.After presenting results, always reinforce what you showed:
brain reinforce <id1> <id2> ...
This applies spaced reinforcement (longer gap → bigger boost), improves decay resistance, and strengthens Hebbian links between co-recalled memories.
Flag low-confidence memories (confidence < 0.5) as unverified.
Default: store immediately, report after — do not ask for confirmation when the user asked to memorize. Classify each memory yourself:
decision 0.85 · insight 0.90 · goal
0.80 · experience 0.75 · learning 0.70 · relationship 0.70 ·
preference 0.60 · observation 0.40episodic (events), semantic (facts), procedural
(skills/workflows)~/.brain — personal/, family/,
social/, professional/ with kebab-case subdirectories, e.g.
personal/health/sleep-routine.md, family/events/2026-summer-trip.md,
social/friends/marta-preferences.md, professional/projects/foo/api-decision.mdPipe the classified memories to the CLI in one call (add --sync to push to
Brain Cloud / git afterwards):
brain memorize <<'EOF'
{
"memories": [
{
"title": "Prefers morning workouts before 8am",
"type": "preference",
"cognitive_type": "semantic",
"path": "personal/health/workout-preference.md",
"tags": ["health", "routine"],
"salience": 0.6,
"confidence": 0.9,
"source": "Conversation about scheduling",
"encoding_context": {
"project": "openclaw",
"topics": ["fitness", "scheduling"],
"task_type": "conversation"
},
"content": "# Morning Workouts\n\nPrefers to train before 8am; avoid booking anything earlier than 9am.\n"
}
]
}
EOF
The CLI handles IDs, strength/decay computation, directories, index updates, association edges, and the search index.
Guidelines:
BRAIN_AGENT=openclaw in the environment when invoking the CLI so
memories record their host agent."pinned": true (always-injected, decay-exempt) for durable
conventions — and only with the user's agreement.potential_conflicts with a pinned/stable memory,
surface the contradiction and let the user decide (supersede, scope, or
reject) — never silently keep both.brain session-start --project <project> returns the budget-bounded session
payload (pinned facts, relevant memories, skills index) — internalize it
silently; do not dump it.~/.brain/contexts.json
(keep only the last 20) so future sessions get context-dependent recall.