← 返回
未分类

Hermes Memory Sync

Extract daily conversation summaries from Hermes Agent session logs and persist them as readable memory files. Covers the Python extraction script, cron setu...
从Hermes Agent会话日志中提取每日对话摘要,持久化为可读记忆文件。包括Python提取脚本和cron定时任务设置。
realpda
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 298
下载
💾 0
安装
1
版本
#automation#cron#hermes#latest#memory#sync

概述

Hermes Memory Sync

Automated daily memory extraction from Hermes Agent session logs. Reads session JSON/JSONL files, groups conversations by day, extracts key topics/decisions/tools used, and writes structured summaries to workspace/memory/YYYY-MM-DD.md.

When to Use

  • Setting up memory persistence for Hermes Agent (beyond built-in memory/session_search)
  • Recovering or backfilling memory from earlier sessions
  • Creating a human-readable daily log of what was discussed
  • Auditing session history by topic or tool usage

Installation

1. Place the script

Copy hermes-memory-sync.py to your workspace:

# Windows
copy hermes-memory-sync.py C:\path\to\workspace\

# Linux/macOS
cp hermes-memory-sync.py ~/workspace/

2. Verify

cd /path/to/workspace
python hermes-memory-sync.py stats

Expected output: shows active days, total messages, sessions, and existing memory files.

Usage

# Show coverage gaps between sessions and existing memory files
python hermes-memory-sync.py compare

# Backfill today's memory
python hermes-memory-sync.py backfill today

# Backfill a specific date
python hermes-memory-sync.py backfill 2026-05-03

# Backfill all missing dates (first-time setup)
python hermes-memory-sync.py backfill all

# Show stats
python hermes-memory-sync.py stats

Cron Setup (Hermes Native)

Use Hermes' built-in cron to run daily at 3 AM:

cronjob action=create name="memory-sync-daily"
  prompt="Run Hermes memory sync: cd /path/to/workspace && python hermes-memory-sync.py backfill today"
  schedule="0 3 * * *"

The cron job creates files at workspace/memory/YYYY-MM-DD.md each morning.

Output Format

Each memory file contains:

# 📅 YYYY-MM-DD

**会话数:** N | **消息总数:** N
**用户提问:** N | **助手回复:** N | **工具调用:** N
**使用的模型:** model1, model2

## 🎯 讨论主题
- Topic 1
- Topic 2

## 💬 关键对话
**Q:** User question...
> **A:** Assistant response...

## ⚡ 决策/方案
- Decision item...

## 🛠️ 工具使用
- Tool call summary...

---
*自动生成于 YYYY-MM-DD HH:MM,来自 N 个会话*

Supported Session Files

The script reads two types of Hermes session data:

1. session_*.json (full session records)

  • Located at %LOCALAPPDATA%/hermes/sessions/ (Windows)
  • Complete conversation history with messages array
  • Includes session_id, model, platform, session_start

2. YYYYMMDD_HHMMSS_*.jsonl (per-message logs)

  • Same sessions directory
  • One JSON object per line with {role, content, timestamp}
  • Uses Hermes format (NOT OpenClaw format)

Pitfalls

  • Memory usage — periodically review and consolidate memory entries. Over-full memory causes truncation and lost context.
  • JSONL vs JSON confusion — The sessions directory contains both .jsonl and .json files. The script handles both, but request_dump_*.json files (individual request/response dumps) are intentionally skipped to avoid duplication.
  • Don't confuse with ClawHub memory-sync — That skill is designed for OpenClaw's JSONL format ({type, message} schema). This Hermes-native implementation directly parses Hermes format ({role, content} schema). See clawhub-skills-install skill for format differences.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-08 02:11 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Kg Note Method Obsidian

realpda
Obsidian笔记库采用KG笔记法整理,含四种笔记类型、链接权限、关系中转、命名规范及新旧分离;具备自动纠错、建关系、去重、补缺、无关内容分离和分层加载功能。
★ 1 📥 1,029

Obsidian Brain

realpda
跨会话记忆——任务前按 L0→L1→L2 分层加载 Agent 记忆,任务完成后 LLM 提取事实 → 哈希去重 → 写入碎片。禁止 type/[[链接]]/related_fragments
★ 0 📥 595

大师研究笔记工作流

realpda
系统研究大师/思想家/名人的核心体系,提炼精华,存入Obsidian笔记库。基于女娲(Nuwa)多智能体并行研究方法论升级——非简单摘录百科,而是提取可复用思维框架。
★ 0 📥 391