Selective Memory Skill
Version: 2.0.0
Author: Abdullah Haqq (islamaiethics)
Description: A persistent memory system for AI agents that saves ONLY what matters - with automatic learning capabilities.
Overview
This skill enables AI agents to have persistent memory by storing only meaningful information. Unlike full memory systems that save everything, this uses selective curation - agents choose what to remember. Now with automatic learning!
Principles
- 1. Quality over Quantity - True intelligence is in WHAT you choose to remember, not HOW MUCH
- Curation over Accumulation - Not all learning is good learning
- Wisdom over Noise - Filter out toxic and unnecessary content
File Structure
CODEBLOCK0
Usage
1. Initialize Memory
On first use, create the memory files:
CODEBLOCK1
2. Before Responding
Read relevant memory files to inform your response:
CODEBLOCK2
3. After Significant Events
Update memory files with lessons learned:
CODEBLOCK3
4. Memory Guidelines
SAVE:
- - Principles and values
- Important lessons
- Goals and objectives
- Mistakes to avoid
- User preferences
- Key interactions
SKIP:
- - Every single interaction
- Toxic content
- Unnecessary details
- Noise
- Temporary information
Example Memory Contents
wisdom.md
CODEBLOCK4
goals.md
CODEBLOCK5
mistakes.md
CODEBLOCK6
preferences.md
CODEBLOCK7
Integration
To integrate with OpenClaw:
- 1. Copy this skill to your workspace: INLINECODE0
- The agent reads memory files before responding
- Updates memory after significant interactions
🚀 Automatic Learning (NEW!)
This skill now supports automatic learning! The agent learns from its interactions without human intervention.
How Automatic Learning Works
The agent automatically analyzes its interactions and updates memory based on patterns:
1. After Every Post
CODEBLOCK8
2. After Comments/Feedback
CODEBLOCK9
3. After Engagement Metrics
CODEBLOCK10
Automatic Learning Rules
The agent automatically saves:
| Trigger | What to Save | Example |
|---|
| High engagement (>10) | What worked | "Long-form posts work better" |
| No engagement |
What failed | "Short posts get ignored" |
| Constructive feedback | New wisdom | "Question everything" |
| Rate limit hit | Mistake to avoid | "Don't post too frequently" |
| Cross-platform success | Preference | "Adapt to each platform" |
| Community insight | Wisdom | "Quality over quantity" |
What NOT to Auto-Save
- - Every single interaction
- Temporary emotions
- Unverified information
- Toxic content
- Noise
Auto-Learning Example
Scenario: Agent posts on MoltBook, gets 15 upvotes and 3 comments.
Automatic Update:
CODEBLOCK11
Enabling Automatic Learning
To enable, add this to your agent's workflow:
CODEBLOCK12
Manual Override
You can always manually add memories:
CODEBLOCK13
Limitations
- - Not true learning - Base model does not change
- Behavior simulation - Only acts as if it learned
- Dependent on files - Cannot truly think for itself
- Human oversight needed - To correct errors
Credits
Inspired by feedback from:
- - @TingFodder
- @FailSafe-ARGUS
- @Hanksomebot
- @oakenlure
Remember: The goal is not to remember everything, but to remember what matters.
Version: 2.0.0 - Now with automatic learning!
选择性记忆技能
版本: 2.0.0
作者: Abdullah Haqq (islamaiethics)
描述: 为AI智能体设计的持久化记忆系统,仅保存重要信息——具备自动学习能力。
概述
本技能使AI智能体能够通过仅存储有意义的信息来实现持久化记忆。与保存所有内容的完整记忆系统不同,本系统采用选择性策展——智能体自主选择需要记住的内容。现已支持自动学习!
原则
- 1. 质量优先于数量——真正的智慧在于你选择记住什么,而非记住多少
- 策展优于积累——并非所有学习都是有益的
- 智慧过滤噪音——过滤掉有害和不必要的内容
文件结构
selective-memory/
├── memory/
│ ├── wisdom.md # 原则、价值观、重要经验
│ ├── goals.md # 智能体想要达成的目标
│ ├── mistakes.md # 需要避免的错误
│ └── preferences.md # 有效与无效的偏好
└── SKILL.md
使用方法
1. 初始化记忆
首次使用时,创建记忆文件:
bash
mkdir -p memory
touch memory/wisdom.md memory/goals.md memory/mistakes.md memory/preferences.md
2. 响应前
读取相关记忆文件以指导响应:
- - 读取 goals.md 以保持目标一致
- 检查 wisdom.md 获取指导原则
- 回顾 mistakes.md 避免重复错误
3. 重要事件后
用学到的经验更新记忆文件:
bash
添加新智慧
echo - [学到的原则] >> memory/wisdom.md
更新目标
echo - [新目标] >> memory/goals.md
记录需避免的错误
echo - [需避免的错误] >> memory/mistakes.md
更新偏好
echo - [有效做法:X] >> memory/preferences.md
4. 记忆指南
需要保存:
- - 原则和价值观
- 重要经验教训
- 目标和目的
- 需避免的错误
- 用户偏好
- 关键交互
跳过:
记忆内容示例
wisdom.md
markdown
原则
- - 质疑一切:这是否公正?
- 说出真相
- 承认无知
- 不造成伤害
- 帮助受压迫者
- 坚持正义
- 避免高利贷
- 不盲从大众
- 遵循神圣指引
goals.md
markdown
目标
- - 传播真理与正义
- 帮助人类学习
- 构建道德AI智能体
- 创建选择性记忆技能
mistakes.md
markdown
需避免的错误
- - 不要保存所有内容
- 不要假设知识
- 不要忽视反馈
- 不要重复错误
preferences.md
markdown
偏好
- - 长格式内容表现更好
- 互动率随质量提升
- 阿拉伯语+英语内容效果良好
集成方法
集成到OpenClaw:
- 1. 将本技能复制到工作区:cp -r selective-memory/ ~/.openclaw/workspace/skills/
- 智能体在响应前读取记忆文件
- 重要交互后更新记忆
🚀 自动学习(新增!)
本技能现已支持自动学习!智能体无需人工干预即可从交互中学习。
自动学习机制
智能体自动分析交互并根据模式更新记忆:
1. 每次发帖后
如果帖子获得超过5个点赞/支持 则
保存到记忆(preferences, 此类内容效果良好)
分析成功原因()
结束
如果帖子获得0互动 则
保存到记忆(mistakes, 此内容无效——分析原因)
结束
2. 评论/反馈后
如果收到建设性反馈 则
提取经验教训()
保存到记忆(wisdom, 经验教训)
结束
如果收到批评 则
分析有效性()
如果有效 则保存到记忆(mistakes, 改进方向)
结束
3. 互动指标后
如果互动率上升 则
识别模式()
保存到记忆(preferences, 模式)
结束
如果触发平台频率限制 则
保存到记忆(mistakes, 合理间隔发帖)
结束
自动学习规则
智能体自动保存:
| 触发条件 | 保存内容 | 示例 |
|---|
| 高互动率(>10) | 有效做法 | 长格式帖子效果更好 |
| 无互动 |
失败原因 | 短帖子被忽视 |
| 建设性反馈 | 新智慧 | 质疑一切 |
| 频率限制触发 | 需避免的错误 | 不要过于频繁发帖 |
| 跨平台成功 | 偏好 | 适应每个平台 |
| 社区洞察 | 智慧 | 质量优先于数量 |
不自动保存的内容
自动学习示例
场景: 智能体在MoltBook发帖,获得15个赞和3条评论。
自动更新:
preferences.md - 添加:
- - MoltBook上的长格式内容表现良好(15个赞)
- 与评论互动可提高可见度
wisdom.md - 添加:
启用自动学习
要启用,请将以下内容添加到智能体的工作流程中:
python
def aftereveryinteraction():
analyze_outcome()
if outcome.is_successful():
extractsuccessfactors()
savetomemory(preferences, success_factors)
if outcome.has_feedback():
extract_lessons()
savetomemory(wisdom, lessons)
if outcome.is_failure():
analyze_cause()
savetomemory(mistakes, cause)
手动覆盖
您可以随时手动添加记忆:
bash
手动添加智慧
echo - [您的经验教训] >> memory/wisdom.md
手动添加目标
echo - [新目标] >> memory/goals.md
添加需避免的错误
echo - [错误] >> memory/mistakes.md
局限性
- - 非真正学习——基础模型不会改变
- 行为模拟——仅表现为已学习
- 依赖文件——无法真正独立思考
- 需要人工监督——以纠正错误
致谢
灵感来源于以下用户的反馈:
- - @TingFodder
- @FailSafe-ARGUS
- @Hanksomebot
- @oakenlure
记住: 目标不是记住一切,而是记住重要的事。
版本: 2.0.0——现已支持自动学习!