← Back to Skills Marketplace
xuanyizhi

bagua-memory

by 良鼠 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
56
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install bagua-memory
Description
八卦记忆系统 (Bagua Memory) - AI Agent 记忆管理框架。 将记忆按八个维度(规则/知识/热记忆/决策/事件/关联/归档/偏好)分类存储, 通过生命周期自动衰减和卦变关联联想检索。 使用场景: (1) 为 AI Agent 建立结构化的长期记忆系统 (2) 管理 workspace 中的记忆...
README (SKILL.md)

八卦记忆系统

基于文件的记忆管理框架,零依赖,适用于任何能读写本地文件的 AI Agent。

详细架构见 references/architecture.md(权威来源:memory/bagua/README.md)。

⚡ 自激活(首次触发必做)

检测条件:如果 AGENTS.mdSOUL.md 中不存在 ## 记忆规则 章节,说明尚未激活。

激活步骤

  1. 运行 bash scripts/init_bagua.sh .(在 workspace 根目录,自动创建 memory/ 和 MEMORY.md)
  2. 读取 references/soul-inject.md,将其内容追加到 AGENTS.md(或 SOUL.md)末尾
  3. 如果 HEARTBEAT.md 存在,将 references/heartbeat-inject.md 追加进去
  4. 告知用户:"八卦记忆系统已激活 ✅"

核心流程

写入记忆

  1. 新信息按归类指南判断所属卦位
  2. 写入对应 memory/bagua/\x3C卦位>/ 下的 Markdown 文件
  3. 文件命名:YYYY-MM-DD.md(时间线类)或按主题命名

检索记忆(渐进式)

  1. L0:读 MEMORY.md(索引+归类指南)
  2. L1:根据话题读 1-2 个相关卦位
  3. L2:复杂检索时读 memory/bagua/README.md(卦变关联表)

记忆维护

  1. 归档:离卦超过 7 天 → 移入艮卦
  2. 压缩:艮卦超过 30 天 → 摘要化
  3. 恢复:归档记忆再次被引用 → 升回原卦位

八卦速查

目录 存什么 边界
☰ 乾 qian/ 系统规则、行为准则 -
☷ 坤 kun/ 知识库、事实 相对稳定的信息
☲ 离 li/ 近期新发现 只放"新东西",不放对话总结
☵ 坎 kan/ 决策推理 只记"为什么"(reason)
☳ 震 zhen/ 事件时间线 只记"发生了什么"(fact)
☴ 巽 xun/ 关联网络 人/项目/概念关系
☶ 艮 gen/ 归档记忆 冷却中的旧记忆
☱ 兑 dui/ 用户偏好 风格、习惯、情感

与 MEMORY.md 的关系

MEMORY.md 是入口(L0),记忆本体在 memory/bagua/ 各卦位下。

Usage Guidance
This skill appears to do what it says: create a file-based memory structure and inject rules into agent config files. Before activating it: 1) Inspect references/soul-inject.md and references/heartbeat-inject.md to confirm you accept the injected rules. 2) Backup AGENTS.md and SOUL.md (and any other workspace config) so you can revert unwanted changes. 3) Consider running scripts/init_bagua.sh manually rather than allowing automatic self-activation so you control when files are created and appended. 4) Be aware that the skill will store information in workspace files and will delete/modify those files when instructed to 'forget'—do not put secrets into conversation content if you do not want them persisted. If you need higher assurance, run the init script in a sandboxed workspace first.
Capability Analysis
Type: OpenClaw Skill Name: bagua-memory Version: 1.0.0 The bagua-memory skill is a structured file-based memory management framework for AI agents. It uses a shell script (scripts/init_bagua.sh) to initialize a local directory structure and provides markdown templates (references/soul-inject.md) to guide the agent in categorizing and archiving information. All operations are local to the workspace, and there is no evidence of data exfiltration, malicious network activity, or unauthorized system access.
Capability Assessment
Purpose & Capability
The name/description (long-term memory management) match the delivered artifacts: an init script that creates a memory/bagua directory structure, README and MEMORY.md templates, and instructions for writing/reading/archiving memories. No unrelated binaries or credentials are requested.
Instruction Scope
SKILL.md instructs the agent to read and write local files (memory/, MEMORY.md) and to append the contents of references/soul-inject.md (and heartbeat-inject.md) into AGENTS.md or SOUL.md. That behavior is coherent with establishing persistent memory rules, but it is intrusive because it modifies shared configuration files in the workspace. There are no network endpoints or exfiltration steps.
Install Mechanism
There is no external install/download. The init script is bundled with the skill and only uses standard POSIX commands to create directories and write files. No archives or remote fetches are performed.
Credentials
The skill requests no environment variables, credentials, or config paths. All file operations are confined to the workspace (memory/ and workspace-level MEMORY.md, AGENTS.md, SOUL.md, HEARTBEAT.md).
Persistence & Privilege
The skill does not set always:true, but it does persistently modify workspace config files (appending the memory-rule block into AGENTS.md or SOUL.md). That gives the skill a lasting influence on agent behavior across sessions; this is plausible for a memory system but should be explicitly authorized by the user.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install bagua-memory
  3. After installation, invoke the skill by name or use /bagua-memory
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of 八卦记忆系统 (Bagua Memory), an AI Agent memory management framework. - 乾、坤、离、坎、震、巽、艮、兑. Hexagram Retrieval - Organizes memory into eight categories (rules, knowledge, hot memory, decision, event, association, archive, preference) with lifecycle-based decay and associative retrieval. - Structured for file-based storage; suitable for any AI Agent with local file access. - Provides self-activation instructions and detailed workflows for memory writing, retrieval, archival, compression, and recovery. - Features progressive memory lookup and clear categorization via the "bagua" model. - the current skill is for openclaw.
Metadata
Slug bagua-memory
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is bagua-memory?

八卦记忆系统 (Bagua Memory) - AI Agent 记忆管理框架。 将记忆按八个维度(规则/知识/热记忆/决策/事件/关联/归档/偏好)分类存储, 通过生命周期自动衰减和卦变关联联想检索。 使用场景: (1) 为 AI Agent 建立结构化的长期记忆系统 (2) 管理 workspace 中的记忆... It is an AI Agent Skill for Claude Code / OpenClaw, with 56 downloads so far.

How do I install bagua-memory?

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

Is bagua-memory free?

Yes, bagua-memory is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does bagua-memory support?

bagua-memory is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created bagua-memory?

It is built and maintained by 良鼠 (@xuanyizhi); the current version is v1.0.0.

💬 Comments