Rune - Persistent AI Memory System
Rune gives your OpenClaw agent persistent, intelligent memory that gets better over time. No more burning tokens on static context files or forgetting important information between sessions.
What Rune Does
🧠 Smart Memory Management
- - Dynamic Context Injection: AI selects only relevant facts for each conversation
- Access Pattern Learning: Frequently used facts get prioritized
- Forgetting Curves: Unused facts naturally fade like human memory
- Memory Consolidation: Similar facts get merged, verbose ones compressed
🎯 Session Intelligence
- - Interaction Style Detection: Learns if you prefer brainstorm vs deep-work vs debug modes
- Behavioral Pattern Analysis: Tracks your work patterns and preferences over time
- Proactive Memory: Volunteers relevant context unprompted ("last time you worked on this...")
📋 Project Autopilot
- - Smart Task Recommendations: "What should I work on next?" with priority scoring
- Blocker Detection: Identifies stuck projects that need intervention
- Project Health Scoring: 0.0-1.0 health scores based on activity and progress
📢 Intelligent Notifications
- - Priority Classification: Critical/High/Medium/Low/FYI with context analysis
- Smart Timing: Respects quiet hours, batches low-priority updates
- Channel Routing: DM for urgent, Discord for projects, digest for FYI
🔄 Self-Improvement Loop
- - Pattern Detection: "Forgot to use X skill 3 times" → automatic escalation
- Performance Tracking: Measurable improvement over time
- Skill Usage Analysis: Which skills you use vs neglect
About Rune vs rune
Rune is the OpenClaw skill name. rune is the CLI tool name. Think of Rune as the "skill package" and rune as the "command-line interface" - like how the git skill package provides the git CLI.
- - Skill name:
rune (what you install via ClawHub) - CLI command:
rune (what you run in terminal) - Repository: https://github.com/TheBobLoblaw/rune
Installation Disclosure
⚠️ What This Installation Does:
The Rune skill installation will:
- - Create directories:
~/.openclaw/ and subdirectories - Install globally:
rune CLI via npm (requires npm dependencies) - Create database: SQLite database at INLINECODE6
- Modify files: Appends integration lines to existing INLINECODE7
- Add session hooks: Automatic memory integration for OpenClaw sessions
Before installing:
- - Back up
HEARTBEAT.md if it contains important data - Review
package.json dependencies if security is critical - Consider using local models (Ollama) instead of cloud APIs for privacy
Installation
CODEBLOCK0
Quick Start
CODEBLOCK1
Core Commands
Memory Management
- -
rune add <category> <key> <value> - Store a fact - INLINECODE11 - Find facts
- INLINECODE12 - Smart multi-source recall
- INLINECODE13 - Generate context file for agent
Intelligence Features
- -
rune context <message> - Dynamic context for message - INLINECODE15 - Relevance scoring
- INLINECODE16 - Volunteer relevant context
- INLINECODE17 - Detect interaction style
Project Management
- -
rune project-state <name> - Track project phases/blockers - INLINECODE19 - Smart task picker
- INLINECODE20 - Find blocked work
Advanced Features
- -
rune temporal "last Tuesday" - Time-based queries - INLINECODE22 - Memory optimization
- INLINECODE23 - Apply forgetting curves
- INLINECODE24 - Detect behavioral patterns
Integration with OpenClaw
Heartbeat Integration
Add to your
HEARTBEAT.md:
CODEBLOCK2
Session Hooks
The skill automatically provides secure session hooks via OpenClaw integrations.
For manual usage, use the secure session handler:
CODEBLOCK3
⚠️ Security Note: Never pass unsanitized user input directly to shell commands. Always use the provided session handler or sanitize input manually.
Architecture
- - SQLite Database: All memory stored in INLINECODE26
- Local LLM Integration: Ollama for relevance scoring and extraction
- Cloud API Support: Anthropic, OpenAI for advanced reasoning
- Local-First Design: Works completely offline with Ollama (cloud APIs optional for advanced features)
Memory Categories
- - person: Information about people (names, roles, preferences)
- project: Project status, phases, decisions
- tool: How to use tools and their quirks
- lesson: Mistakes to avoid, best practices
- decision: Why certain choices were made
- preference: User likes/dislikes, settings
- environment: System configs, non-sensitive settings (⚠️ NEVER store credentials!)
⚠️ Security & Privacy
Data Storage
What Rune Stores:
- - Facts you explicitly add via INLINECODE27
- Session interaction patterns for learning (conversation style, not content)
- Project states and task recommendations
What Rune Does NOT Store (by default):
- - Full conversation transcripts (unless you run
extract manually) - API keys or credentials (use environment variables instead)
- Sensitive personal information (unless you explicitly add it)
Installation Security
NPM Dependencies:
- - Installation fetches dependencies from npm registry at install time
- Review
package.json for dependencies if security is critical - Global npm install runs lifecycle scripts (standard npm behavior)
- Consider installing in isolated environment (container/VM) for high-security use
Session Security:
- - Fixed CVE-2026-0001: Input sanitization prevents shell injection
- All user input sanitized before shell execution
- Session handler validates and limits input length
Cloud API Usage
- - Optional: Rune can use OpenAI/Anthropic APIs for fact extraction and scoring
- Local-first: Works completely offline with Ollama (recommended for privacy)
- Your choice: Configure which engines to use in your setup
Privacy Recommendations
- - Use local models (Ollama) for maximum privacy
- Avoid cloud APIs if processing sensitive information
- Review stored facts periodically with INLINECODE30
- Never store credentials in memory - use environment variables
Privacy Best Practices:
- - Never run
rune add with sensitive data (passwords, API keys, personal info) - Use
rune extract carefully - review files before extracting facts - Configure Ollama for local-only operation if you want zero cloud usage
- Review your
~/.openclaw/workspace/FACTS.md periodically
Installation Changes:
- - Adds memory maintenance commands to
HEARTBEAT.md (if present) - Creates
~/.openclaw/memory.db database file - Session hooks may process conversation metadata (not full content) for learning
Performance Metrics
With Rune, your agent will:
- - ✅ Remember context between sessions without burning tokens
- ✅ Pick relevant facts dynamically vs dumping everything
- ✅ Get measurably better at avoiding repeated mistakes
- ✅ Work autonomously on projects between check-ins
- ✅ Learn your interaction patterns and adapt responses
Advanced Configuration
CODEBLOCK4
Automated Maintenance & Performance
Rune performs best with regular maintenance. Here are automation strategies:
Cron Job Setup
Daily Maintenance (3 AM)
CODEBLOCK5
Weekly Optimization (Sunday 2 AM)
CODEBLOCK6
Monthly Deep Clean (1st of month, 1 AM)
CODEBLOCK7
Database Backup
CODEBLOCK8
Performance Benefits
- - 🧹 Memory stays lean: Auto-removes expired facts
- ⚡ Faster queries: Regular consolidation prevents bloat
- 📈 Self-improvement: Pattern detection catches recurring issues
- 🔄 Current context: FACTS.md regenerated with latest data
- 💾 Data protection: Automated backups prevent loss
Memory Health Monitoring
CODEBLOCK9
Troubleshooting
Memory growing too large?
- - Run
rune consolidate to merge similar facts - Use
rune forget to apply forgetting curves - Check
rune stats for database size
Relevance scoring not working?
- - Ensure Ollama is running: INLINECODE39
- Test model: INLINECODE40
- Fall back to anthropic/openai engines
Context injection too verbose?
- - Lower relevance threshold: INLINECODE41
- Use token budgeting: INLINECODE42
Contributing
Rune is open source. Contributions welcome:
- - Memory Science: Better consolidation algorithms, forgetting curves
- LLM Integration: New scoring engines, extraction methods
- UI/UX: Better command interfaces, visualization tools
- Performance: Speed optimizations, memory efficiency
License
MIT License - Use freely, modify as needed.
Rune: Because your AI should remember like you do.
Rune - 持久化AI记忆系统
Rune 为你的OpenClaw智能体提供持久化、智能化的记忆能力,且会随时间不断优化。告别在静态上下文文件上消耗令牌,或在不同会话间遗忘重要信息。
Rune的功能
🧠 智能记忆管理
- - 动态上下文注入:AI仅为每次对话选择相关事实
- 访问模式学习:常用事实获得优先处理
- 遗忘曲线:未使用的事实会像人类记忆一样自然淡化
- 记忆整合:相似事实合并,冗长事实压缩
🎯 会话智能
- - 交互风格检测:学习你是偏好头脑风暴、深度工作还是调试模式
- 行为模式分析:长期追踪你的工作模式和偏好
- 主动记忆:未经提示主动提供相关上下文(上次你处理这个时...)
📋 项目自动驾驶
- - 智能任务推荐:接下来该做什么?附带优先级评分
- 阻塞检测:识别需要干预的卡住项目
- 项目健康评分:基于活动和进度的0.0-1.0健康评分
📢 智能通知
- - 优先级分类:关键/高/中/低/仅供参考,附带上下文分析
- 智能时机:尊重静默时间,批量处理低优先级更新
- 渠道路由:紧急事项用私信,项目相关用Discord,仅供参考用摘要
🔄 自我改进循环
- - 模式检测:忘记使用X技能3次→自动升级
- 性能追踪:随时间推移的可衡量改进
- 技能使用分析:你使用和忽略的技能
关于Rune与rune
Rune是OpenClaw技能名称。rune是CLI工具名称。将Rune视为技能包,rune视为命令行界面——就像git技能包提供gitCLI一样。
- - 技能名称:rune(通过ClawHub安装)
- CLI命令:rune(在终端中运行)
- 仓库:https://github.com/TheBobLoblaw/rune
安装说明
⚠️ 此安装将执行的操作:
Rune技能安装将:
- - 创建目录:~/.openclaw/及其子目录
- 全局安装:通过npm安装runeCLI(需要npm依赖)
- 创建数据库:~/.openclaw/memory.db的SQLite数据库
- 修改文件:向现有~/.openclaw/workspace/HEARTBEAT.md追加集成行
- 添加会话钩子:OpenClaw会话的自动记忆集成
安装前:
- - 备份HEARTBEAT.md(如包含重要数据)
- 审查package.json依赖(如安全性至关重要)
- 考虑使用本地模型(Ollama)而非云API以保护隐私
安装
bash
通过ClawHub(推荐)
clawhub install rune
手动安装
git clone https://github.com/TheBobLoblaw/rune
cd rune
npm install --production
npm install -g .
快速开始
bash
初始化记忆系统
rune stats
添加第一个事实
rune add person cory.name Cory - 我的人类用户
为对话生成上下文
rune context 我们来处理网站
获取任务推荐
rune next-task
每周自我审查
rune self-review --days 7
核心命令
记忆管理
- - rune add <类别> <键> <值> - 存储事实
- rune search <查询> - 查找事实
- rune recall <主题> - 智能多源回忆
- rune inject - 为智能体生成上下文文件
智能功能
- - rune context <消息> - 消息的动态上下文
- rune score <消息> - 相关性评分
- rune proactive <消息> - 主动提供相关上下文
- rune session-style <消息> - 检测交互风格
项目管理
- - rune project-state <名称> - 追踪项目阶段/阻塞项
- rune next-task - 智能任务选择器
- rune stuck-projects - 查找被阻塞的工作
高级功能
- - rune temporal 上周二 - 基于时间的查询
- rune consolidate - 记忆优化
- rune forget - 应用遗忘曲线
- rune pattern-analysis - 检测行为模式
与OpenClaw集成
心跳集成
添加到你的HEARTBEAT.md:
bash
记忆维护
rune expire && rune inject --output ~/.openclaw/workspace/FACTS.md
主动工作选择
NEXT_TASK=$(rune next-task --json)
if [[ $NEXT_TASK != null ]]; then
# 处理推荐的任务
fi
会话钩子
该技能通过OpenClaw集成自动提供安全的会话钩子。
手动使用时,使用安全会话处理器:
bash
安全会话钩子(输入自动清理)
./rune-session-handler.sh start # 安全加载动态上下文
./rune-session-handler.sh end # 安全追踪会话风格
直接使用(安全 - 输入已清理):
SAFE
MESSAGE=$(echo $MESSAGE | head -c 200 | tr -d $(){}[]|;&<> | sed s/[^a-zA-Z0-9 .-]//g)
rune recall $SAFE_MESSAGE --limit 10
⚠️ 安全提示:切勿将未经清理的用户输入直接传递给shell命令。始终使用提供的会话处理器或手动清理输入。
架构
- - SQLite数据库:所有记忆存储在~/.openclaw/memory.db
- 本地LLM集成:Ollama用于相关性评分和提取
- 云API支持:Anthropic、OpenAI用于高级推理
- 本地优先设计:完全离线使用Ollama(云API可选用于高级功能)
记忆类别
- - person:关于人的信息(姓名、角色、偏好)
- project:项目状态、阶段、决策
- tool:如何使用工具及其特性
- lesson:要避免的错误、最佳实践
- decision:为何做出某些选择
- preference:用户喜好/厌恶、设置
- environment:系统配置、非敏感设置(⚠️ 切勿存储凭证!)
⚠️ 安全与隐私
数据存储
Rune存储的内容:
- - 你通过rune add显式添加的事实
- 用于学习的会话交互模式(对话风格,而非内容)
- 项目状态和任务推荐
Rune不存储的内容(默认):
- - 完整对话记录(除非手动运行extract)
- API密钥或凭证(使用环境变量代替)
- 敏感个人信息(除非你显式添加)
安装安全
NPM依赖:
- - 安装时从npm注册表获取依赖
- 如安全性至关重要,请审查package.json的依赖
- 全局npm安装会运行生命周期脚本(标准npm行为)
- 对于高安全性使用,考虑在隔离环境(容器/VM)中安装
会话安全:
- - 已修复CVE-2026-0001:输入清理防止shell注入
- 所有用户输入在shell执行前已清理
- 会话处理器验证并限制输入长度
云API使用
- - 可选:Rune可使用OpenAI/Anthropic API进行事实提取和评分
- 本地优先:完全离线使用Ollama(推荐用于隐私保护)
- 你的选择:在设置中配置要使用的引擎
隐私建议
- - 使用本地模型(Ollama)以获得最大隐私保护
- 避免云API(如处理敏感信息)
- 定期审查存储的事实,使用rune search
- 切勿在记忆中存储凭证 - 使用环境变量
隐私最佳实践:
- - 切勿使用敏感数据(密码、API密钥、个人信息)运行rune add
- 谨慎使用rune extract - 提取事实前审查文件
- 如需零云使用,配置Ollama仅本地运行
- 定期审查你的~/.openclaw/workspace/FACTS.md
安装变更:
- - 向HEARTBEAT.md添加记忆维护命令(如存在)
- 创建~/.openclaw/memory.db数据库文件
- 会话钩子可能处理对话元数据(而非完整内容)用于学习
性能指标
使用Rune,你的智能体将:
- - ✅ 在会话间记住上下文而不消耗令牌
- ✅ 动态选择相关事实而非倾