Back to Registry
View Author Profile
Official Verified
Cognitive Brain
Skill by aboutyao
skill-install — Terminal
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/aboutyao/cognitive-brainOr
🧠 Cognitive Brain
跨会话记忆与认知系统 v5.0 | Cross-Session Memory & Cognition System
让 AI 拥有像人类一样的记忆、思考和预测能力
Version: 7.0.1 | License: MIT
✨ 功能特性 | Features
| 功能 | Feature | 描述 |
|---|---|---|
| 🔄 实时共享 | Real-time Sharing | 跨会话毫秒级记忆同步 |
| 🧠 四层记忆 | Four-Layer Memory | 感官/工作/情景/语义记忆架构 |
| 💭 自由思考 | Free Thinking | 非任务驱动的意识流思考 |
| 🔮 智能预测 | Prediction | 预测用户需求,预加载记忆 |
| 📊 可视化 | Visualization | 知识图谱、时间线、摘要 |
| 🔗 联想网络 | Association Network | 概念关联,激活扩散算法 |
| 🏗️ 分层架构 | Layered Architecture | Domain/Repository/Service 分层设计 |
| 🔒 事务安全 | Transaction Safety | UnitOfWork 确保数据一致性 |
| 📚 完整文档 | Documentation | API 文档 + 架构文档 |
| ✅ 测试覆盖 | Test Coverage | 自动化测试套件 |
🚀 快速开始 | Quick Start
一键安装 | Quick Install
# 方式1: ClawHub 安装(推荐)
clawhub install cognitive-brain
cd ~/.openclaw/workspace/skills/cognitive-brain
npm run setup:auto # 非交互模式,自动安装所有依赖
# 方式2: 手动安装
cd ~/.openclaw/workspace/skills/cognitive-brain
npm install
npm run setup # 交互式配置
安装模式 | Install Modes
| 命令 | 说明 |
|---|---|
npm run check | 检查系统依赖(PostgreSQL, Redis, pgvector) |
npm run setup | 交互式安装,会提示输入数据库配置 |
npm run setup:auto | 自动安装,使用默认配置,自动安装缺失依赖 |
npm run setup:resume | 从断点恢复安装(安装失败后使用) |
npm run health | 健康检查 |
npm run reset | 重置数据库(清空记忆,保留表结构) |
npm run uninstall | 卸载(清理数据库、hooks、配置文件) |
安装特性 | Install Features
| 特性 | 说明 |
|---|---|
| 🔄 断点恢复 | 安装失败后运行 npm run setup:resume 继续 |
| 📋 安装日志 | 记录到 install.log,便于排查问题 |
| 🔍 已安装检测 | 自动检测是否已安装,避免重复 |
| ⚡ 一键安装 | installCommand 自动执行完整安装流程 |
系统要求 | Requirements
| 依赖 | 版本 | 安装命令 (Ubuntu) |
|---|---|---|
| Node.js | >= 18 | apt install nodejs npm |
| PostgreSQL | >= 14 | apt install postgresql |
| Redis | >= 6 | apt install redis-server |
| pgvector | - | apt install postgresql-16-pgvector |
💡
npm run setup:auto会自动安装这些依赖(需要 root 权限)
基础使用 | Basic Usage
const { CognitiveBrain } = require('./src/index.js');
const brain = new CognitiveBrain();
// 存储记忆
const memory = await brain.encode('用户的项目叫 Alpha', {
type: 'conversation',
importance: 0.8
});
// 检索记忆
const memories = await brain.recall('项目');
// 获取统计
const stats = await brain.stats();
CLI 工具
# 编码记忆
node scripts/core/encode.cjs "内容" -t conversation -i 0.8
# 检索记忆
node scripts/core/recall.cjs --query "关键词" --limit 5
# 健康检查
node scripts/tools/health_check.cjs
# 运行测试
./tests/run.sh
🏗️ 架构概览 | Architecture
v5.0 分层架构
Metadata
AI Skill Finder
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skill Add to Configuration
Paste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-aboutyao-cognitive-brain": {
"enabled": true,
"auto_update": true
}
}
}Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.