Xpersona
Y

Yaoyao Memory Homo

CLAWHUB · Unverified

六层架构记忆系统 - 让 AI 跨会话保持上下文、沉淀知识、持续进化 【本地存储】SQLite 数据库 【全文搜索】FTS5 搜索引擎 【模块化】核心+可选模块,按需安装 Skill: Yaoyao Memory Homo Owner: taobaoaz Summary: 六层架构记忆系统 - 让 AI 跨会话保持上下文、沉淀知识、持续进化 【本地存储】SQLite 数据库 【全文搜索】FTS5 搜索引擎 【模块化】核心+可选模块,按需安装 Tags: latest:4.0.1 Version history: v4.0.1 | 2026-04-15T14:14:02.411Z | auto Hermes Bridge integration and engine/module refactor: - 集成 Hermes Bridge,支持 API 错误分类、智能路由、脱敏、限流等功能。 - 新增 Hermes 适配脚本与 API 端点 (/api/hermes_status),支持管理与监控 Hermes 能力。 - 重构核心引擎,增加 engine/ (analytics, backup, c

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s1722r4y63245f5qzbjyqyerwh843vhe:yaoyao-memory-v2
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-taobaoaz-yaoyao-memory-v2/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

160,000 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: yaoyao-memory
version: 4.0.0
description: |
  六层架构记忆系统 - 让 AI 跨会话保持上下文、沉淀知识、持续进化
  【本地存储】SQLite 数据库
  【全文搜索】FTS5 搜索引擎
  【模块化】核心+可选模块,按需安装
---

# yaoyao-memory 🦞

> 六层架构记忆系统 - 你的第二大脑

---

## 快速开始

```bash
# 初始化
python3 scripts/init_memory.py

# 搜索记忆
python3 scripts/search.py "关键词"

# 健康检查
python3 scripts/health_check.py
```

---

## 核心功能

| 功能 | 说明 |
|------|------|
| 记忆存储 | SQLite 本地持久化 |
| 全文搜索 | FTS5 搜索引擎 |
| 向量搜索 | 可选的向量索引 |
| 云端同步 | IMA + NAS 双通道 |
| 自动遗忘检测 | v2多维度衰减+矛盾检测 |
| 知识图谱 | 记忆关联分析 |
| 硬件检测 | 自动识别AVX512/AMX/NEON |
| 预测维护 | 预测增长+维护计划 |
| 对话管理 | 多轮对话历史管理 |
| 批量操作 | 导入/导出/删除/更新 |
| 智能标签 | 自动标签/合并/清理 |
| WAL模式 | SQLite性能优化 |
| 命令行搜索 | quick_search CLI工具 |

---

## 六层架构

| 层级 | 功能 | 核心模块 |
|------|------|----------|
| L1 捕获 | 对话记忆捕获 | conversation_summarizer |
| L2 增强 | 遗忘检测/摘要 | forget_detector |
| L3 索引 | 搜索/向量 | search, vector_store |
| L4 管理 | 记忆 CRUD | memory |
| L5 治理 | 安全/权限 | security, governance |
| L6 基础 | 配置/路径 | paths, config |

---

## 目录结构

```
yaoyao-memory-v2/
├── SKILL.md              # 本文档
├── ARCHITECTURE.md       # 架构详解
├── CHANGELOG.md         # 版本历史
├── SECURITY.md          # 安全声明
├── FUNCTIONS.md         # 功能清单 (103个)
│
├── src/
│   ├── core/            # 核心模块
│   └── scripts/         # 工具脚本
│
├── html/                # Web界面
└── tests/              # 测试
```

---

## 常用命令

### 记忆操作
```bash
# 初始化
python3 scripts/init_memory.py

# 搜索
python3 scripts/search.py "查询内容"

# 统计
python3 scripts/memory_stats.py
```

### 系统维护
```bash
# 健康检查
python3 scripts/health_check.py

# 自动修复
python3 scripts/auto_fixer.py fix

# 性能优化
python3 scripts/benchmark.py
```

### 云同步
```bash
# IMA同步
python3 scripts/sync_ima.py

# NAS同步
python3 scripts/sync_to_nas.py
```

---

## 配置

配置文件:`~/.openclaw/workspace/memory/config/`

| 配置项 | 说明 |
|--------|------|
| `memory.db` | SQLite 主数据库 |
| `vectors.db` | 向量数据库 |
| `feature_flags.json` | 功能开关 |

---

## 安全

- ✅ 上下文隔离标签
- ✅ 子Agent工具过滤
- ✅ RBAC权限控制
- ✅ 安装前安全扫描
- ✅ subprocess timeout

文档:
- [SECURITY.md](./SECURITY.md) - 安全架构
- [SECURITY_FIX.md](./SECURITY_FIX.md) - 安全修复报告
- [RESEARCH.md](./RESEARCH.md) - 友商调研报告
- [MAINTENANCE.md](./MAINTENANCE.md) - 维护指南

---

## 变更记录

- [CHANGELOG.md](./CHANGELOG.md) - 完整版本历史
- [FUNCTIONS.md](./FUNCTIONS.md) - 103个功能清单

---

## 🔗 Hermes Bridge 集成

v4.0.0 集成 hermes-bridge 能力:

| 模块 | 功能 |
|------|------|
| error_classifier | API 错误分类 + 恢复决策 |
| smart_routing | 简单查询 → 便宜模型 |
| context_compressor | 结构化摘要压缩 |
| insights | 使用洞察生成 |
| trajectory | 对话轨迹记录 |
| redact | 敏感信息脱敏 |
| rate_limit | API 限流追踪 |

**API 端点**:`GET /api/hermes_status`

```bash
# 启动带 Hermes 的 API Server
python3 scripts/api_server.py --port 8765
```

---

_版本: 4.0.1 | 更新: 2026-04-15_

docs/architecture/README.md

# yaoyao-memory 架构文档

> **版本**: v3.9.0 | **参考**: 鸽子王六层架构

---

## 文档索引

| 文档 | 说明 |
|------|------|
| [LAYER_INTERFACES.md](./LAYER_INTERFACES.md) | 层间接口规范 |
| [SIX_LAYER_MAPPING.md](./SIX_LAYER_MAPPING.md) | 六层对照表 |

---

## 架构总览

```
┌─────────────────────────────────────────────────────────────┐
│                    yaoyao-memory 架构                        │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  L1: Identity (身份层)                                       │
│      └── SOUL.md, IDENTITY.md, USER.md                      │
│                                                             │
│  L2: Memory Context (记忆层)                                  │
│      └── MEMORY.md, memory/*.md, predictive_cache.py        │
│                                                             │
│  L3: Orchestration (编排层) ← NEW                           │
│      └── fast_path.py, query_cache.py                       │
│                                                             │
│  L4: Execution (执行层)                                      │
│      └── 63 scripts, memory.py, search.py                   │
│                                                             │
│  L5: Governance (治理层) ← NEW                               │
│      └── governance.py, audit.py, security.py               │
│                                                             │
│  L6: Infrastructure (基础设施层) ← NEW                       │
│      └── infrastructure.py, backup_manager.py, monitoring    │
│                                                             │
└─────────────────────────────────────────────────────────────┘
```

---

## 六层对照 (vs 鸽子王)

| 鸽子王层级 | yaoyao-memory 实现 | 状态 |
|-----------|-------------------|------|
| L1 core | SOUL.md + IDENTITY.md + USER.md | ✅ 完整 |
| L2 memory_context | MEMORY.md + memory/*.md | ✅ 完整 |
| L3 orchestration | fast_path.py + query_cache.py | 🆕 新增 |
| L4 execution | 63个脚本模块 | ✅ 完整 |
| L5 governance | governance.py + audit.py | 🆕 新增 |
| L6 infrastructure | infrastructure.py + backup_manager.py | 🆕 新增 |

---

## 核心模块

### 记忆系统
- `memory.py` - 主记忆引擎
- `search.py` - 统一搜索入口
- `predictive_cache.py` - 预测性缓存 (v2.0 with TTL)

### 性能优化
- `token_optimizer.py` - Token预算控制
- `fast_path.py` - 简单查询快速路径
- `query_cache.py` - 查询缓存

### 治理与安全
- `governance.py` - 治理主模块
- `audit.py` - 审计日志
- `security.py` - 安全检查

### 基础设施
- `infrastructure.py` - 基础设施主模块
- `backup_manager.py` - 备份管理
- `health_check.py` - 健康检测

---

## 版本历史

| 版本 | 日期 | 说明 |
|------|------|------|
| v3.9.0 | 2026-04-10 | 新增六层架构对照、Token预算、快速路径、治理层、基础设施层 |

README.md

# 摇摇记忆系统 (yaoyao-memory)

> 四层渐进式长时记忆系统,让 AI 跨会话保持上下文、沉淀知识、持续进化

## ✨ 核心特性

- **智能确认** — AI 自动识别重要记忆,记录前确认
- **四层架构** — 短期 → 中期 → 长期 → 档案,渐进式沉淀
- **重要性分级** — Critical / High / Normal / Low 四级
- **记忆分类** — decision / preference / learning / task 等 8 种类型
- **混合检索** — 向量搜索 + 全文搜索,精准召回
- **IMA 同步** — 可选云端备份到 IMA 知识库

## 📖 新手入门

**👉 首先阅读:[QUICKSTART.md](./QUICKSTART.md)** - 小白友好指南

---

## 🚀 快速开始

### 安装

```bash
npx clawhub@latest install yaoyao-memory
```

### 查看新手教程

```bash
# 小白入门(推荐先看)
cat ~/.openclaw/workspace/skills/yaoyao-memory-v2/QUICKSTART.md

# 高级配置
cat ~/.openclaw/workspace/skills/yaoyao-memory-v2/ADVANCED.md
```

---

## 📚 记忆层级

| 层级 | 存储位置 | 保留时长 | 用途 |
|:---|:---|:---|:---|
| 短期 | 对话上下文 | 当前会话 | 即时交互 |
| 中期 | memory/*.md | 7-30 天 | 近期事项 |
| 长期 | MEMORY.md | 30 天+ | 核心知识 |
| 档案 | IMA 知识库 | 永久 | 知识沉淀 |

---

## 🔧 常用命令

| 命令 | 用途 |
|------|------|
| `python3 scripts/warmup.py` | 预热缓存 |
| `python3 scripts/health_check.py` | 健康检查 |
| `python3 scripts/benchmark.py` | 性能测试 |

详细命令请查看 [ADVANCED.md](./ADVANCED.md)

---

## 📁 文档目录

| 文件 | 用途 |
|------|------|
| [QUICKSTART.md](./QUICKSTART.md) | 🎓 小白入门指南 |
| [ADVANCED.md](./ADVANCED.md) | 🔧 高级配置参考 |
| [BOOTSTRAP.md](./BOOTSTRAP.md) | 🚀 首次使用引导 |
| [CHANGELOG.md](./CHANGELOG.md) | 📜 完整更新日志 |
| [SKILL.md](./SKILL.md) | 📄 技能完整文档 |

---

## 🔗 相关链接

- [ClawHub](https://clawhub.ai/skills/yaoyao-memory)
- [OpenClaw 文档](https://docs.openclaw.ai)
- [IMA 知识库](https://ima.qq.com)

---

## 📄 License

MIT

_meta.json

{
  "ownerId": "kn74j824bn4xq1y1td0h2k093s8432mx",
  "slug": "yaoyao-memory-v2",
  "version": "4.0.1",
  "publishedAt": 1776262442411
}

references/heartbeat-maintenance.md

# 心跳维护指南

本文档说明心跳时如何执行记忆维护任务。

## 心跳触发

心跳由 OpenClaw 定期触发,触发时会读取 `HEARTBEAT.md`。

## 维护任务轮换

不必每次心跳都执行所有任务,建议轮换执行:

| 轮次 | 任务 | 频率 |
|------|------|------|
| 1 | 中期记忆审查 | 每2天 |
| 2 | 长期记忆更新 | 每周 |
| 3 | 过期清理 | 每周 |
| 4 | IMA 同步 | 每月 |

## 任务详情

### 1. 中期记忆审查

**目标**:识别需要升级的内容

**步骤**:
1. 读取最近7天的 `memory/*.md` 文件
2. 查找带 `#重要`、`#决策`、`#错误` 标签的内容
3. 判断是否需要升级到 MEMORY.md
4. 执行升级或标记待升级

**脚本**:
```bash
python3 scripts/promote.py --days 7 --dry-run  # 预览
python3 scripts/promote.py --days 7            # 执行
```

### 2. 长期记忆更新

**目标**:更新 MEMORY.md 中的用户档案和待处理事项

**步骤**:
1. 读取 USER.md,检查是否需要更新
2. 检查 MEMORY.md 中的待处理事项
3. 标记已完成的事项
4. 添加新发现的用户偏好

**手动操作**:直接编辑 MEMORY.md

### 3. 过期清理

**目标**:清理超过30天的中期记忆

**步骤**:
1. 扫描 `memory/*.md` 文件
2. 识别超过30天的文件
3. 检查是否包含重要内容
4. 归档或删除

**脚本**:
```bash
python3 scripts/cleanup.py --retention 30 --dry-run  # 预览
python3 scripts/cleanup.py --retention 30 --action auto  # 执行
```

### 4. IMA 同步

**目标**:备份重要内容到 IMA 知识库

**前置条件**:配置 IMA 凭证

**步骤**:
1. 提取 MEMORY.md 中的决策/错误教训
2. 调用 IMA API 创建笔记
3. 记录同步状态

**脚本**:
```bash
python3 scripts/sync_ima.py --type decision --dry-run  # 预览
python3 scripts/sync_ima.py --type decision            # 执行
```

## 状态追踪

维护 `memory/heartbeat-state.json`:

```json
{
  "lastChecks": {
    "midTermReview": "2024-01-15T00:00:00Z",
    "longTermUpdate": "2024-01-14T00:00:00Z",
    "expiredCleanup": "2024-01-10T00:00:00Z",
    "imaSync": null
  },
  "stats": {
    "totalMemories": 42,
    "promotedThisMonth": 3,
    "cleanedThisMonth": 12
  }
}
```

## 心跳响应模板

**有任务时**:
```
🔄 记忆维护中...

- 检查中期记忆:发现 2 条待升级内容
- 已升级到 MEMORY.md

✅ 维护完成
```

**无任务时**:
```
HEARTBEAT_OK
```

## 注意事项

1. **静默时段**:23:00-08:00 除非紧急,否则只返回 HEARTBEAT_OK
2. **频率控制**:同一任务不要在短时间内重复执行
3. **错误处理**:脚本失败时记录错误,下次心跳重试
4. **用户优先**:如果用户正在对话,延迟执行维护任务

Sponsored

Ads related to Yaoyao Memory Homo and adjacent AI workflows.