bagua-memory

v1.0.0

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

1· 38·0 current·0 all-time
by良鼠@xuanyizhi

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for xuanyizhi/bagua-memory.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "bagua-memory" (xuanyizhi/bagua-memory) from ClawHub.
Skill page: https://clawhub.ai/xuanyizhi/bagua-memory
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install bagua-memory

ClawHub CLI

Package manager switcher

npx clawhub@latest install bagua-memory
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
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.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

latestvk975hdh4k47779f625pjc31nqx85p3ns
38downloads
1stars
1versions
Updated 6h ago
v1.0.0
MIT-0

八卦记忆系统

基于文件的记忆管理框架,零依赖,适用于任何能读写本地文件的 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/<卦位>/ 下的 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/ 各卦位下。

Comments

Loading comments...