记忆索引系统:管理长期项目记忆、自动维护索引、快速定位历史项目。仅在用户说“回忆一下”“remember”“recall”时触发读取;写入与OpenClaw原生机制保持一致,索引维护后台自动进行。
A skill for project continuity and memory reconstruction. Maintains a curated index of topics with multi-generation consolidation to help recover context across long-running conversations.
OperationTriggerBehaviorReadUser explicitly says "回忆一下" / "remember" / "recall" / "记不记得"Check INDEX.md → read consolidation → respondWriteOpenClaw native flush (pre-compaction)Write to memory/YYYY-MM-DD.md as usualIndex UpdateEnd of conversation + heartbeatPropose new entries, update dates, consolidate if neededDaily FlushEvery day at 11:00 AMArchive yesterday's memory, update INDEX, check consolidation
text
memory/
├── INDEX.md # Master index of tracked topics
├── MEMORY.md # Native long-term memory (OpenClaw)
├── YYYY-MM-DD.md # Daily memories (OpenClaw native writes)
└── consolidated/ # Multi-generation consolidations
├── {topic}-gen1-YYYY-MM-DD.md
├── {topic}-gen2-YYYY-MM-DD.md
└── ...
markdown
# Memory Index
## Projects
- **project-slug**
- Dates: [2025-03-20, 2025-03-22, 2025-03-25, 2025-04-01]
- Consolidations:
- gen1 (2025-03-25): consolidated/project-slug-gen1-2025-03-25.md
- Current: consolidated/project-slug-gen1-2025-03-25.md
- Status: active | completed | paused | abandoned
## Major Events
- **event-slug**: [2025-03-15]
- Description: Brief description
## Decisions
- **decision-slug**: [2025-03-10, 2025-03-12]
- Consolidations:
- gen1 (2025-03-12): consolidated/decision-slug-gen1-2025-03-12.md
- Current: consolidated/decision-slug-gen1-2025-03-12.md
User trigger: "回忆一下那个网站项目" / "Remember the website project?"
Agent workflow:
text
1. Read INDEX.md
2. Find matching topic (fuzzy match on name)
3. If found:
a. Read Current consolidation file
b. Read today's memory/YYYY-MM-DD.md for fresh updates
c. Synthesize and respond
4. If not found in INDEX:
a. Fall back to memory_search("website project")
b. Respond with search results
c. (Optional) Propose adding to index if significant
Trigger: OpenClaw pre-compaction flush or user says "remember this"
Behavior: Write to memory/YYYY-MM-DD.md per OpenClaw native rules
No skill involvement - this is pure OpenClaw behavior.
Trigger: End of conversation OR heartbeat
Agent workflow:
text
1. Review today's memory file
2. Identify topics worth indexing:
- New projects started
- Major events occurred
- Important decisions made
- Existing indexed topics mentioned
3. For existing topics: add today's date to Dates list
4. Propose new index entries to user (if autoPropose enabled)
5. Check consolidation threshold:
- Count dates since last consolidation
- If > 3: propose consolidation to user
- On approval: create gen{N+1} consolidation
Trigger: System cron job at 11:00 AM daily
Agent workflow:
text
1. Identify yesterday's date (YYYY-MM-DD)
2. Check if yesterday's memory file exists
- If not: create empty file with <!-- DAILY_FLUSH --> marker
3. Execute OpenClaw native memory storage:
- Append <!-- NATIVE_FLUSH --> to yesterday's file
- Archive any in-memory context from yesterday
4. Execute Skill index update:
- Scan yesterday's file for index-worthy topics
- Update INDEX.md with yesterday's date
- Check if any topic needs consolidation (>3 days)
5. Initialize today's memory file (if not exists)
6. Log flush completion
Daily Flush Script: ~/.openclaw/scripts/daily-flush.sh Launchd Config: ~/Library/LaunchAgents/com.openclaw.daily-flush.plist
Purpose: Ensure yesterday's memory is properly archived even if:
A topic needs new consolidation when:
Create new file: consolidated/{topic}-gen{N}-{today}.md
Sources:
Content structure: markdown
# {Topic} - Generation {N} Consolidation
**Created**: 2025-04-15
**Covers**: 2025-04-01 to 2025-04-15
**Previous**: consolidated/{topic}-gen{N-1}-{date}.md
## Summary
[Compiled narrative of all covered periods]
## Key Points
[Where things stand now]
4. **Mark sources archived**: Add `<!-- ARCHIVED: consolidated into {file} -->` to daily files
5. **Update INDEX.md**: Add consolidation entry, update Current pointer
* * *
## Categories
CategoryDescriptionExample**Projects**Multi-day efforts with deliverableswebsite redesign, app development**Major Events**Significant life/career changesjob change, relocation**Decisions**Choices with lasting impacttech stack, vendor selection**Preferences**Personal settings that persistcommunication style, tools
* * *
## Configuration
`memory-index-manager/config.json`:
json
```json
{
"consolidationThreshold": 3,
"autoProposeIndex": true,
"categories": ["Projects", "Major Events", "Decisions", "Preferences"],
"indexFile": "memory/INDEX.md",
"consolidatedDir": "memory/consolidated",
"recallTriggers": ["回忆一下", "remember", "recall", "记不记得"]
}
AspectNative OpenClawThis SkillStoragememory/*.md``INDEX.md + consolidated/*.mdWrite timingAuto (flush) + ManualSame (no change)Read timingAny searchOnly on explicit recall triggerSearch methodSemantic ( memory_search)Index lookup + targeted readGranularityChunk-level (~400 tokens)Topic-level consolidation
Key point: This skill's files are stored in memory/ and indexed by OpenClaw's semantic search, but the skill only activates on explicit recall requests.
text
[Day 1 - 2025-03-20]
User: "Let's start a new project: building a personal blog"
Agent: [writes to memory/2025-03-20.md]
Agent: "I'll track this as 'personal-blog' project. Adding to index?"
User: "Yes"
→ Creates INDEX.md entry: personal-blog, Dates: [2025-03-20]
[Day 2 - 2025-03-22]
User: "For the blog, let's use Next.js"
Agent: [writes to memory/2025-03-22.md]
→ Updates INDEX.md: personal-blog Dates: [2025-03-20, 2025-03-22]
[Day 3 - 2025-03-25]
User: "Blog hosting should be Vercel"
Agent: [writes to memory/2025-03-25.md]
→ Updates INDEX.md: personal-blog Dates: [2025-03-20, 2025-03-22, 2025-03-25]
→ TRIGGER: 3 dates, proposes consolidation
User: "Go ahead"
→ Creates consolidated/personal-blog-gen1-2025-03-25.md
→ Archives daily files
[Day 7 - 2025-04-05]
User: "回忆一下博客项目"
Agent: [reads INDEX.md → finds personal-blog]
Agent: [reads consolidated/personal-blog-gen1-2025-03-25.md]
Agent: "We started the personal blog project on March 20th. We decided to use Next.js
(March 22nd) and host on Vercel (March 25th). The project is currently active."
Breaking Changes:
升级步骤:
memory/INDEX.mdUser SaysAgent Action"回忆一下那个网站项目"查 INDEX.md → 读 consolidation → 回答"remember the blog project"同上,支持英文触发"把这个加入索引"询问分类 → 创建 INDEX.md 条目"显示索引"展示 INDEX.md 内容"Consolidate blog project"检查阈值 → 执行整合