← Back to Skills Marketplace
chen6896qqwee

曙光记忆系统

by chen6896qqwee · GitHub ↗ · v4.0.0 · MIT-0
cross-platform ⚠ suspicious
88
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install shuguang-memory
Description
曙光智能记忆系统 v4.0 - 五层金字塔架构 (HOT→DAILY→WEEKLY→CORE→ARCHIVE)。 支持 Weibull 衰减、混合检索、WAL 协议、自我改进治理。 当用户需要持久记忆、跨会话回忆、自动归档时触发。
README (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活下去的方式。

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install shuguang-memory
  3. After installation, invoke the skill by name or use /shuguang-memory
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug shuguang-memory
Version 4.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 曙光记忆系统?

曙光智能记忆系统 v4.0 - 五层金字塔架构 (HOT→DAILY→WEEKLY→CORE→ARCHIVE)。 支持 Weibull 衰减、混合检索、WAL 协议、自我改进治理。 当用户需要持久记忆、跨会话回忆、自动归档时触发。 It is an AI Agent Skill for Claude Code / OpenClaw, with 88 downloads so far.

How do I install 曙光记忆系统?

Run "/install shuguang-memory" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 曙光记忆系统 free?

Yes, 曙光记忆系统 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 曙光记忆系统 support?

曙光记忆系统 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 曙光记忆系统?

It is built and maintained by chen6896qqwee (@chen6896qqwee); the current version is v4.0.0.

💬 Comments