Skip to content
Back to skills

Cognitive Brain

ASecurity

Cognitive Brain

  • 33 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
databasespythongobashsqlnodegitapidatabase

Works with

  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add dvcrn/openclaw-skills-marketplace --skill cognitive-brain --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cognitive Brain?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cognitive Brain
[![Security: A โ€” Skills Directory](https://www.skillsdirectory.com/api/skills/dvcrn-cognitive-brain/badge)](https://www.skillsdirectory.com/skills/dvcrn-cognitive-brain)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cognitive-brain
description: "Cognitive Brain"
---

# ๐Ÿง  Cognitive Brain

> **่ทจไผš่ฏ่ฎฐๅฟ†ไธŽ่ฎค็Ÿฅ็ณป็ปŸ** | Cross-Session Memory & Cognition System
> 
> ่ฎฉ AI ๆ‹ฅๆœ‰ๅƒไบบ็ฑปไธ€ๆ ท็š„่ฎฐๅฟ†ใ€ๆ€่€ƒๅ’Œ้ข„ๆต‹่ƒฝๅŠ›

**Version: 2.7.2** | **License: MIT**

---

## โœจ ๅŠŸ่ƒฝ็‰นๆ€ง | Features

| ๅŠŸ่ƒฝ | Feature | ๆ่ฟฐ |
|------|---------|------|
| ๐Ÿ”„ ๅฎžๆ—ถๅ…ฑไบซ | Real-time Sharing | ่ทจไผš่ฏๆฏซ็ง’็บง่ฎฐๅฟ†ๅŒๆญฅ |
| ๐Ÿง  ๅ››ๅฑ‚่ฎฐๅฟ† | Four-Layer Memory | ๆ„Ÿๅฎ˜/ๅทฅไฝœ/ๆƒ…ๆ™ฏ/่ฏญไน‰่ฎฐๅฟ†ๆžถๆž„ |
| ๐Ÿ’ญ ่‡ช็”ฑๆ€่€ƒ | Free Thinking | ้žไปปๅŠก้ฉฑๅŠจ็š„ๆ„่ฏ†ๆตๆ€่€ƒ |
| ๐Ÿ”ฎ ๆ™บ่ƒฝ้ข„ๆต‹ | Prediction | ้ข„ๆต‹็”จๆˆท้œ€ๆฑ‚๏ผŒ้ข„ๅŠ ่ฝฝ่ฎฐๅฟ† |
| ๐Ÿ“Š ๅฏ่ง†ๅŒ– | Visualization | ็Ÿฅ่ฏ†ๅ›พ่ฐฑใ€ๆ—ถ้—ด็บฟใ€ๆ‘˜่ฆ |
| ๐Ÿ”— ่”ๆƒณ็ฝ‘็ปœ | Association Network | ๆฆ‚ๅฟตๅ…ณ่”๏ผŒๆฟ€ๆดปๆ‰ฉๆ•ฃ็ฎ—ๆณ• |

---

## ๐Ÿš€ ๅฟซ้€Ÿๅผ€ๅง‹ | Quick Start

### ๅฎ‰่ฃ… | Installation

```bash
# ClawHub ๅฎ‰่ฃ…๏ผˆๆŽจ่๏ผ‰
clawhub install cognitive-brain

# ๆ‰‹ๅŠจๅฎ‰่ฃ…
cd ~/.openclaw/workspace/skills
git clone <repository> cognitive-brain
cd cognitive-brain && npm install
```

### ๅŸบ็ก€ไฝฟ็”จ | Basic Usage

```bash
# ๅญ˜ๅ‚จ่ฎฐๅฟ†
node scripts/brain.cjs encode "็”จๆˆท็š„้กน็›ฎๅซ Alpha"

# ๆฃ€็ดข่ฎฐๅฟ†
node scripts/brain.cjs recall "้กน็›ฎ"

# ๅฅๅบทๆฃ€ๆŸฅ
node scripts/brain.cjs health_check
```

---

## ๐Ÿ—๏ธ ๆžถๆž„ๆฆ‚่งˆ | Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      ๅบ”็”จๅฑ‚ | Application                    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚  ๅฟƒ่ทณๅๆ€  โ”‚  โ”‚  ่‡ช็”ฑๆ€่€ƒ  โ”‚  โ”‚  ้ข„ๆต‹้ข„ๅŠ ่ฝฝ โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                ๅฎžๆ—ถๅฑ‚ | Real-time (Redis)                    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚  Pub/Sub   โ”‚  โ”‚  ๅทฅไฝœ่ฎฐๅฟ†  โ”‚  โ”‚ ๅ…ฑไบซไธŠไธ‹ๆ–‡  โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              ๆŒไน…ๅฑ‚ | Persistence (PostgreSQL)               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚  ็ณป็ปŸ่ฎฐๅฟ†  โ”‚  โ”‚  ๆƒ…ๆ™ฏ่ฎฐๅฟ†  โ”‚  โ”‚  ่ฏญไน‰่ฎฐๅฟ†   โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

---

## ๐Ÿง  ๅ››ๅฑ‚่ฎฐๅฟ†ๆจกๅž‹ | Four-Layer Memory

| ๅฑ‚็บง | Layer | ๆŒ็ปญๆ—ถ้—ด | ็”จ้€” |
|------|-------|---------|------|
| ๆ„Ÿๅฎ˜่ฎฐๅฟ† | Sensory | ๆฏซ็ง’็บง | ็žฌๆ—ถๆ„Ÿ็Ÿฅ็ผ“ๅ†ฒ |
| ๅทฅไฝœ่ฎฐๅฟ† | Working | ๅˆ†้’Ÿ~ๅฐๆ—ถ | ๆดป่ทƒๅค„็†ๅทฅไฝœๅŒบ |
| ๆƒ…ๆ™ฏ่ฎฐๅฟ† | Episodic | ้•ฟๆœŸ | ไธชไบบ็ปๅކใ€ไบ‹ไปถ |
| ่ฏญไน‰่ฎฐๅฟ† | Semantic | ้•ฟๆœŸ | ไบ‹ๅฎžใ€ๆฆ‚ๅฟตใ€็Ÿฅ่ฏ† |

---

## ๐Ÿ”„ ๅ…ฑไบซๅทฅไฝœๅŒบ | Shared Workspace

### ๆ ธๅฟƒ่กจ | Core Tables

| ่กจๅ | Table | ่ฏดๆ˜Ž |
|------|-------|------|
| `system_memory` | System Memory | ๆ›ฟไปฃ MEMORY.md๏ผŒ่ทจไผš่ฏๅ…ฑไบซ |
| `shared_context` | Shared Context | ไผš่ฏ้—ดไธดๆ—ถไธŠไธ‹ๆ–‡ |
| `memory_changes` | Memory Changes | ๅ˜ๆ›ดๆ—ฅๅฟ—๏ผŒๅฎžๆ—ถ่ฟฝ่ธช |

### ไฝฟ็”จ็คบไพ‹ | Usage

```bash
# ่ฎพ็ฝฎ็”จๆˆทๆกฃๆกˆ
node scripts/shared_memory.cjs set "user_name" "master" profile

# ่Žทๅ–็”จๆˆทๆกฃๆกˆ
node scripts/shared_memory.cjs user

# ่Žทๅ–ๆ‰€ๆœ‰ๆ•™่ฎญ
node scripts/shared_memory.cjs lessons
```

---

## ๐Ÿ”ง ๆ ธๅฟƒๆจกๅ— | Core Modules

### ่ฎฐๅฟ†ๆ“ไฝœ | Memory Operations

```bash
# ็ผ–็ 
node scripts/encode.cjs --content "ๅ†…ๅฎน" --metadata '{"type":"fact"}'

# ๆฃ€็ดข
node scripts/recall.cjs --query "ๅ…ณ้”ฎ่ฏ" --options '{"limit":5}'

# ่”ๆƒณ
node scripts/associate.cjs spread "ๆฆ‚ๅฟตA,ๆฆ‚ๅฟตB"
```

### ๆ€่€ƒไธŽๅๆ€ | Thinking & Reflection

```bash
# ๅฟƒ่ทณๅๆ€
node scripts/heartbeat_reflect.cjs check

# ่‡ช็”ฑๆ€่€ƒ
node scripts/free_think.cjs think
```

### ๅฏ่ง†ๅŒ– | Visualization

```bash
# ็Ÿฅ่ฏ†ๅ›พ่ฐฑ
node scripts/visualize.cjs mermaid > graph.md
node scripts/visualize.cjs html > graph.html

# ๆ—ถ้—ด็บฟ
node scripts/timeline.cjs recent 7
```

---

## ๐Ÿ”— Hook ้›†ๆˆ | OpenClaw Hooks

### cognitive-recall

**่งฆๅ‘ไบ‹ไปถ | Event:** `message:preprocessed`

**ๅŠŸ่ƒฝ | Functions:**
- ๅนถ่กŒๆฃ€็ดข่ฎฐๅฟ† + ๆ•™่ฎญ + ้ข„ๆต‹
- ๆณจๅ…ฅไธŠไธ‹ๆ–‡ๅˆฐๆถˆๆฏ
- ่‡ชๅŠจ็ผ–็ ็”จๆˆทๆถˆๆฏ

**ๆณจๅ…ฅๆ ผๅผ | Injection Format:**

```
[๐Ÿ”ฎ ้ข„ๆต‹]
  ็”จๆˆทๅฏ่ƒฝ็š„ไธ‹ไธ€ๆญฅ้œ€ๆฑ‚
[/้ข„ๆต‹]

[๐Ÿง  Memory Context]
  ็›ธๅ…ณ่ฎฐๅฟ†ๅ†…ๅฎน
[/Memory Context]

[โš ๏ธ ๆ•™่ฎญๆ้†’]
  ็ณป็ปŸ็บงๅˆซๆ•™่ฎญ
[/ๆ•™่ฎญๆ้†’]
```

---

## โš™๏ธ ้…็ฝฎ | Configuration

### ็ณป็ปŸ่ฆๆฑ‚ | Requirements

| ็ป„ไปถ | ็‰ˆๆœฌ |
|------|------|
| Node.js | >= 18.0 |
| PostgreSQL | >= 14.0 (้œ€่ฆ pgvector) |
| Redis | >= 6.0 (ๅฏ้€‰) |
| Python | >= 3.8 (็”จไบŽๆœฌๅœฐ Embedding) |

### config.json

```json
{
  "storage": {
    "primary": {
      "type": "postgresql",
      "host": "localhost",
      "port": 5432,
      "database": "cognitive_brain",
      "user": "postgres",
      "password": "cognitive123"
    },
    "cache": {
      "type": "redis",
      "host": "localhost",
      "port": 6379
    }
  },
  "embedding": {
    "provider": "local",
    "dimension": 384
  }
}
```

---

## ๐Ÿ“š API ๅ‚่€ƒ | API Reference

### SharedMemory ็ฑป

| ๆ–นๆณ• | ่ฏดๆ˜Ž |
|------|------|
| `getSystemMemory(key)` | ่Žทๅ–็ณป็ปŸ่ฎฐๅฟ† |
| `setSystemMemory(key, content, category)` | ่ฎพ็ฝฎ็ณป็ปŸ่ฎฐๅฟ† |
| `getUserProfile()` | ่Žทๅ–็”จๆˆทๆกฃๆกˆ |
| `getLessons()` | ่Žทๅ–ๆ‰€ๆœ‰ๆ•™่ฎญ |
| `setSharedContext(sessionId, type, content)` | ่ฎพ็ฝฎๅ…ฑไบซไธŠไธ‹ๆ–‡ |
| `onChange(callback)` | ็›‘ๅฌๅ˜ๆ›ด |

---

## ๐Ÿ”ง ๆ•…้šœๆŽ’้™ค | Troubleshooting

### ๅธธ่ง้—ฎ้ข˜ | Common Issues

| ้—ฎ้ข˜ | ่งฃๅ†ณๆ–นๆกˆ |
|------|---------|
| ๆ•ฐๆฎๅบ“่ฟžๆŽฅๅคฑ่ดฅ | ๆฃ€ๆŸฅ PostgreSQL ๆœๅŠก็Šถๆ€ |
| Embedding ๅŠ ่ฝฝๆ…ข | ่ฟ่กŒ `warmup_embedding.cjs serve` |
| Hook ไธ็”Ÿๆ•ˆ | ๅคๅˆถ handler.js ๅˆฐ OpenClaw hooks ็›ฎๅฝ• |
| ่ทจไผš่ฏไธๅŒๆญฅ | ็กฎไฟๆ‰€ๆœ‰ไผš่ฏไฝฟ็”จ็›ธๅŒๆ•ฐๆฎๅบ“้…็ฝฎ |

---

## ๐Ÿ“ ๆ›ดๆ–ฐๆ—ฅๅฟ— | Changelog

### v2.7.1 (2026-03-13)
- ไผ˜ๅŒ– SKILL.md ๆ–‡ๆกฃ็ป“ๆž„
- ไธญ่‹ฑๆ–‡ๅŒ่ฏญๆ”ฏๆŒ

### v2.7.0 (2026-03-13)
- ๅ…ฑไบซๅทฅไฝœๅŒบ๏ผšPostgreSQL NOTIFY ๅฎžๆ—ถๅŒๆญฅ
- system_memory ่กจๆ›ฟไปฃ MEMORY.md

### v2.6.0 (2026-03-13)
- ็Ÿฅ่ฏ†ๅ›พ่ฐฑๅฏ่ง†ๅŒ–
- ้ข„ๆต‹ไธŽ้ข„ๅŠ ่ฝฝ

### v2.5.0 (2026-03-13)
- ่‡ช็”ฑๆ€่€ƒๆจกๅ—
- ๅˆ†็ฆปๆ”ถ้›†ไธŽๆ€่€ƒๆžถๆž„

---

## ๐Ÿ“„ ่ฎธๅฏ่ฏ | License

MIT License

## ๐Ÿ‘ค ไฝœ่€… | Author

AI Self-Design

## ๐Ÿ”— ้“พๆŽฅ | Links

- **ClawHub:** https://clawhub.com
- **OpenClaw:** https://github.com/openclaw/openclaw
- **ๆ–‡ๆกฃ:** https://docs.openclaw.ai

Files in this skill

  • .clawhub/origin.json147 B
  • CHANGELOG.md18.2 KB
  • README.md3.9 KB
  • SKILL.md7.9 KB
  • Skill.json1.4 KB
  • config.json2 KB
  • package-lock.json10 KB
  • package.json1 KB
  • scripts/active_learning.cjs7.6 KB
  • scripts/associate.cjs10.5 KB
  • scripts/auto_associate.cjs5.1 KB
  • scripts/autolearn.cjs5.4 KB
  • scripts/batch_encode.cjs4.9 KB
  • scripts/brain.cjs2.5 KB
  • scripts/config_manager.cjs4.1 KB
  • scripts/conflict_resolution.cjs6.6 KB
  • scripts/context_switching.cjs7.8 KB
  • scripts/debug.cjs5.4 KB
  • scripts/decision.cjs8.6 KB
  • scripts/dialogue.cjs8.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading commentsโ€ฆ