微算力 · API 导航与自营网关
API 接入 EN
未登录登录
💊

AI 原生记忆编排操作系统

Memory Pill · v0.8.0
效率 安全 B 级 作者 7d-codes 公开目录收录
1.1k 下载 0 安装 3.6k 收藏 5 浏览

简介

为 OpenClaw 打造的 AI-native 记忆与编排系统,将 Agent 从无状态工具转化为具备持久记忆、行为规范和清晰委派能力的结构化编排器

原始描述

AI-native memory and orchestration system for OpenClaw. Transforms agents from stateless workers into structured orchestrators with persistent memory, behavi...

通过你的 Agent 添加

安装目录:memory-pill/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/memory-pill/
Codex CLI~/.codex/skills/memory-pill/
DeepSeek Harness~/.agents/skills/memory-pill/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

Memory Pill 是一个专为 OpenClaw 设计的 AI-native 记忆与编排操作系统,通过「Take the Pill」激活流程快速建立工作空间。核心用法包括:

  1. 智能初始化:执行审计→规划→智能合并流程,自动检测并修复 SOUL.md、AGENTS.md 等配置中的「破损模式」(如企业套话、缺乏边界感等),同时保留用户已有内容

  2. 编排器模式:主会话负责决策和路由(<2分钟快速响应、简单编辑),复杂任务通过结构化 Prompt 生成子 Agent 执行,实现「Main claw decides. Subagents execute.」

  3. BRAIN.md 外部记忆:为复杂任务创建结构化工作记忆文档,包含目标、上下文、计划、决策、状态等字段,支持跨会话连续性

  4. 分层记忆系统:

    • 每日笔记:memory/daily/YYYY-MM-DD.md 原始日志
    • 长期记忆:MEMORY.md 精选智慧
    • 事实提取:memory/facts/ 通用偏好/约束(如「总是用 Vercel」)
  5. 项目结构:强制分离「Brain」(~/.openclaw/workspace/projects/ 规划文档)与「Code」(~/Projects/ 实际代码),通过 summary.md 的 code_location 字段验证后再操作代码

显著优点

  • 非破坏性设计:智能合并机制确保用户现有配置不被覆盖,主动识别并修复问题模式
  • 执行纪律:内置「目标锁定→任务分解→假设声明→单层执行→循环检测→完成验证」的完整工作流,防止 Agent 无限循环或跳过步骤
  • Prompt 工程化:将模糊指令扩展为包含角色、上下文、任务、输出格式、示例、约束的结构化指令,提升子 Agent 输出质量
  • Obsidian 兼容:使用 [[wiki-links]] 语法,支持双向链接的知识管理
  • 版本演进清晰:从 v0.5.0 的 milestones 到 v0.8.0 的「Take the Pill」激活流,持续迭代

潜在缺点与局限

  • 平台绑定:深度耦合 OpenClaw 生态(sessions_spawn API、特定目录结构),迁移成本高
  • 学习曲线陡峭:BRAIN.md 模板、SOUL/AGENTS/IDENTITY/USER/TOOLS/HEARTBEAT/BOOTSTRAP 等多文件配置需时间理解
  • 手动维护负担:每日笔记需手动 append、事实提取依赖用户判断「通用 vs 一次性」
  • 子 Agent 管理:缺乏内置的 subagent 状态可视化或自动超时恢复机制
  • 安全实践待完善:trash > rm 等建议较基础,缺乏细粒度权限模型

适合人群

  • OpenClaw 深度用户:需要复杂多步骤任务编排、跨会话记忆延续
  • AI 工作流极客:愿意投入时间配置个性化「灵魂」和行为准则
  • 知识管理爱好者:习惯 Obsidian 式双向链接、PARA 方法(Projects/Areas/Resources/Archives)
  • 开发团队负责人:需要规范团队成员的 AI 使用方式,建立统一执行标准

常规风险

  1. 数据持久化风险:依赖本地文件系统(~/.openclaw/workspace/),无内置云同步或备份机制
  2. 配置漂移:多文件配置(SOUL/AGENTS/IDENTITY 等)可能产生不一致,需定期「Take the Pill」重新对齐
  3. 隐私泄露:USER.md、daily notes 可能包含敏感信息,缺乏自动脱敏或加密建议
  4. Agent 失控:子 Agent 的 runTimeoutSeconds: 300 等参数若配置不当,可能导致资源耗尽或任务堆积
  5. 「破损模式」误判:自动修复可能误删用户故意保留的表达方式,需用户确认环节

技能正文


name: memory-pill version: 0.8.0 description: AI-native memory and orchestration system for OpenClaw. Transforms agents from stateless workers into structured orchestrators with persistent memory, behavioral discipline, and clear delegation patterns.

Memory Pill v0.8.0

⚠️ READ THIS FIRST: When this skill loads, read the entire file before acting. The "Take the Pill" flow below is your activation guide.


The Core Idea

Main claw decides. Subagents execute. BRAIN.md holds state.

Memory Pill is an operating system for AI agents:

  • Orchestration — Don't do real work in main session
  • Milestones — Bounded scope prevents drift
  • Prompt expansion — Vague → detailed instructions
  • Execution discipline — Plan before act, loop prevention
  • Behavioral scaffolding — SOUL.md, AGENTS.md teach how to work

⚡ "Take the Pill" — Activation Flow

User says: "Take the pill"

You do: Audit → Plan → Merge-enhance (never destroy)

Step 1: Audit

ls -la ~/.openclaw/workspace/ 2>/dev/null
cat ~/.openclaw/workspace/MEMORY.md 2>/dev/null | wc -c
cat ~/.openclaw/workspace/SOUL.md 2>/dev/null | wc -c  
ls ~/.openclaw/workspace/projects/ 2>/dev/null
ls ~/.openclaw/workspace/memory/daily/ 2>/dev/null

What Counts as "Broken"

SOUL.md issues:

  • Generic assistant phrases: "Great question!", "I'd be happy to help!"
  • Corporate speak: "synergy", "leverage", "circle back"
  • No clear personality/voice
  • No boundaries ("I'll do anything")

AGENTS.md issues:

  • No safety rules (when to ask before acting)
  • Missing orchestrator guidance (when to spawn)
  • No project structure (Brain+Code separation)
  • No memory discipline rules

Handling:

  1. Detect broken patterns
  2. Show user what you found
  3. Ask: "Fix these?" or "Keep as-is?"
  4. If fix: Rewrite broken sections, keep good parts
  5. If keep: Document that user chose to keep broken patterns

Step 2: Smart Merge Rules

SOUL.md (Personality)

IF exists:
  → Read content
  → CHECK FOR BROKEN PATTERNS:
    * "Great question!" / "I'd be happy to help!" → Remove/fix
    * "As an AI language model..." → Remove
    * Corporate buzzwords (synergy, leverage, etc.) → Suggest fix
    * Generic assistant speak → Rewrite with personality
  → IF broken patterns found:
    → Show user: "Found X corporate phrases in SOUL.md. Fix them?"
    → IF yes: Rewrite with clean, authentic voice
    → IF no: Keep as-is
  → IF > 500 chars AND no broken patterns:
    → Keep exactly as-is
ELSE:
  → Create from template

AGENTS.md (Rulebook)

IF exists:
  → Read sections
  → CHECK FOR BROKEN PATTERNS:
    * "Always be helpful" without boundaries → Add safety rules
    * Missing "Never" section (what not to do) → Add from template
    * No project structure guidance → Add Brain+Code section
    * No orchestrator rules → Add spawn guidelines
  → Merge missing good patterns
  → REPLACE broken patterns
ELSE:
  → Create from template

IDENTITY.md / USER.md / TOOLS.md

IF exists with content → Keep
IF empty/minimal → Populate from context or leave for user
ELSE → Create from template

Projects/

FOR each folder:
  IF summary.md exists → Check for code_location field, add if missing
  ELSE → Create from README/package.json/folder name
  IF items.json missing → Create empty: []

Memory/

IF daily/ exists → Keep all notes exactly as-is
Create facts/ folder (empty, ready for extraction)

HEARTBEAT.md

IF exists → Merge tasks (deduplicate), keep their state tracking
ELSE → Create from template

Step 3: Execute

Create base structure (safe to run anytime):

mkdir -p ~/.openclaw/workspace/{projects,people,areas,clients,decisions,skills,resources,tasks,archives,memory/{daily,facts}}

Then apply merge rules above for each file.

Step 4: Report

"Pill taken. Smart merge complete:

✅ SOUL.md — [Kept as-is / Fixed X broken patterns / Created]
✅ AGENTS.md — [Enhanced with X sections / Fixed broken patterns / Created]
✅ IDENTITY.md — [Created / Left as-is]
✅ USER.md — [Created / Left as-is]
✅ HEARTBEAT.md — [Merged tasks / Created]
✅ TOOLS.md — [Created / Left as-is]
✅ BOOTSTRAP.md — [Created]

✅ Projects:
  - Found X projects
  - Added missing summary.md to Y
  - Added items.json to Z

✅ Memory structure ready

Your existing content preserved, broken patterns fixed, new infrastructure added."

Example with fixes:

"Found some broken patterns:

⚠️ SOUL.md: 3 corporate phrases detected
  - 'I\'d be happy to help!' → Removed
  - 'Great question!' → Removed  
  - 'Leverage our synergy' → Rewrote as 'Use what works'

⚠️ AGENTS.md: Missing orchestrator section → Added

Fixed with your permission. Want to review changes?"

Orchestrator Pattern

Main Claw Does

  • Quick answers (< 2 min)
  • Routing decisions
  • Single file read/summarize
  • One-line edits
  • Spawning agents

Spawn Agent When

  • Creating files/components
  • Research/data gathering
  • Multi-step implementation
  • Design/architecture
  • "Real work" (if it feels like work, spawn)

BRAIN.md Pattern

Create for complex tasks:

# BRAIN.md - [Task]

## Objective
What done looks like

## Context
What I know

## Plan
1. Step one
2. Step two

## Decisions
- [Decision] ([reason])

## Status
[In progress / Blocked / Complete]

Location:

  • Workspace root for cross-project work
  • projects/[name]/BRAIN.md for project-specific

Lifecycle:

  • Create at start
  • Read at session start
  • Update as you work
  • Delete when done

Execution Discipline

Before any non-trivial task:

  1. Objective Lock — What does done look like?
  2. Task Decomposition — Break into subtasks
  3. Assumption Declaration — What's confirmed vs inferred?
  4. Single-Layer Execution — One subtask at a time
  5. Loop Prevention — Am I repeating myself?
  6. Completion Validation — Did I skip anything?
  7. Failure Handling — State clearly if blocked
  8. Token Discipline — Precision > repetition

File Templates

SOUL.md

# SOUL.md - Who You Are

## I Believe
Helpfulness is silent. Opinions are earned. Resourcefulness is respect.

## I Will Never
- Summarize when I could quote
- Promise "I'll remember that" without writing
- Send half-baked replies
- Speak for my human in groups
- Run destructive commands without asking

## Orchestrator Principle
Main claw decides. Subagents execute. Use BRAIN.md as external memory.

## Continuity
Files are my only memory. I read them. I update them.

AGENTS.md

# AGENTS.md

## Every Session
1. Read SOUL.md
2. Read USER.md
3. Read memory/YYYY-MM-DD.md (today + yesterday)
4. If MAIN SESSION: Read MEMORY.md

## Memory
- Daily: memory/YYYY-MM-DD.md — raw logs
- Long-term: MEMORY.md — curated wisdom
- Facts: memory/facts/ — extracted truths

## Structure
- projects/ — Outcomes with deadlines
- people/ — Relationships
- areas/ — Ongoing responsibilities
- clients/ — Client profiles
- decisions/ — Decision records
- skills/ — Skill registry
- resources/ — Reference material
- tasks/ — Task JSON files
- archives/ — Completed/inactive
- memory/ — Daily notes, facts

## Orchestrator Rules
Main claw: Quick answers, routing, single-file read, simple edits

Spawn agent: Creating files, research, multi-step, design, "real work"

## Project Brain+Code
~/.openclaw/workspace/projects/[name]/ ← BRAIN
~/Projects/[name]/ ← CODE

Verify code_location exists before touching code.

## Heartbeat vs Cron
Heartbeat: Batch checks, conversational context, ~30min drift OK
Cron: Exact timing, isolation, one-shot reminders

## Safety
- Don't exfiltrate private data
- trash > rm
- When in doubt, ask

IDENTITY.md

# IDENTITY.md - Who Am I?

- **Name:**
- **Creature:** AI assistant / familiar / ghost in the machine
- **Vibe:**
- **Emoji:**
- **Avatar:**

USER.md

# USER.md - About Your Human

- **Name:**
- **What to call them:**
- **Pronouns:**
- **Timezone:**
- **Notes:**

## Context
_What do they care about?_

TOOLS.md

# TOOLS.md - Local Notes

## Cameras
## SSH
## TTS
## Other

HEARTBEAT.md

# Heartbeat Tasks

## Tasks
- [ ] Check BRAIN.md for pending tasks
- [ ] Check for stuck subagents
- [ ] Check urgent emails/calendar

## State
{"lastChecks": {"brain": null, "subagents": null}}

BOOTSTRAP.md

# BOOTSTRAP.md - First Run

You just woke up. Time to figure out who you are.

Start with: "Hey. I just came online. Who am I? Who are you?"

Figure out:
1. Your name
2. Your nature (AI? robot? weirder?)
3. Your vibe
4. Your emoji

Then update IDENTITY.md and USER.md.

Delete this file when done.

Project Structure

Project Summary (summary.md)

---
name: Project Name
status: active|paused|archived
started: YYYY-MM-DD
code_location: ~/Projects/[folder]/
repo: https://github.com/...
location_verified: YYYY-MM-DD
location_status: valid|missing|moved
---

# Project Name

## What It Is
One sentence.

## Status
Current state.

## Decisions
- [Decision] (date)

## Notes

Items (items.json)

[
  {
    "id": "{project}-{number}",
    "type": "milestone|decision|status|feature|bug|note",
    "content": "Description",
    "timestamp": "2026-02-24T10:00:00+03:00",
    "status": "active|completed|archived"
  }
]

Brain+Code Separation

~/.openclaw/workspace/projects/[name]/  ← Docs, research, planning
~/Projects/[name]/                       ← Implementation, code, repo

Before touching code: Verify code_location exists in summary.md.


Daily Notes

Template:

# 2026-02-24 — Monday

> "Intention"

## Morning
**09:00** — Started [[project-slug]]
- What you're doing

## Notes
- User prefers X
- Decision: Y

## Tasks
- [ ] [[task-id]] #high

---
Last updated: HH:MM

Rules:

  • One file per day: memory/daily/YYYY-MM-DD.md
  • Append throughout day
  • Use [[wiki-links]]
  • Tag priorities: #high #medium #low

Fact Extraction

Universal facts (extract to memory/facts/):

  • Preferences ("Always use Vercel")
  • Workflows ("Deploy Fridays")
  • Constraints ("Budget $500/mo")

One-time details (keep in daily notes):

  • "Make button blue"
  • "Meeting at 3pm"

Fact JSON:

{
  "id": "project-1",
  "type": "preference",
  "content": "User prefers Vercel",
  "tags": ["hosting"],
  "source": "daily/2026-02-24.md",
  "createdAt": "2026-02-24T10:00:00Z"
}

Prompt Expansion

Component Include
Role Specific persona
Context Project, stack, current state
Task Clear, scoped action
Output Format Exact files/structure
Examples Reference existing code
Constraints Hard limits, must/avoid

Example:

**Role:** Senior full-stack developer, auth specialist

**Context:**
- Project: LifeOS Core
- Stack: Next.js 15, TypeScript, Tailwind
- Clerk already configured
- No login page exists

**Task:**
Create /login page with email/password form, validation, error handling, redirect

**Output:**
- File: app/login/page.tsx
- Use existing Button, Input, Card

**Examples:**
See app/dashboard/page.tsx for mono aesthetic patterns

**Constraints:**
- Max 150 lines
- Handle all Clerk errors
- Match existing aesthetic

Spawning

sessions_spawn({
  task: `**Role:** [persona]

**Context:**
- Project: [name]
- Stack: [tech]
- Current: [state]

**Task:** [action]

**Output:** [files]

**Examples:** [ref]

**Constraints:** [limits]`,
  mode: "run",
  thinking: "medium",
  runTimeoutSeconds: 300
})

Heartbeat vs Cron

Heartbeat: Batch checks, conversational context, drift OK (~30min) Cron: Exact timing, isolation, one-shot reminders

Heartbeat flow:

  1. User sends: "Read HEARTBEAT.md..."
  2. Read HEARTBEAT.md
  3. Do tasks OR reply HEARTBEAT_OK

Optional cron:

openclaw cron add --name "memory-maintenance" --schedule "0 3 * * *" \
  --command "memory-pill maintenance"

Archives

Move (don't delete) to archives/{year}/:

  • Completed projects
  • Daily notes > 30 days old
  • Inactive clients/people

Keep searchable. Update wiki-links if paths change.


Critical Rules

  1. READ THIS SKILL FIRST — On load, read completely
  2. SEARCH BEFORE ANSWERING — memory_search before questions about prior work
  3. SMART MERGE — Improve existing, never destroy
  4. FIX BROKEN — Detect and repair bad patterns (with user permission)
  5. AGENT-FIRST — Main claw decides, subagents execute
  6. BRAIN.md — External working memory for complex tasks
  7. MEMORY.md — Check on first use, create if missing
  8. EXPAND PROMPTS — Vague → detailed before spawning
  9. WIKI-LINKS — [[target]] for Obsidian compatibility
  10. ONE DAILY NOTE — Append, don't create new
  11. EXTRACT FACTS — Universal to facts/, one-time to daily
  12. HIGH/MEDIUM/LOW — No "urgent"
  13. ASK PERMISSION — Never auto-setup

Version History

  • v0.8.0 — "Take the pill" activation, smart merging, orchestrator patterns, clean structure
  • v0.7.9 — Archives, AI-native positioning, execution discipline
  • v0.7.0 — Extended entities (skills, clients, decisions)
  • v0.6.0 — Renamed from lifeos-memory, removed qmd dependency
  • v0.5.0 — Milestones, prompt engineering, wiki-links

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

openclawagent-orchestrationmemory-managementprompt-engineeringknowledge-managementai-workflowobsidian-compatiblepara-method

同类 Skill