← 返回
开发者工具 中文

Brain CMS

Neuroscience-based multi-layer memory system for OpenClaw agents that improves context efficiency using semantic schemas, vector stores, and sleep cycle cons...
面向OpenClaw智能体的基于神经科学的多层记忆系统,通过语义模式、向量存储和睡眠巩固机制提升上下文效率。
harrey401 harrey401 来源
开发者工具 clawhub v1.0.0 1 版本 99907.7 Key: 无需
★ 1
Stars
📥 1,063
下载
💾 18
安装
1
版本
#latest

概述

Brain CMS 🧠

A neuroscience-inspired memory architecture for OpenClaw agents.

Replaces flat file injection with sparse, semantic, frequency-gated memory loading.

What This Installs

memory/
├── INDEX.md          ← Hippocampus: topic router + cross-links
├── ANCHORS.md        ← Permanent high-significance event store
└── schemas/          ← Domain-specific semantic schemas (you create these)

memory_brain/
├── index_memory.py   ← Embeds schemas into LanceDB vector store
├── query_memory.py   ← Semantic similarity search
├── nrem.py           ← NREM sleep cycle (compression + anchor promotion)
├── rem.py            ← REM sleep cycle (LLM consolidation via Ollama)
└── vectorstore/      ← LanceDB database (auto-created)

Setup (one-time)

# 1. Run the installer
python3 ~/.openclaw/workspace/skills/brain-cms/install.py

# 2. Index your schemas
cd ~/.openclaw/workspace/memory_brain
.venv/bin/python3 index_memory.py

# 3. Test retrieval
.venv/bin/python3 query_memory.py "your topic here" --sources-only

How It Works

Boot sequence: Load MEMORY.md (lean core) + today's daily log. Nothing else.

When a topic appears: Read memory/INDEX.md → load only the relevant schemas (spreading activation). Check memory/ANCHORS.md for high-significance events.

For ambiguous topics: Run semantic search:

memory_brain/.venv/bin/python3 memory_brain/query_memory.py "message text" --sources-only

Auto-schema creation: When a new significant project or domain appears:

  1. Create memory/.md
  2. Add to INDEX.md with triggers + priority + cross-links
  3. Re-index: memory_brain/.venv/bin/python3 memory_brain/index_memory.py

Sleep cycles:

# NREM — run on shutdown (~30s, no LLM)
cd ~/.openclaw/workspace/memory_brain && .venv/bin/python3 nrem.py

# REM — run weekly (2-5 min, uses local llama3.2:3b, free)
cd ~/.openclaw/workspace/memory_brain && .venv/bin/python3 rem.py

Memory Layers (CMS)

LayerFilesWhen loadedPurpose
------------------------------------
WorkingMEMORY.md + today logEvery sessionCore context
Episodicmemory/YYYY-MM-DD.mdSession bootRecent events
Semanticmemory/*.md schemasOn triggerDomain knowledge
Anchorsmemory/ANCHORS.mdOn CRITICAL topicsPermanent ground truth
Vectormemory_brain/vectorstore/On demandSemantic search

Tagging Anchors

In any daily log, tag high-significance events:

[ANCHOR] Major demo success — full pipeline working end-to-end

NREM auto-promotes these to ANCHORS.md on next shutdown.

Token Savings

Typical MEMORY.md: 150-300 lines injected every session.

With Brain CMS: ~50-line core + schemas loaded only when relevant.

Estimated savings: 40-60% reduction in context tokens per session.

Requirements

  • Python 3.10+
  • Ollama (for embeddings + REM consolidation)
  • 500MB+ storage for vector store and models
  • lancedb, numpy, pyarrow, requests (auto-installed)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 12:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,233 📥 268,690
life-service

Lofy Career

harrey401
职位搜索自动化(Lofy AI 助手):投递追踪、简历按职位定制、面试准备(含公司研究)、跟进管理(含邮件草稿)和招聘管道分析。用于追踪申请、定制简历、准备面试、管理跟进或分析求职策略。
★ 2 📥 2,192
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,090 📥 818,346