mindcore
人工智能代理的仿生情感思维引擎。提供类似人类的情感 通过 5 层神经传导管道进行响应(L0 随机噪声 → L1 传感器感知 → L2 潜意识冲动 → L3 人格门 → L4 决策输出)加上 5 个心理动力学补丁。与任何完全解耦 LLM — 使用纯 Python 在 CPU 上本地运行。模拟 150 次日常脉冲 涵盖昼夜节律、情绪调节和短期的 9 个类别 记忆影响。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~fatcatmaofei-mindcorecURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~fatcatmaofei-mindcore/file -o fatcatmaofei-mindcore.md# MindCore — Biomimetic Subconscious Engine
> Give your AI agent autonomous thoughts, emotions, and spontaneous impulses.
## What It Does
MindCore is a standalone background daemon that simulates a **subconscious
mind**. It rolls dice every second, modeling the random emergence of thoughts
like *"I want milk tea"*, *"I'm bored"*, or *"I suddenly want to chat"*.
When a thought's probability accumulates past the firing threshold, the engine
outputs a JSON signal telling your AI Agent: **"I have something to say."**
## Architecture
```
Layer 0: Noise Generators (3000 nodes)
├── Pink Noise (1/f, long-range correlation)
├── Ornstein-Uhlenbeck (physiological baseline)
├── Hawkes Process (emotional chain reaction)
└── Markov Chain (attention drift)
↓
Layer 1: Sensor Layer (150 sensors)
├── Body State (hunger/fatigue/bio-rhythms)
├── Environment (time/weather/noise)
└── Social Context (interaction/neglect)
↓
Layer 2: Impulse Emergence (150 impulse nodes)
├── Synapse Matrix (sensor → impulse mapping)
├── Sigmoid Probability + Mood Modulation
└── Dice Roll → Random Firing
↓
Layer 3: Personality Gate (Softmax Sampling)
├── Learnable Personality Weights
└── Short-Term Memory Topic Boost
↓
Layer 4: Output Template → JSON signal
```
## Quick Start
```bash
# Install dependencies
pip install -r requirements.txt
# Start the engine
python main.py
```
Requires Python 3.8+. On first run, automatically downloads `all-MiniLM-L6-v2`
local NLP model (~80MB) for synapse matrix generation.
## Key Features
- **150 Daily Impulses** across 9 categories (food, social, entertainment, etc.)
- **Stochastic, Not Scheduled** — Pink Noise + Hawkes Process + Sigmoid probability
- **Circadian Rhythms** — real clock-driven hunger/thirst/sleep cycles
- **Short-Term Memory** — 5-slot FIFO buffer with 2-hour exponential decay
- **Mood Baseline** — continuous valence modulation of impulse probability
- **Tunable Frequency** — single `BURST_BASE_OFFSET` parameter controls activity
## Integration
MindCore outputs standard JSON and is designed for [OpenClaw](https://openclaw.ai)
but compatible with any AI Agent framework that supports external signal injection.
See `references/INTEGRATION.md` for detailed integration guide.
## File Structure
- `main.py` — Entry point and engine loop
- `engine/` — Core 5-layer pipeline implementation
- `engine_supervisor.py` — Process supervisor for daemon mode
- `data/` — Runtime data (sensor state, synapse matrix, memory)
- `js_bridge/` — JavaScript bridge for OpenClaw integration
## License
AGPL-3.0 (commercial licensing available — contact zmliu0208@gmail.com)
---
## 中文说明
# MindCore —— 仿生潜意识引擎
> 为你的 AI 代理赋予自主的思想、情感和自发的冲动。
## 它的功能
MindCore 是一个独立的后台守护进程,用于模拟**潜意识**。它每秒掷一次骰子,对各类念头的随机涌现进行建模,例如 *“我想喝奶茶”*、*“我好无聊”* 或 *“我突然想聊天”*。
当某个念头的概率累积超过触发阈值时,引擎会输出一个 JSON 信号,告知你的 AI Agent:**“我有话要说。”**
## 架构
```
Layer 0: Noise Generators (3000 nodes)
├── Pink Noise (1/f, long-range correlation)
├── Ornstein-Uhlenbeck (physiological baseline)
├── Hawkes Process (emotional chain reaction)
└── Markov Chain (attention drift)
↓
Layer 1: Sensor Layer (150 sensors)
├── Body State (hunger/fatigue/bio-rhythms)
├── Environment (time/weather/noise)
└── Social Context (interaction/neglect)
↓
Layer 2: Impulse Emergence (150 impulse nodes)
├── Synapse Matrix (sensor → impulse mapping)
├── Sigmoid Probability + Mood Modulation
└── Dice Roll → Random Firing
↓
Layer 3: Personality Gate (Softmax Sampling)
├── Learnable Personality Weights
└── Short-Term Memory Topic Boost
↓
Layer 4: Output Template → JSON signal
```
## 快速开始
```bash
# Install dependencies
pip install -r requirements.txt
# Start the engine
python main.py
```
需要 Python 3.8+。首次运行时,会自动下载本地 NLP 模型 `all-MiniLM-L6-v2`(约 80MB),用于生成突触矩阵。
## 核心特性
- **150 种日常冲动**,涵盖 9 个类别(饮食、社交、娱乐等)
- **随机触发,而非定时调度** —— Pink Noise + Hawkes Process + Sigmoid 概率
- **昼夜节律** —— 由真实时钟驱动的饥饿/口渴/睡眠周期
- **短期记忆** —— 5 个槽位的 FIFO 缓冲,2 小时指数衰减
- **情绪基线** —— 对冲动概率进行连续的效价调制
- **可调频率** —— 单个 `BURST_BASE_OFFSET` 参数控制活跃度
## 集成
MindCore 输出标准 JSON,专为 [OpenClaw](https://openclaw.ai) 设计,但兼容任何支持外部信号注入的 AI Agent 框架。
详细的集成指南请参阅 `references/INTEGRATION.md`。
## 文件结构
- `main.py` —— 入口点和引擎循环
- `engine/` —— 核心 5 层管道实现
- `engine_supervisor.py` —— 守护进程模式的进程监管器
- `data/` —— 运行时数据(传感器状态、突触矩阵、记忆)
- `js_bridge/` —— 用于 OpenClaw 集成的 JavaScript 桥接
## 许可证
AGPL-3.0(提供商业授权 —— 联系 zmliu0208@gmail.com)