xiaowei-system/README.md

113 lines
4.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 小唯系统 (xiaowei-system)
> 小唯 A06 的大脑层 | Gitea: http://192.168.123.11:3000/xiaoxue_admin/xiaowei-system/
---
## 相关项目关系图
```
┌─────────────────────────────────────────────────────────┐
│ 基础设施层(独立仓库,独立进程) │
│ │
│ 织忆 memoryweave TencentDB │
│ /tmp/memoryweave/ ~/.memory-tencentdb/ │
│ port 7821 port 8420 │
│ zhiyid + LanceDB tdai-gateway (Node.js) │
│ + bge-embed │
└────────────────────┬────────────────────────────────────┘
│ HTTP APIlocalhost
┌─────────────────────────────────────────────────────────┐
│ 上层应用层(小唯系统 xiaowei-system
│ │
│ ~/.hermes/ ← 本仓库 │
│ │
│ ┌─────────┐ ┌──────────┐ ┌─────────┐ ┌──────────┐ │
│ │ Soulful │ │ daemon │ │ cron │ │ skills │ │
│ │ 牵挂 │ │ 持久意识 │ │ 定时任务│ │ 仓颉技能 │ │
│ │ 心迹 │ │ L1→L6 │ │ 自检 │ │ 股票投研 │ │
│ │ 画像 │ │ 蒸馏 │ │ 升级 │ │ │ │
│ └─────────┘ └──────────┘ └─────────┘ └──────────┘ │
│ │
│ daemon.py → 统一写入 → llm_context.jsonL7统一层
└─────────────────────────────────────────────────────────┘
参考项目Gitea
agent-memory-skill — tier分层/线性衰减
memory-os — 7层记忆架构
```
---
## 各项目详情
| 项目 | 源码位置 | Gitea | 进程 |
|------|---------|-------|------|
| **织忆 memoryweave** | `/tmp/memoryweave/` | `xiaoxue_admin/memoryweave` | zhiyid (7821) + bge-embed (8000) |
| **TencentDB memory-tdai** | `~/.memory-tencentdb/memory-tdai/` | 无(未版本控制)| tdai-gateway (8420) |
| **Soulful**(牵挂/心迹/画像)| `~/.hermes/soulful/` | 随 xiaowei-system | daemon.py 读写 |
| **xiaowei-system** | `~/.hermes/` | `xiaoxue_admin/xiaowei-system` | daemon.py持久意识|
**Soulful 是 xiaowei-system 的子模块**,数据文件在 `~/.hermes/soulful/`
- `cares-queue.json` — 牵挂队列
- `heart-traces.jsonl` — 心迹(重要时刻记录)
- `user-profile.json` — 用户画像(含 distilled_rules
---
## 安装顺序
```
第一步:织忆(底层存储引擎)
→ /tmp/memoryweave/port 7821
第二步TencentDB对话记忆
→ ~/.memory-tencentdb/port 8420
第三步:小唯系统(上层应用)
→ ~/.hermes/daemon.py
```
---
## 架构依赖
```
小唯系统(daemon.py)
├── http://127.0.0.1:7821 ← 织忆 L1/L2 recallX-API-Key
├── http://127.0.0.1:8420 ← TencentDB L3/L4 scenes/capture + /recall
├── ~/.hermes/soulful/ ← Soulful L5/L6cares + heart-traces + profile
└── → 统一写入 ~/.hermes/llm_context.jsonL7
```
---
## 小唯系统内容
```
~/.hermes/ ← xiaowei-system 仓库
├── daemon.py — 持久意识 daemonL1→L6 蒸馏管道)
├── memory_recall.py — 统一记忆读取入口
├── llm_context.json — L7 统一上下文(唯一读取入口)
├── soulful/ — Soulful 数据(牵挂/心迹/画像)
├── scripts/
│ ├── memory-system-check.sh — 定时自检
│ ├── memory-system-self-upgrade.py — 每日升级
│ └── stock_*.py — 股票投研 cron 套件
├── skills/ — Hermes Skills仓颉书库蒸馏
└── cron/ — 定时任务定义
```
---
## 定时任务
```bash
hermes cron list
```
关键任务:
- `memory-system-check.sh` — 每小时自检(正常静默,异常飞书)
- `memory-system-self-upgrade.py` — 每天 04:00 自我升级
- `daemon.py` — 持久意识light tick 30sdeep tick 5min