Memory Tiering Skill 🧠⚖️
This skill implements a dynamic, three-tiered memory architecture to optimize context usage and retrieval efficiency.
The Three Tiers
- 1. 🔥 HOT (memory/hot/HOT_MEMORY.md):
*
Focus: Current session context, active tasks, temporary credentials, immediate goals.
*
Management: Updated frequently. Pruned aggressively once tasks are completed.
- 2. 🌡️ WARM (memory/warm/WARM_MEMORY.md):
*
Focus: User preferences (Hui's style, timezone), core system inventory, stable configurations, recurring interests.
*
Management: Updated when preferences change or new stable tools are added.
- 3. ❄️ COLD (MEMORY.md):
*
Focus: Long-term archive, historical decisions, project milestones, distilled lessons.
*
Management: Updated during archival phases. Detail is replaced by summaries.
Workflow: Organize-Memory
Whenever a memory reorganization is triggered (manual or post-compaction), follow these steps:
Step 1: Ingest & Audit
- - Read all three tiers and recent daily logs (
memory/YYYY-MM-DD.md). - Identify "Dead Context" (completed tasks, resolved bugs).
Step 2: Tier Redistribution
- - Move to HOT: Anything requiring immediate attention in the next 2-3 turns.
- Move to WARM: New facts about the user or system that are permanent.
- Move to COLD: Completed high-level project summaries.
Step 3: Pruning & Summarization
- - Remove granular details from COLD.
- Ensure credentials in HOT point to their root files rather than storing raw secrets (if possible).
Step 4: Verification
- - Ensure no critical information was lost during the move.
- Verify that
HOT is now small enough for efficient context use.
Usage Trigger
- - Trigger manually with: "Run memory tiering" or "整理记忆层级".
- Trigger automatically after any
/compact command.
记忆分层技能 🧠⚖️
该技能实现了一种动态的三层记忆架构,以优化上下文使用和检索效率。
三层结构
- 1. 🔥 热层 (memory/hot/HOT_MEMORY.md):
*
关注点:当前会话上下文、活跃任务、临时凭证、即时目标。
*
管理方式:频繁更新。任务完成后积极清理。
- 2. 🌡️ 温层 (memory/warm/WARM_MEMORY.md):
*
关注点:用户偏好(Hui的风格、时区)、核心系统清单、稳定配置、重复出现的兴趣点。
*
管理方式:当偏好发生变化或新增稳定工具时更新。
- 3. ❄️ 冷层 (MEMORY.md):
*
关注点:长期存档、历史决策、项目里程碑、提炼的经验教训。
*
管理方式:在归档阶段更新。细节被摘要取代。
工作流程:组织记忆
当触发记忆重组时(手动或压缩后),请遵循以下步骤:
步骤1:摄取与审计
- - 读取所有三层记忆及近期日常日志(memory/YYYY-MM-DD.md)。
- 识别无效上下文(已完成的任务、已解决的错误)。
步骤2:层级重新分配
- - 移至热层:未来2-3轮交互中需要立即关注的内容。
- 移至温层:关于用户或系统的永久性新事实。
- 移至冷层:已完成的高级别项目摘要。
步骤3:清理与摘要化
- - 从冷层中移除细粒度细节。
- 确保热层中的凭证指向其根文件,而非存储原始密钥(如有可能)。
步骤4:验证
- - 确保移动过程中未丢失关键信息。
- 验证热层已足够精简,以便高效使用上下文。
使用触发
- - 手动触发:输入运行记忆分层或整理记忆层级。
- 自动触发:在任何/compact命令之后。