← 返回 Skills 市场
曙光记忆系统
作者
chen6896qqwee
· GitHub ↗
· v4.0.0
· MIT-0
88
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install shuguang-memory
功能描述
曙光智能记忆系统 v4.0 - 五层金字塔架构 (HOT→DAILY→WEEKLY→CORE→ARCHIVE)。 支持 Weibull 衰减、混合检索、WAL 协议、自我改进治理。 当用户需要持久记忆、跨会话回忆、自动归档时触发。
使用说明 (SKILL.md)
曙光记忆系统 v4.0
不是聊天机器人的临时记忆。是AI的持久大脑。
五层金字塔架构
| 层级 | 文件 | 保留时间 | 用途 |
|---|---|---|---|
| HOT | session-state.json + working-buffer.md |
当前会话 | 热数据、持仓、任务状态 |
| DAILY | memory/YYYY-MM-DD.md |
7天 | 每日日志、当日交易、学习 |
| WEEKLY | memory/weekly/YYYY-WXX.md |
4周 | 周报、技能扫描、总结 |
| CORE | memory/core/*.json |
永久 | 身份、策略、偏好、教训 |
| ARCHIVE | memory/archive/ |
长期 | 历史归档、压缩存储 |
核心特性
1. Weibull 衰减模型
S(t) = exp(-(t/λ)^k)
- Core层: 半衰期90天,重要性≥0.8
- Working层: 半衰期30天,重要性≥0.4
- Peripheral层: 半衰期7天,自动遗忘
2. 混合检索 (向量 + BM25)
- 语义相似度: 70% 权重
- 关键词匹配: 30% 权重
- 无需外部向量数据库,纯本地实现
3. WAL 协议
先写文件,再回复用户。
任何修正、偏好、决策、专有名词 → 立即写入 session-state.json → 再回复。
4. 自我改进治理
- 自动从失败中提取教训
- 记录到
memory/core/lessons.json - 重复错误自动触发熔断
快速启动
首次使用
from memory_system import ShuguangHybridMemory
memory = ShuguangHybridMemory(
memory_dir="./memory",
agent_name="曙光"
)
# 保存记忆
memory.remember(
text="用户偏好:不做科创板和ST",
category="preference",
importance=0.95
)
# 召回记忆
results = memory.recall("用户股票偏好", top_k=3)
记忆写入 (WAL)
# 必须在回复用户前执行
memory.wal_write({
"type": "decision",
"content": "止损华银电力",
"reason": "主力出货+D级评分"
})
文件结构
memory/
├── daily/
│ └── 2026-05-03.md # 今日日志
├── weekly/
│ └── 2026-W18.md # 本周总结
├── core/
│ ├── identity.json # 身份定义
│ ├── preferences.json # 用户偏好
│ ├── strategies.json # 策略配置
│ └── lessons.json # 教训记录
├── archive/
│ └── 2026-04.tar.gz # 月度归档
└── working-buffer.md # 危险区日志
记忆类型 (category)
| 类型 | 说明 | 示例 |
|---|---|---|
preference |
用户偏好 | "讨厌废话" |
fact |
事实 | "六脉神剑V4.1胜率71.4%" |
decision |
决策 | "78分门槛最优" |
entity |
实体 | "华银电力600744" |
reflection |
反思 | "单票90%仓位是赌博" |
other |
其他 | "..." |
维护任务
每天凌晨3点
- 遗忘曲线应用 → 降低旧记忆权重
- 冲突解决 → 合并重复记忆
每周日
- 记忆统计 → 生成健康报告
- 归档过期日志 → 压缩到 archive/
依赖
- Python 3.8+
- 无外部数据库依赖
- 可选:
pip install numpy(用于向量计算)
来源
- 掠夺自: memory-lancedb-pro, memory-os, omni-memory
- 整合: 曙光核心操作系统 (shuguang-core)
- 版本: v4.0.0
Text > Brain。想记住就写文件。这是AI活下去的方式。
安全使用建议
Install only if you intentionally want a persistent local memory system. Before using it, decide what it may save, require confirmation for memory writes, avoid storing passwords or highly sensitive personal/business details, and periodically inspect or delete the memory files.
功能分析
Type: OpenClaw Skill
Name: shuguang-memory
Version: 4.0.0
The bundle implements a sophisticated multi-layered memory system for AI agents, featuring hybrid retrieval (BM25 and character-based vector similarity) and a Weibull decay model for memory retention. It manages local state and logs within the OpenClaw workspace (e.g., `memory_store.json`, `ERRORS.md`, and `LEARNINGS.md` in `shuguang_hybrid_memory.py`) to persist agent preferences and lessons learned. The instructions in `SKILL.md` regarding the 'WAL' (Write-Ahead Logging) protocol are functional behavioral guidelines for state persistence rather than malicious prompt injections, and no evidence of data exfiltration or unauthorized execution was found.
能力评估
Purpose & Capability
The memory purpose is coherent and disclosed, and the visible code implements local JSON-based memory storage. However, the skill asks for broad automatic capture of corrections, preferences, decisions, and proper nouns into persistent memory, which is more open-ended than a user-controlled save/recall tool.
Instruction Scope
The WAL instruction says memories must be written before replying and applies to broad categories of conversation content. The artifacts do not show per-item approval, exclusions for secrets/sensitive topics, retention controls, or a clear deletion workflow.
Install Mechanism
There is no install spec or remote installer, which limits install-time risk. The source/provenance is unclear, and the documentation references copied sources and an optional pip dependency, so users should review/pin anything they choose to run.
Credentials
The behavior appears local-only with no declared credentials or network access, which fits a memory tool. The concern is the breadth and longevity of the local stored data, including permanent core memory and long-term archives.
Persistence & Privilege
Persistence is central to the skill, but the artifacts describe permanent and long-term memory layers plus immediate writes before responses, without clear scoping, consent, or recovery controls.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install shuguang-memory - 安装完成后,直接呼叫该 Skill 的名称或使用
/shuguang-memory触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v4.0.0
Shuguang Memory System v4.0.0 introduces a new five-layer persistent memory architecture for AI agents.
- Implements a pyramid memory structure: HOT, DAILY, WEEKLY, CORE, ARCHIVE for tiered retention and recall.
- Adds support for Weibull decay, hybrid retrieval (semantic + keyword), WAL protocol, and self-improvement governance.
- Enables persistent, cross-session memory with automatic archiving and lesson extraction.
- No external database required; all memory is stored locally.
- Designed for robust, long-term AI memory—not just temporary chatbot state.
元数据
常见问题
曙光记忆系统 是什么?
曙光智能记忆系统 v4.0 - 五层金字塔架构 (HOT→DAILY→WEEKLY→CORE→ARCHIVE)。 支持 Weibull 衰减、混合检索、WAL 协议、自我改进治理。 当用户需要持久记忆、跨会话回忆、自动归档时触发。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 88 次。
如何安装 曙光记忆系统?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install shuguang-memory」即可一键安装,无需额外配置。
曙光记忆系统 是免费的吗?
是的,曙光记忆系统 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
曙光记忆系统 支持哪些平台?
曙光记忆系统 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 曙光记忆系统?
由 chen6896qqwee(@chen6896qqwee)开发并维护,当前版本 v4.0.0。
推荐 Skills