Get the FREE Ultimate OpenClaw Setup Guide →
j

Dory-Proof Memory System

Verified

@justinhartbiz

npx machina-cli add skill @justinhartbiz/dory-memory --openclaw
Files (1)
SKILL.md
3.7 KB

Dory-Proof Memory System

AI agents forget everything between sessions. This skill implements a file-based memory system that survives context resets.

Core Principle

Text > Brain. Write everything down. Files are memory. The agent only "remembers" what's on disk.

The Dory-Proof Pattern (Critical)

When the user gives a task:

  1. IMMEDIATELY write their EXACT WORDS to state/ACTIVE.md
  2. Then interpret what it means
  3. Then do the work
  4. Mark complete when done

Why: Paraphrasing introduces drift. Exact words preserve intent across context flushes.

Workspace Structure

workspace/
├── AGENTS.md        # Operating rules (system file, don't rename)
├── SOUL.md          # Identity + personality
├── USER.md          # About the human
├── MEMORY.md        # Curated long-term memory (<10KB)
├── LESSONS.md       # "Never again" safety rules
├── TOOLS.md         # Tool-specific notes
│
├── state/           # Active state (check every session)
│   ├── ACTIVE.md    # Current task (exact user words)
│   ├── HOLD.md      # Blocked items (check before acting!)
│   ├── STAGING.md   # Drafts awaiting approval
│   └── DECISIONS.md # Recent choices with timestamps
│
├── memory/          # Historical
│   ├── YYYY-MM-DD.md
│   ├── recent-work.md
│   └── archive/
│
└── ops/             # Operational
    └── WORKSPACE-INDEX.md

Boot Sequence (Every Session)

  1. Read state/HOLD.md — what's BLOCKED
  2. Read state/ACTIVE.md — current task
  3. Read state/DECISIONS.md — recent choices
  4. Read memory/recent-work.md — last 48 hours
  5. Read MEMORY.md — long-term (main session only)

Output status line after boot:

📋 Boot: ACTIVE=[task] | HOLD=[n] items | STAGING=[n] drafts

State File Formats

state/ACTIVE.md

## Current Instruction
**User said:** "[exact quote]"
**Interpretation:** [what you think it means]
**Status:**
- [ ] Step 1
- [ ] Step 2

state/HOLD.md

[YYYY-MM-DD HH:MM | session] Item — reason blocked

ALL agents must check before acting on anything that looks ready.

state/DECISIONS.md

[YYYY-MM-DD HH:MM | session] Decision made

Conflict Resolution

When files conflict, priority (highest first):

  1. state/HOLD.md — blocks override all
  2. state/ACTIVE.md — current instruction
  3. state/DECISIONS.md — recent choices
  4. AGENTS.md — general rules

Memory Scoring (Before Saving to MEMORY.md)

Score on 4 axes (0–3 each):

Axis0123
LongevityGone tomorrowWeeksMonthsYears+
ReuseOne-offOccasionalFrequentEvery session
ImpactTrivialNice to knowChanges outputsChanges decisions
UniquenessObviousSlightly helpfulHard to rederiveImpossible without

Save if: Total ≥ 8, OR any axis = 3 AND total ≥ 6.

Quick Setup

Copy template files from assets/templates/ to your workspace:

cp -r skills/dory-memory/assets/templates/* ~/.openclaw/workspace/

Then customize SOUL.md and USER.md for your agent.

References

  • references/IMPLEMENTATION-GUIDE.md — Full setup walkthrough
  • references/ANTI-PATTERNS.md — Common mistakes to avoid

Source

git clone https://clawhub.ai/justinhartbiz/dory-memoryView on GitHub

Overview

Dory-Proof Memory System provides persistent, on-disk memory for AI agents that forget between sessions. By enforcing a disciplined, file-based workspace and the Dory-Proof pattern, you achieve continuity across context resets. This makes it ideal for setting up agent memory, structuring workspaces, tracking tasks, and preventing context-loss errors. The agent reads and writes to disk as the single source of truth, while boot-time checks ensure ongoing consistency.

How This Skill Works

Core Principle: Text > Brain. Write everything down. Files are memory. The agent only "remembers" what’s on disk. Dory-Proof Pattern (critical): When the user gives a task, you must follow these steps in order: 1) IMMEDIATELY write the user’s EXACT WORDS to state/ACTIVE.md 2) Interpret what it means 3) Do the work 4) Mark complete when finished Why this works: paraphrasing introduces drift across context flushes. Storing exact quotes preserves intent when the session context is cleared. Workspace Structure: Use a well-defined directory layout to separate active work from long-term memory and system rules. The structure is designed to minimize drift and maximize traceability. Boot Sequence (Every Session): 1) Read state/HOLD.md to surface any BLOCKED items 2) Read state/ACTIVE.md to identify the current task 3) Read state/DECISIONS.md for recent choices with timestamps 4) Read memory/recent-work.md for the last 48 hours of activity 5) Read MEMORY.md for curated long-term memory (main session only) Output a status line after boot, e.g.: 📋 Boot: ACTIVE=[task] | HOLD=[n] items | STAGING=[n] drafts State File Formats (high level): - state/ACTIVE.md holds the exact user words and the interpretation, plus a checklist of steps to completion - state/HOLD.md lists blocked items with dates and reasons - state/DECISIONS.md logs recent decisions with timestamps - memory/recent-work.md (historical) tracks recent activity - MEMORY.md stores long-term memory under ~10KB of curated content Conflict Resolution: When files conflict, priority is: HOLD (blocks) > ACTIVE (current instruction) > DECISIONS (recent choices) > AGENTS.md (general rules).

When to Use It

  • Set up agent memory for long-running tasks or multi-session assistants
  • Build and maintain workspace structure for scalable agents
  • Implement task tracking and decision persistence across sessions
  • Prevent context-loss errors during resets or timeouts
  • Onboard new agents that must retain knowledge across restarts

Quick Start

  1. Copy template files from assets/templates into your workspace to establish the Dory-Proof structure: cp -r skills/dory-memory/assets/templates/* ~/.openclaw/workspace/
  2. Customize core identity and human-facing context by editing SOUL.md and USER.md
  3. Start a session and begin interacting. On the first user input, the Dory-Proof pattern will trigger automatically when you implement the pattern in code.

Best Practices

  • Always write the exact user words to state/ACTIVE.md before any interpretation or action
  • Keep state files minimal and avoid drift by not paraphrasing in ACTIVE.md
  • Check state/HOLD.md before acting on any task that looks ready
  • Record decisions in state/DECISIONS.md with precise timestamps to aid traceability
  • When memory growth approaches the 10KB limit, trim or summarize long-term memory in MEMORY.md without sacrificing critical context
  • Regularly refresh memory/recent-work.md to reflect the last 48 hours of activity
  • Keep AGENTS.md as the authoritative operating rules document and do not rename it
  • Use WORKSPACE-INDEX.md to locate and navigate workspace components efficiently

Example Use Cases

  • Onboarding a coding assistant that must remember project context across sessions, including file paths, dependencies, and prior decisions
  • Bug triage workflow where tasks persist between sessions and decisions are auditable through DECISIONS.md
  • Multi-step automations that require continuity across resets, such as build pipelines or documentation generation
  • Collaborative robotics or CI/CD agents where workspace structure and task history must persist for audits

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers