docs: 清理 tool-engine 残留引用 + 更新架构文档与 README
- Migration.md: 移除 tool-engine 编译/启动/验证 4 处引用 - 架构分析: 移除 Tool Engine :8092 图示和端口表行,更新 msg_type 限制说明 - README: 统一插件数量为 15 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+15
-20
@@ -179,9 +179,6 @@ go build -o main.exe .\cmd\main.go
|
||||
cd backend\iot-debug-service
|
||||
go build -o main.exe .\cmd\main.go
|
||||
|
||||
# 编译 tool-engine
|
||||
cd backend\tool-engine
|
||||
go build -o main.exe .\cmd\main.go
|
||||
|
||||
# 编译 ai-core
|
||||
cd backend\ai-core
|
||||
@@ -258,17 +255,16 @@ node src\index.js
|
||||
devtools.bat
|
||||
```
|
||||
|
||||
DevTools 会按以下顺序自动编译并启动所有 7 个服务:
|
||||
DevTools 会按以下顺序自动编译并启动所有 6 个服务:
|
||||
|
||||
| 顺序 | 服务 | 端口 | 说明 |
|
||||
|------|------|------|------|
|
||||
| 1 | memory-service | 8091 | 记忆 CRUD 与检索 |
|
||||
| 2 | tool-engine | 8092 | 工具执行引擎 |
|
||||
| 3 | iot-debug-service | 8083 | 模拟智能家居设备 |
|
||||
| 4 | voice-service | 8093 | TTS/STT 语音服务 |
|
||||
| 5 | ai-core | 8081 | LLM 推理与编排 |
|
||||
| 6 | gateway | 8080 | API 网关 / JWT / WebSocket |
|
||||
| 7 | frontend | 5173 | React 开发服务器 |
|
||||
| 2 | iot-debug-service | 8083 | 模拟智能家居设备 |
|
||||
| 3 | voice-service | 8093 | TTS/STT 语音服务 |
|
||||
| 4 | ai-core | 8081 | LLM 推理与编排 |
|
||||
| 5 | gateway | 8080 | API 网关 / JWT / WebSocket |
|
||||
| 6 | frontend | 5173 | React 开发服务器 |
|
||||
|
||||
> 每个步骤会自动等待健康检查通过后再启动下一个服务。如果 Go 二进制未编译,DevTools 会自动先编译再启动。
|
||||
|
||||
@@ -394,16 +390,15 @@ find backend -name "*.go" -exec dos2unix {} \;
|
||||
| 3 | ✅ 数据库连接正常 | 使用 `psql` 或数据库客户端连接 PostgreSQL |
|
||||
| 4 | ✅ pgvector 扩展已安装 | `SELECT * FROM pg_extension WHERE extname='vector';` 返回一行 |
|
||||
| 5 | ✅ memory-service 启动成功 | 无 panic 日志,监听 8091 端口 |
|
||||
| 6 | ✅ tool-engine 启动成功 | 无 panic 日志,监听 8092 端口 |
|
||||
| 7 | ✅ iot-debug-service 启动成功 | 访问 `http://localhost:8083/api/v1/health` 返回 200 |
|
||||
| 8 | ✅ voice-service 启动成功 | 访问 `http://localhost:8093/api/v1/health` 返回 200 |
|
||||
| 9 | ✅ ai-core 启动成功 | 访问 `http://localhost:8081/api/v1/health` 返回 200 |
|
||||
| 10 | ✅ gateway 启动成功 | 访问 `http://localhost:8080/api/v1/health` 返回 200 |
|
||||
| 11 | ✅ 前端开发服务器启动 | 访问 `http://localhost:5173` 显示登录页面 |
|
||||
| 12 | ✅ WebSocket 连接正常 | 登录后聊天功能正常,能收到 AI 回复 |
|
||||
| 13 | ✅ IoT 设备控制正常 | 发送 IoT 控制指令,设备响应正确 |
|
||||
| 14 | ✅ 语音合成 (TTS) 正常 | AI 回复能正常播放语音 |
|
||||
| 15 | ✅ 语音识别 (ASR) 正常 | 语音输入能被正确识别 |
|
||||
| 6 | ✅ iot-debug-service 启动成功 | 访问 `http://localhost:8083/api/v1/health` 返回 200 |
|
||||
| 7 | ✅ voice-service 启动成功 | 访问 `http://localhost:8093/api/v1/health` 返回 200 |
|
||||
| 8 | ✅ ai-core 启动成功 | 访问 `http://localhost:8081/api/v1/health` 返回 200 |
|
||||
| 9 | ✅ gateway 启动成功 | 访问 `http://localhost:8080/api/v1/health` 返回 200 |
|
||||
| 10 | ✅ 前端开发服务器启动 | 访问 `http://localhost:5173` 显示登录页面 |
|
||||
| 11 | ✅ WebSocket 连接正常 | 登录后聊天功能正常,能收到 AI 回复 |
|
||||
| 12 | ✅ IoT 设备控制正常 | 发送 IoT 控制指令,设备响应正确 |
|
||||
| 13 | ✅ 语音合成 (TTS) 正常 | AI 回复能正常播放语音 |
|
||||
| 14 | ✅ 语音识别 (ASR) 正常 | 语音输入能被正确识别 |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
- **互联网搜索** — 自托管 SearXNG 搜索引擎,支持百度/必应/搜狗/360
|
||||
- **PWA** — 可安装为桌面/移动应用
|
||||
- **多平台桥接** — QQ / Telegram / Discord / Webhook 第三方平台接入
|
||||
- **插件系统** — 14 个内置插件(计算器/HTTP/加密/搜索/IoT 等),沙箱隔离
|
||||
- **插件系统** — 15 个内置插件(计算器/HTTP/加密/搜索/IoT 等),沙箱隔离
|
||||
- **多模型配置** — 支持多 Provider / 多 Model / 路由规则
|
||||
|
||||
---
|
||||
|
||||
@@ -67,19 +67,20 @@ Cyrene(昔涟)是一个 AI 数字伴侣系统,以 React SPA 为前端,Go
|
||||
│ Gin Router → JWT Auth → Rate Limiter → Handlers │
|
||||
│ WebSocket Hub: 会话状态/消息缓存/IoT广播 │
|
||||
│ 规则引擎: 定时/事件触发自动化 │
|
||||
└───┬──────────┬──────────┬──────────┬──────────┬─────────────┘
|
||||
│ SSE │ HTTP │ HTTP │ HTTP │ HTTP
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌──────────────┐
|
||||
│AI-Core │ │Memory │ │Tool │ │Voice │ │IoT Debug │
|
||||
│ :8081 │ │:8091 │ │:8092 │ │:8093 │ │ :8083 │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│编排器 │ │PGVector│ │13工具 │ │whisper │ │8个模拟设备 │
|
||||
│意图分析 │ │语义搜索│ │调用日志│ │edge-tts│ │toggle/set/ │
|
||||
│子会话 │ │去重衰减│ │IoT客户端│ │TTS回退│ │history API │
|
||||
│人格系统 │ │ │ │ │ │ │ │传感器波动 │
|
||||
│思考引擎 │ │ │ │ │ │ │ │ │
|
||||
└────┬───┘ └────┬───┘ └────┬───┘ └────┬───┘ └──────────────┘
|
||||
└───┬──────────┬──────────┬──────────┬─────────────┘
|
||||
│ SSE │ HTTP │ HTTP │ HTTP
|
||||
▼ ▼ ▼ ▼
|
||||
┌────────┐ ┌────────┐ ┌────────┐ ┌──────────────┐
|
||||
│AI-Core │ │Memory │ │Voice │ │IoT Debug │
|
||||
│ :8081 │ │:8091 │ │:8093 │ │ :8083 │
|
||||
│ │ │ │ │ │ │ │
|
||||
│编排器 │ │PGVector│ │whisper │ │8个模拟设备 │
|
||||
│意图分析 │ │语义搜索│ │edge-tts│ │toggle/set/ │
|
||||
│子会话 │ │去重衰减│ │TTS回退│ │history API │
|
||||
│人格系统 │ │ │ │ │ │传感器波动 │
|
||||
│思考引擎 │ │ │ │ │ │ │
|
||||
│工具调用 │ │ │ │ │ │ │
|
||||
└────┬───┘ └────┬───┘ └────┬───┘ └──────────────┘
|
||||
│ │ │ │
|
||||
└──────────┴──────────┴──────────┘
|
||||
│
|
||||
@@ -713,7 +714,7 @@ postgres://cyrene:cyrene_pass@localhost:5432/cyrene_ai?sslmode=disable
|
||||
|
||||
### 7.3 已知缺项
|
||||
|
||||
- `messages` 表缺少 `msg_type` 列——目前通过 `role` 字段区分 action/chat(`role="action"` 表示动作消息)
|
||||
- `messages` 表 `msg_type` 通过后端 ServerMessage 自动填充(含 markdown/code),但数据库层面未持久化该字段,历史消息查询依赖 role 判断
|
||||
|
||||
---
|
||||
|
||||
@@ -738,7 +739,7 @@ postgres://cyrene:cyrene_pass@localhost:5432/cyrene_ai?sslmode=disable
|
||||
|
||||
1. **LLM 合成延迟**(3-4s):deepseek-v4-flash 调用是主要瓶颈,合成阶段无法被快速通道绕过
|
||||
2. **"开" 字歧义**:无法将单独的 "开" 加入快速通道("开心"/"开始" 产生误判),"开灯" 等短命令仍走 LLM
|
||||
3. **msg_type 数据库列缺失**:messages 表使用 `role` 字段区分 action/chat,不是专用的 `msg_type` 列
|
||||
3. **msg_type 数据库持久化**:后端 ServerMessage 已自动填充 msg_type(含 markdown/code),但数据库 messages 表未存储该字段
|
||||
4. **Node.js v24 Windows 原生 WebSocket bug**:频繁建立连接可能触发 libuv `UV_HANDLE_CLOSING` 断言
|
||||
5. **流式审查**:`parseReviewMessages()` 需要等 LLM 合成完成后才能执行,无法实时拆分
|
||||
6. **`frontend/packages/shared/`** 和 **`backend/proto/`** 为空占位
|
||||
@@ -746,7 +747,7 @@ postgres://cyrene:cyrene_pass@localhost:5432/cyrene_ai?sslmode=disable
|
||||
### 建议改进方向
|
||||
|
||||
1. **LLM 响应缓存**:对相似问候/常见 IoT 命令引入语义缓存
|
||||
2. **数据库迁移**:为 messages 表添加 `msg_type` 列
|
||||
2. **数据库迁移**:为 messages 表添加 `msg_type` 列以持久化消息类型(当前仅 ServerMessage 传输层携带)
|
||||
3. **流式审查**:在 LLM 合成过程中实时识别并分段发送 action/chat
|
||||
4. **Protobuf 通信**:填充 `backend/proto/` 目录,服务间改用 gRPC
|
||||
5. **WebSocket 兼容**:生产环境使用 `ws` npm 包替代原生 WebSocket
|
||||
@@ -764,7 +765,6 @@ postgres://cyrene:cyrene_pass@localhost:5432/cyrene_ai?sslmode=disable
|
||||
| AI-Core | 8081 | net/http + SSE |
|
||||
| IoT Debug | 8083 | net/http |
|
||||
| Memory | 8091 | net/http + pgvector |
|
||||
| Tool Engine | 8092 | net/http |
|
||||
| Voice | 8093 | net/http + whisper.cpp |
|
||||
| Frontend (dev) | 5173 | Vite |
|
||||
| DevTools | 9090 | Express |
|
||||
|
||||
Reference in New Issue
Block a user