ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

Cognitive Brain

Skill by aboutyao

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/aboutyao/cognitive-brain
Or

🧠 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 ArchitectureDomain/Repository/Service 分层设计
🔒 事务安全Transaction SafetyUnitOfWork 确保数据一致性
📚 完整文档DocumentationAPI 文档 + 架构文档
✅ 测试覆盖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>= 18apt install nodejs npm
PostgreSQL>= 14apt install postgresql
Redis>= 6apt 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

Author@aboutyao
Stars4473
Views1
Updated2026-05-01
View Author Profile
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.