agentleFS
kakafengkakafeng/wechat-publisher-2.0/skills/memory-manager/SKILL.md

memory-manager

Skill1 starsChanged 6 months agoMITView on GitHub

解决"记不住之前说的话"问题,实现对话的自动记录、关键信息提取和长期记忆存储。 基于以下特征打分: - 是否包含决策词("决定"、"选择"、"采用") - 是否包含承诺("我来"、"我会"、"保证") - 是否包含待办("需要"、"要做"、"尽快") - 是否包含配置(API Key、路径、设置) - 工具调用类型(写文件、改配置权重更高) 分数 > 0.5 → 自动写入MEMORY.md 分数 < 0.5 → 仅存入conversation_log.jsonl 自动识别并追踪: - 主公提到的待办 - Assistant承诺的任务 - 定期生成待办状态报告 可配合HEARTBEAT.md实现自动检查。 作者:孔明 版本:v1.0 创建日期:2026-03-24

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use skill-creator.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 3 projects that use this

The file

Files
SKILL.md

memory-manager - 自动对话记忆管理技能

概述

解决"记不住之前说的话"问题,实现对话的自动记录、关键信息提取和长期记忆存储。

核心功能

1. auto-log(自动日志)

  • 监听每轮对话,自动记录到 conversation_log.jsonl
  • 结构化存储:timestamp, role, content, tools_used, session_id

2. auto-extract(自动提取)

  • 识别重要信息:决策、承诺、待办、配置项
  • 自动更新 MEMORY.md 和 memory/YYYY-MM-DD.md
  • 标签分类:技术决策、配置、待办、学习笔记

3. auto-recall(自动回忆)

  • 每次回答前,自动 memory_search 相关上下文
  • 将相关记忆注入 prompt,避免重复询问
  • 基于会话主题智能检索

4. session-persist(会话持久化)

  • 会话结束时保存状态到 memory/sessions/
  • 新会话自动恢复相关上下文
  • 支持多话题并行记忆

快速开始

# 安装(symlink到skills目录)
ln -s /root/.openclaw/workspace/skills/memory-manager ~/.openclaw/skills/skills/

# 启用(在OpenClaw配置中添加hook)
# 或手动调用
python scripts/memory_manager.py --start-daemon

使用方式

自动模式(推荐)

配置 OpenClaw 在每轮对话后自动调用:

# openclaw.config.yaml
hooks:
  after_message: memory-manager.record
  before_answer: memory-manager.recall

手动模式

# 记录一条对话
python scripts/memory_manager.py record --role user --content "安装图像生成技能"

# 搜索记忆
python scripts/memory_manager.py search --query "图像生成"

# 生成日报(增强版)
python scripts/memory_manager.py daily-report

配置

# ~/.memory-manager/config.yaml
storage:
  log_file: "/root/.openclaw/workspace/memory/conversation_log.jsonl"
  memory_file: "/root/.openclaw/workspace/MEMORY.md"
  daily_dir: "/root/.openclaw/workspace/memory"

extraction:
  enabled: true
  importance_threshold: 0.5  # 重要性阈值
  max_items_per_day: 20

recall:
  enabled: true
  max_results: 5
  similarity_threshold: 0.7

session:
  persist: true
  max_sessions: 100

工作原理

用户消息 → OpenClaw处理 → [hook: after_message] → memory-manager记录
                                            ↓
                                     提取关键信息
                                            ↓
                                     更新MEMORY.md
                                            ↓
下次回答 → [hook: before_answer] → memory-manager检索 → 注入上下文 → 生成回复

重要性评估算法

基于以下特征打分:

  • 是否包含决策词("决定"、"选择"、"采用")
  • 是否包含承诺("我来"、"我会"、"保证")
  • 是否包含待办("需要"、"要做"、"尽快")
  • 是否包含配置(API Key、路径、设置)
  • 工具调用类型(写文件、改配置权重更高)

分数 > 0.5 → 自动写入MEMORY.md
分数 < 0.5 → 仅存入conversation_log.jsonl

与现有系统集成

  • ✅ 兼容 daily_journal.py(可读取相同日志)
  • ✅ 增强 weekly_summary.py(直接从MEMORY提取)
  • ✅ 支持 memory_search 标准接口
  • ✅ 不破坏现有工作流

待办事项追踪

自动识别并追踪:

  • 主公提到的待办
  • Assistant承诺的任务
  • 定期生成待办状态报告

可配合HEARTBEAT.md实现自动检查。


作者:孔明
版本:v1.0
创建日期:2026-03-24

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.