Install
openclaw skills install runeSelf-improving AI memory system with intelligent context injection and adaptive learning
openclaw skills install runeRune 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.
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.
rune (what you install via ClawHub)rune (what you run in terminal)⚠️ What This Installation Does:
The Rune skill installation will:
~/.openclaw/ and subdirectoriesrune CLI via npm (requires npm dependencies)~/.openclaw/memory.db~/.openclaw/workspace/HEARTBEAT.mdBefore installing:
HEARTBEAT.md if it contains important datapackage.json dependencies if security is critical# Via ClawHub (recommended)
clawhub install rune
# Manual installation
git clone https://github.com/TheBobLoblaw/rune
cd rune
npm install --production
npm install -g .
# Initialize memory system
rune stats
# Add your first fact
rune add person cory.name "Cory - my human user"
# Generate context for a conversation
rune context "Let's work on the website"
# Get task recommendations
rune next-task
# Weekly self-review
rune self-review --days 7
rune add <category> <key> <value> - Store a factrune search <query> - Find factsrune recall <topic> - Smart multi-source recallrune inject - Generate context file for agentrune context <message> - Dynamic context for messagerune score <message> - Relevance scoringrune proactive <message> - Volunteer relevant contextrune session-style <message> - Detect interaction stylerune project-state <name> - Track project phases/blockersrune next-task - Smart task pickerrune stuck-projects - Find blocked workrune temporal "last Tuesday" - Time-based queriesrune consolidate - Memory optimizationrune forget - Apply forgetting curvesrune pattern-analysis - Detect behavioral patternsAdd to your HEARTBEAT.md:
# Memory maintenance
rune expire && rune inject --output ~/.openclaw/workspace/FACTS.md
# Proactive work selection
NEXT_TASK=$(rune next-task --json)
if [[ "$NEXT_TASK" != "null" ]]; then
# Work on the recommended task
fi
The skill automatically provides secure session hooks via OpenClaw integrations.
For manual usage, use the secure session handler:
# Secure session hooks (input sanitized automatically)
./rune-session-handler.sh start # Loads dynamic context safely
./rune-session-handler.sh end # Tracks session style safely
# Direct usage (SECURE - input is sanitized):
SAFE_MESSAGE=$(echo "$MESSAGE" | head -c 200 | tr -d '`$(){}[]|;&<>' | sed 's/[^a-zA-Z0-9 ._-]//g')
rune recall "$SAFE_MESSAGE" --limit 10
⚠️ Security Note: Never pass unsanitized user input directly to shell commands. Always use the provided session handler or sanitize input manually.
~/.openclaw/memory.dbWhat Rune Stores:
rune addWhat Rune Does NOT Store (by default):
extract manually)NPM Dependencies:
package.json for dependencies if security is criticalSession Security:
rune searchPrivacy Best Practices:
rune add with sensitive data (passwords, API keys, personal info)rune extract carefully - review files before extracting facts~/.openclaw/workspace/FACTS.md periodicallyInstallation Changes:
HEARTBEAT.md (if present)~/.openclaw/memory.db database fileWith Rune, your agent will:
# Tune relevance scoring
rune score "your query" --threshold 0.6 --model llama3.1:8b
# Configure forgetting curves
rune forget --decay-rate 0.03 --grace-days 45
# Cross-session pattern analysis
rune cross-session --days 90 --min-sessions 5
Rune performs best with regular maintenance. Here are automation strategies:
Daily Maintenance (3 AM)
# Expire working memory and regenerate context
0 3 * * * /usr/local/bin/rune expire && /usr/local/bin/rune inject --output ~/.openclaw/workspace/FACTS.md
Weekly Optimization (Sunday 2 AM)
# Consolidate memory and run self-review
0 2 * * 0 /usr/local/bin/rune consolidate --auto-prioritize && /usr/local/bin/rune self-review --days 7
Monthly Deep Clean (1st of month, 1 AM)
# Pattern analysis and database optimization
0 1 1 * * /usr/local/bin/rune pattern-analysis --days 30 && sqlite3 ~/.openclaw/memory.db "VACUUM; ANALYZE;"
# Daily backup at 4 AM
0 4 * * * cp ~/.openclaw/memory.db ~/.openclaw/memory.db.backup.$(date +\%Y\%m\%d)
# Keep last 7 days
5 4 * * * find ~/.openclaw -name "memory.db.backup.*" -mtime +7 -delete
# Check database size and fact count
rune stats
# Review recent patterns
rune pattern-analysis --days 7
# Check consolidation opportunities
rune consolidate --dry-run
Memory growing too large?
rune consolidate to merge similar factsrune forget to apply forgetting curvesrune stats for database sizeRelevance scoring not working?
systemctl status ollamarune score "test" --engine ollamaContext injection too verbose?
--threshold 0.6rune budget "query" --tokens 300Rune is open source. Contributions welcome:
MIT License - Use freely, modify as needed.
Rune: Because your AI should remember like you do.