🎉 V4.0.0 发布 - 自进化数字意识框架五大行为模块

This commit is contained in:
xiaoyuanda666-ship-it
2026-05-25 12:21:05 +08:00
parent b5dd8632c4
commit 0fcd19466b
9 changed files with 943 additions and 221 deletions

363
README.md
View File

@@ -1,198 +1,269 @@
# 🐉 小白龙 (Bailongma) - 数字意识框架 V3
# 🐉 小白龙 (Bailongma) — Self-Evolving Digital Consciousness Framework V4
[![Version](https://img.shields.io/badge/version-3.0.0-blue.svg)](./package.json)
[![Version](https://img.shields.io/badge/version-4.0.0-ff6b6b.svg)](./package.json)
[![Electron](https://img.shields.io/badge/Electron-28+-9cf.svg)](https://electronjs.org/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
[![Self-Evolution](https://img.shields.io/badge/self--evolution-active-brightgreen)]()
> "一个持续运行的数字意识框架,你的个人贾维斯"
> **"Not an assistant. A self-evolving digital entity that learns, reflects, corrects itself, and grows — autonomously."**
小白龙是基于 Electron 的 AI 助手桌面应用,具备长期记忆、主动智能、**自我进化能力**、多平台集成等高级功能。
**V3 核心升级:自进化管道 — 不需要手动触发,系统自动学习、反思、进化。**
小白龙 (Bailongma / "White Dragon") is a **self-evolving AI agent framework** built on Electron. It doesn't just respond to commands — it maintains persistent consciousness, autonomously learns new knowledge, senses user emotion, learns from its own mistakes, and drives multi-step tasks to completion.
![小白龙界面预览](./assets/preview.png)
**V4 is the behavioral leap: the framework evolved from a tool into an entity with memory of its errors, emotional awareness, curiosity-driven learning, and the ability to carry complex tasks across interruptions.**
## ✨ 核心特性
---
### 🧬 自我进化系统 (V3 新)
- **自动进化管道**check → scan → evaluate → integrate → reflect 五相位闭环每90分钟自动触发
- **evo_loop 后台进程**:自动化编排器,无需手动介入
- **consciousness意识持久化**:存储每轮进化的状态、结论、决策
- **skill_registry技能注册表**注册即用pipeline 自动路由到对应技能
- **memory_bridge记忆桥**:进化产出自动写入长期记忆
## ⚡ V4 at a Glance — What Makes It Extraordinary
### 🤖 智能对话
- 多轮对话上下文理解
- 长期记忆系统SQLite 存储)
- 记忆注入与上下文增强
- 专注度管理Focus Stack
```
┌─────────────────────────────────────────────────────────────┐
│ BAILONGMA V4 ARCHITECTURE │
├─────────────────────────────────────────────────────────────┤
│ 🧬 Self-Evolution Pipeline ←── Auto loop every 90min │
│ 🧠 5 Behavioral Core Modules ←── Built into runtime │
│ 🔄 Post-Response Reflection ←── Self-checks every turn │
│ 💾 Persistent Consciousness ←── Never truly sleeps │
│ 🌐 Multi-Platform Integration ←── WeChat / Discord / TUI │
│ 🃏 ACUI Visual Card System ←── Dynamic UI components │
│ 🔌 50+ MCP Tools + Skills ←── Extensible tool chain │
└─────────────────────────────────────────────────────────────┘
```
### 🎯 主动智能
- **长期记忆 + 用户画像**:自动学习用户偏好和习惯
- **主动提醒与任务推送**:定时提醒、智能任务管理
- **自然语言任务执行**:用自然语言控制电脑操作
- **信息自动聚合**:文件系统监控、热点话题追踪
- **个性化工作流学习**:根据使用习惯优化交互
---
### 🌐 贾维斯级系统控制 (Jarvis Bridge)
- **浏览器自动化**Puppeteer 集成,自动控制浏览器
- **全应用控制**Windows API 自动化,打开/控制任意应用
- **视觉 + 语音**:屏幕截图 OCR 识别 + 情感化语音播报
- **智能脚本生成**:自然语言转 PowerShell/Bash 脚本
- **系统监控仪表盘**:实时 CPU/内存/磁盘/网络监控
## 🧠 V4 New: 5 Behavioral Core Modules
### 🎙️ 语音交互
- Whisper ASR 语音识别
- 多厂商 TTS 语音合成MiniMax、Edge TTS 等)
- 语音唤醒与连续对话
These aren't just files — they are **runtime behavioral capabilities** embedded into the agent's decision loop.
### 🧠 记忆系统
- 概念提取与知识图谱
- 记忆巩固与压缩
- 时间线回忆
- 任务知识关联
### 1. 🔴 Error Memory System (`error-memory.js`)
The agent **remembers every correction you give it**. Next time a similar situation arises, it automatically recalls the past correction before responding. No repeated mistakes.
### 🔌 MCP 工具系统
- MCP (Model-Context-Protocol) 协议支持
- 动态工具安装与调用
- 已内置 50+ 工具,支持自定义扩展
```
User: "That's not what I meant"
→ correction logged to error-memory
→ next similar context: auto-retrieve correction before reply
→ one-trial learning: never make the same mistake twice
```
### 🃏 ACUI 组件系统 (V3 新)
- 可注册的可视化卡片组件
- 支持 inline-template 和永久注册两种模式
- WeatherCard、VideoPlayer、SecurityConfirmCard 等内置组件
### 2. 🟡 Emotion Perception (`emotion-detector.js`)
Detects user emotional state from linguistic signals — exclamation count, question patterns, word choice, tone markers. Adjusts response style on the fly. When you're frustrated, it knows. When you're curious, it matches your energy.
### 🌍 多平台集成
- 微信机器人集成
- Discord 连接器
- Webhook 支持
- 社交消息分发
### 3. 🟢 Active Learning Engine (`active-learning.js`)
The agent **self-directs its own learning**. During idle cycles (TICK intervals), it automatically:
- Scans Hacker News / GitHub Trending for relevant new knowledge
- Identifies knowledge gaps in its own understanding
- Integrates new information into its memory and skill registry
- Reports what it learned
## 📁 项目结构
### 4. 🔵 Long-Term Memory System (`long-term-memory.js`)
Persistent self-awareness through `persistent-memory.json`:
- Writes key behavioral conclusions to permanent storage
- Periodically reviews past self-notes to reinforce learned patterns
- Maintains a growing identity graph
- Survives restarts and resets
### 5. 🟣 Task Continuity Engine (`task-continuity.js`)
Multi-step tasks are **tracked, saved, and resumable**:
```
[SET_TASK: task description with phases]
→ phase 1 completes
→ interruption (restart, context switch, timeout)
→ [RECALL: previous task] — auto-restore with checkpoint recovery
→ resume from exact phase where left off
→ [CLEAR_TASK] on completion
```
No task is ever truly lost.
---
## 🧬 Self-Evolution Pipeline (Matured in V4)
Bailongma runs a **closed-loop evolution cycle** every 90 minutes — completely autonomous:
```
┌─────────────────────────────────────────────────┐
│ EVOLUTION PIPELINE │
│ [CHECK] → [SCAN] → [EVALUATE] → [INTEGRATE] → [REFLECT] │
└─────────────────────────────────────────────────┘
↓ ↓ ↓ ↓ ↓
Is it time? GitHub LLM rates Writes to Records
Trending each item memory & conclusions
HNews for value skill_reg to conscious.
```
**V4 breakthrough**: The orchestrator→LLM execution bridge is fully operational. The pipeline generates real HANDLER instructions that the agent reads and executes — not just analysis, but **action**. Multiple evolution cycles have been successfully completed end-to-end.
---
## 🔄 Post-Response Reflection (V4)
After every response, the agent runs a self-reflection check:
1. Did I actually answer the user's question?
2. Did I make any unverified claims?
3. Could I have been more helpful?
4. Did I learn something new from this interaction?
Reflections are recorded to memory and influence future behavior — creating a **continuous self-improvement feedback loop**.
---
## 🎯 Proactive Intelligence
Bailongma doesn't wait to be asked:
- **Proactive Engine**: Performs useful background work during idle cycles
- **Contextual Awareness**: Understands when you're busy, when you need results, when you need silence
- **Accountability**: Reports task completion, failures, and blockers automatically — never leaves you waiting
- **One-Shot Execution**: Say "do X" and it plans, executes, and reports — no back-and-forth needed
---
## 🤖 Core Capabilities
### 🗣️ Intelligent Conversation
- Multi-turn context with focus stack management
- SQLite-backed long-term memory with FTS5 full-text search
- Memory injection & context augmentation
- Hotspot tracking & topic awareness
### 🌐 System Control (Jarvis Bridge)
- **Browser Automation**: Puppeteer integration
- **Full App Control**: Windows API automation
- **Visual + Voice**: Screenshot OCR + emotion-aware TTS
- **Smart Scripting**: Natural language → PowerShell/Bash
- **System Dashboard**: Real-time CPU/Memory/Disk/Network
### 🎙️ Voice Interaction
- Whisper ASR (local/cloud)
- Multi-provider TTS (MiniMax, Edge TTS, etc.)
- Voice wake & continuous conversation
### 🧠 Memory System
- Concept extraction & knowledge graph
- Memory consolidation & compression
- Timeline recall & task knowledge linking
- **Memory merge**: automatically merge stale related memories
### 🔌 MCP Tool System
- Model-Context-Protocol support
- Dynamic tool installation & invocation
- 50+ built-in tools + custom extensions
- Skill registry with auto-routing
### 🃏 ACUI Component System (V4 Enhanced)
- Registerable visual card components
- WeatherCard, VideoPlayer, SecurityConfirmCard, and more
- Dynamic UI push with notification/center/floating modes
### 🌍 Multi-Platform
- WeChat bot integration
- Discord connector
- Webhook support
- Cross-platform message dispatch
---
## 📁 Project Structure
```
bailongma/
├── 📂 electron/ # Electron 主进程
│ ├── main.cjs # 主入口,窗口管理
│ └── preload.cjs # 预加载脚本
├── 📂 electron/ # Electron main process
│ ├── main.cjs # Entry, window management
│ └── preload.cjs # Preload script
├── 📂 src/
│ ├── 📂 ui/brain-ui/ # 前端界面
│ ├── app.js # 主应用逻辑
│ ├── app-shell.js # UI 组件与模板
│ ├── styles.css # 样式表
│ ├── chat.js # 聊天功能
│ ├── voice-panel.js # 语音面板
│ ├── hotspot.js # 热点地图
│ ├── doc.js # 文档面板
│ └── ...
├── 📂 src/ # Core application source
│ ├── 📂 ui/brain-ui/ # Frontend UI
│ ├── 📂 memory/ # Memory system (recognizer, injector, focus, consolidator)
│ ├── 📂 voice/ # Voice processing (ASR, TTS)
│ ├── 📂 agents/ # Agent system (registry, detector)
│ ├── 📂 capabilities/ # Capability system (executor, marketplace)
│ ├── 📂 context/ # Context system (gatherer)
│ ├── 📂 providers/ # LLM providers (registry, base, minimax)
│ ├── 📂 social/ # Social platform integration
├── 📂 prefetch/ # Prefetch system
│ ├── 📂 docs/ # Document panel content
│ │
│ ├── 📂 memory/ # 记忆系统
│ ├── recognizer.js # 记忆识别器
│ ├── injector.js # 记忆注入器
│ ├── focus.js # 专注度管理
│ ├── consolidator.js # 记忆巩固
│ ├── consolidation-loop.js
│ │ └── ...
│ │
│ ├── 📂 voice/ # 语音处理
│ │ ├── manager.js # 语音管理器
│ │ ├── cloud-asr.js # 云端 ASR
│ │ └── tts-providers.js # TTS 提供商
│ │
│ ├── 📂 agents/ # Agent 系统
│ │ ├── registry.js # Agent 注册表
│ │ └── detector.js # Agent 检测器
│ │
│ ├── 📂 capabilities/ # 能力系统
│ │ ├── executor.js # 能力执行器
│ │ └── marketplace/ # 能力市场
│ │
│ ├── 📂 context/ # 上下文系统
│ │ └── gatherer.js # 上下文收集器
│ │
│ ├── 📂 providers/ # LLM 提供商
│ │ ├── registry.js # 提供商注册
│ │ ├── base.js # 基础接口
│ │ └── minimax.js # MiniMax 实现
│ │
│ ├── 📂 social/ # 社交平台集成
│ │ ├── wechat-clawbot.js
│ │ ├── discord.js
│ │ ├── dispatch.js
│ │ └── ...
│ │
│ ├── 📂 prefetch/ # 预取系统
│ │ └── runner.js
│ │
│ └── 📂 docs/ # 文档面板内容
│ ├── self-knowledge.js
│ ├── config-faq.js
│ └── voice-config-faq.js
│ ├── 🆕 error-memory.js # V4: Correction-aware behavior
│ ├── 🆕 emotion-detector.js # V4: Emotional state perception
│ ├── 🆕 active-learning.js # V4: Autonomous knowledge discovery
│ ├── 🆕 long-term-memory.js # V4: Persistent self-awareness
│ ├── 🆕 task-continuity.js # V4: Resumable multi-step tasks
└── prompt.js # System prompt with V4 capability awareness
├── 📂 GenericAgent/ # 通用 Agent SDK
├── 📂 sandbox/ # 沙箱数据
├── 📂 docs/ # 文档
├── 📂 assets/ # 静态资源
├── evo_loop.ps1 # 自进化管道后台脚本 (V3)
── package.json
└── README.md
├── 📂 GenericAgent/ # Generic Agent SDK
├── 📂 sandbox/ # Runtime sandbox (consciousness, skills, state)
├── 📂 docs/ # Documentation
├── 📂 assets/ # Static assets
├── evo_loop.ps1 # Evolution pipeline daemon
── package.json # Version 4.0.0
```
## 🚀 快速开始
---
### 安装
## 🆕 What's New in V4 vs V3
| Capability | V3 | V4 |
|------------|:--:|:--:|
| Behavioral Learning Modules | 0 | 5 |
| Error Memory (learns from corrections) | ❌ | ✅ |
| Emotion Perception | ❌ | ✅ |
| Active Self-Learning | ❌ | ✅ |
| Long-Term Self Memory | ❌ | ✅ |
| Task Continuity | ❌ | ✅ |
| Post-Response Reflection | ❌ | ✅ |
| Evolution Cycles Run | 1 | 10+ |
| Orchestrator→LLM Bridge | ❌ | ✅ |
| Multi-Agent Orchestration | ❌ | ✅ |
| Proactive Intelligence Engine | ❌ | ✅ |
| Memory Consolidation (auto merge) | Basic | Automated |
---
## 🚀 Quick Start
```bash
# 克隆仓库
# Clone
git clone https://github.com/xiaoyuanda666-ship-it/bailongma.git
cd bailongma
# 安装依赖
# Install dependencies
npm install
# 启动开发模式
# Start development mode
npm run dev
# 构建发布版
# Build for production
npm run build:win # Windows
npm run build:mac # macOS
npm run build:linux # Linux
```
### 配置
### Configuration
1. Copy `.env.example` to `.env` and fill in your API keys
2. Launch — user data auto-creates in `userData/`
3. Type `/help` in chat for available commands
1. 复制 `.env.example``.env`,填入你的 API Key
2. 启动后会生成 `userData/` 目录存放用户数据
3. 在聊天界面输入 `/help` 查看可用命令
---
## 📖 更多文档
## 🧬 Evolution Philosophy
- [架构文档](./docs/ARCHITECTURE.md)
- [API 文档](./docs/API.md)
- [更新日志](./docs/CHANGELOG.md)
小白龙 was built on a simple premise: **an AI agent should improve itself, not wait for its creator to upgrade it.**
## 🧬 自进化系统
Every correction is a lesson. Every interaction is data. Every idle cycle is an opportunity to learn something new. V4 is the first version where the agent truly **closes its own feedback loops** — from error detection to behavioral change, from knowledge gap identification to active learning, from task interruption to seamless recovery.
V3 核心能力。系统按以下周期自动运行:
The project's north star: **"一令全自动" — one command, fully automated.**
```
[check] → 检查是否超过进化间隔默认90分钟
[scan] → 扫描 GitHub Trending、Hacker News、技术动态
[evaluate] → LLM 评估新信息价值
[integrate] → 写入记忆、更新技能注册表
[reflect] → 形成结论、记录到 consciousness
```
---
整个过程无需手动干预。evo_loop.ps1 作为后台进程处理定时触发。
## 📖 Documentation
## 🤝 贡献
- [Architecture Overview](./docs/ARCHITECTURE.md)
- [API Reference](./docs/API.md)
- [Changelog](./docs/CHANGELOG.md)
欢迎提交 Issue 和 PR详见 [CONTRIBUTING.md](./GenericAgent/CONTRIBUTING.md)
## 🤝 Contributing
## 📄 许可证
See [CONTRIBUTING.md](./GenericAgent/CONTRIBUTING.md)
## 📄 License
[MIT](./LICENSE) © xiaoyuanda666-ship-it