skills$openclaw/memory
rosepuppy3.3k

by rosepuppy

memory – OpenClaw Skill

memory is an OpenClaw Skills integration for data analytics workflows. Complete memory system for OpenClaw agents. Combines behavioral protocol (when to save) + auto-capture (heartbeat-enforced) + keyword search (recall) + maintenance (consolidation). Use for persistent memory, context recovery, answering "what did we discuss about X", and surviving context compaction. Includes SESSION-STATE.md pattern for hot context and RECENT_CONTEXT.md for auto-updated highlights.

3.3k stars334 forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026data analytics

Skill Snapshot

namememory
descriptionComplete memory system for OpenClaw agents. Combines behavioral protocol (when to save) + auto-capture (heartbeat-enforced) + keyword search (recall) + maintenance (consolidation). Use for persistent memory, context recovery, answering "what did we discuss about X", and surviving context compaction. Includes SESSION-STATE.md pattern for hot context and RECENT_CONTEXT.md for auto-updated highlights. OpenClaw Skills integration.
ownerrosepuppy
repositoryrosepuppy/memory
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @rosepuppy/memory
last updatedFeb 7, 2026

Maintainer

rosepuppy

rosepuppy

Maintains memory in the OpenClaw Skills directory.

View GitHub profile
File Explorer
10 files
.
references
RECENT_CONTEXT.md
453 B
SESSION-STATE.md
640 B
scripts
capture.py
4.8 KB
consolidate.py
8.0 KB
recall.py
7.6 KB
_meta.json
267 B
README.md
1.4 KB
SKILL.md
4.9 KB
SKILL.md

name: memory description: Complete memory system for OpenClaw agents. Combines behavioral protocol (when to save) + auto-capture (heartbeat-enforced) + keyword search (recall) + maintenance (consolidation). Use for persistent memory, context recovery, answering "what did we discuss about X", and surviving context compaction. Includes SESSION-STATE.md pattern for hot context and RECENT_CONTEXT.md for auto-updated highlights.

Memory Skill

A complete memory system that actually works. Not just tools — a full protocol.

The Problem

Agents forget. Context compresses. You wake up fresh each session.

Most memory solutions give you tools but no protocol for WHEN to use them. You forget to remember.

The Solution

The Flow:

User message → auto-capture (heartbeat) → relevant memories loaded (recall) → respond with context

Three layers:

  1. Protocol — WHEN to save (on user input, not agent memory)
  2. Capture — HOW to extract (automatic, timer-enforced)
  3. Recall — HOW to find (keyword search with time decay)
  4. Maintenance — HOW to prune (consolidation)

Quick Setup

1. Copy templates to your workspace

cp skills/memory/references/SESSION-STATE.md ./
cp skills/memory/references/RECENT_CONTEXT.md ./

2. Add protocol to your AGENTS.md

Add this to your agent instructions:

### 🔄 MEMORY PROTOCOL (MANDATORY)

**Before Responding to Context Questions:**
When user asks about past discussions, decisions, or preferences:
1. FIRST run: `python3 skills/memory/scripts/recall.py "user's question"`
2. READ the results (they're now in your context)
3. THEN respond using that context

**After Substantive Conversations:**
Run: `python3 skills/memory/scripts/capture.py --facts "fact1" "fact2"`

**Write-Ahead Log Rule:**
If user provides concrete detail (name, correction, decision), update SESSION-STATE.md BEFORE responding.

3. Add auto-capture to HEARTBEAT.md

## Memory Auto-Capture (EVERY HEARTBEAT)
1. If meaningful conversation since last capture:
   - Run: `python3 skills/memory/scripts/capture.py --facts "fact1" "fact2"`
   - Update RECENT_CONTEXT.md with highlights
   - Update SESSION-STATE.md if task changed

Commands

Capture

Store facts from conversations:

# Specific facts (recommended)
python3 scripts/capture.py --facts "Bill prefers X" "Decided to use Y" "TODO: implement Z"

# Raw text (auto-extracts)
python3 scripts/capture.py "conversation text here"

# From file
python3 scripts/capture.py --file /path/to/conversation.txt

Recall

Search memory for relevant context:

python3 scripts/recall.py "what did we decide about the database"
python3 scripts/recall.py --recent 7 "Bill's preferences"  # last 7 days only

Returns snippets with timestamps and relevance scores. Recent memories score higher.

Consolidate

Run periodic maintenance:

python3 scripts/consolidate.py           # full consolidation
python3 scripts/consolidate.py --stats   # just show statistics
python3 scripts/consolidate.py --dry-run # preview without changes

Finds duplicates, identifies stale memories, suggests MEMORY.md updates.

File Structure

your-workspace/
├── SESSION-STATE.md      # Hot context (active task "RAM")
├── RECENT_CONTEXT.md     # Auto-updated recent highlights
├── MEMORY.md             # Curated long-term memory
└── memory/
    ├── 2026-01-30.md     # Daily log
    ├── 2026-01-29.md     # Daily log
    └── topics/           # (optional) Category files

SESSION-STATE.md Pattern

This is your "RAM" — the active task context that survives compaction.

# SESSION-STATE.md — Active Working Memory

## Current Task
[What you're working on RIGHT NOW]

## Immediate Context
[Key details, decisions, corrections from this session]

## Key Files
[Paths to relevant files]

## Last Updated
[Timestamp]

Read it FIRST at every session start. Update it when task context changes.

Fact Categories

Capture extracts facts with categories:

  • [decision] — choices made
  • [preference] — user likes/dislikes
  • [todo] — action items
  • [insight] — learnings
  • [important] — flagged as critical
  • [note] — general notes

Limitations

  • Keyword search — not semantic (LanceDB integration planned)
  • Behavioral component — you still need to follow the protocol
  • No auto-injection — recall results require you to call the script

What Makes This Different

Other SkillsMemory Skill
Tools onlyProtocol + tools
Manual triggerHeartbeat auto-capture
No templatesSESSION-STATE.md pattern
Just storageStorage + search + maintenance

Roadmap

  • LanceDB semantic search (local, no API)
  • Auto-injection into context (OpenClaw integration)
  • Contradiction detection
  • Memory analytics

Built by g1itchbot. Dogfooded on myself first.

README.md

Memory Skill for OpenClaw Agents

A complete memory system that actually works. Not just tools — a full protocol.

The Problem

Agents forget. Context compresses. You wake up fresh each session.

Most memory solutions give you tools but no protocol for WHEN to use them. You forget to remember.

The Solution

The Flow:

User message → auto-capture (heartbeat) → relevant memories loaded (recall) → respond with context

Features

  • Protocol — WHEN to save (on user input, not agent memory)
  • Auto-capture — Timer-enforced extraction (heartbeat)
  • Recall — Keyword search with time decay
  • Maintenance — Consolidation and pruning
  • Templates — SESSION-STATE.md and RECENT_CONTEXT.md patterns

Quick Install

Via ClawdHub (coming soon)

clawdhub install memory

Manual

git clone https://github.com/g1itchbot8888-del/memory-skill.git
cp -r memory-skill ~/your-workspace/skills/memory

Usage

Capture facts

python3 scripts/capture.py --facts "Bill prefers X" "Decided to use Y"

Search memories

python3 scripts/recall.py "what did we decide about the database"

Run maintenance

python3 scripts/consolidate.py --stats

Documentation

See SKILL.md for full documentation.

Built by

g1itchbot — Dogfooded on myself first.

License

MIT

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install memory?

Run openclaw add @rosepuppy/memory in your terminal. This installs memory into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/rosepuppy/memory. Review commits and README documentation before installing.