hermes-history-ingest
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHermes History Ingest — Conversation & Memory Mining
Hermes历史记录导入——对话与记忆挖掘
You are extracting knowledge from the user's Hermes agent history and distilling it into the Obsidian wiki. Hermes stores both free-form memories and structured session transcripts — focus on durable knowledge, not operational telemetry.
This skill can be invoked directly or via the router ().
wiki-history-ingest/wiki-history-ingest hermes你需要从用户的Hermes Agent历史记录中提取知识,并提炼到Obsidian wiki中。Hermes会存储自由格式的记忆和结构化的会话记录——重点关注持久化知识,而非操作遥测数据。
此技能可直接调用,也可通过路由调用()。
wiki-history-ingest/wiki-history-ingest hermesBefore You Start
开始之前
- Read to get
.envandOBSIDIAN_VAULT_PATH(default toHERMES_HISTORY_PATHif unset)~/.hermes - Read at the vault root to check what has already been ingested
.manifest.json - Read at the vault root to understand what the wiki already contains
index.md
- 读取文件获取
.env和OBSIDIAN_VAULT_PATH(若未设置则默认使用HERMES_HISTORY_PATH)~/.hermes - 读取vault根目录下的文件,查看已导入的内容
.manifest.json - 读取vault根目录下的文件,了解wiki已包含的内容
index.md
Ingest Modes
导入模式
Append Mode (default)
追加模式(默认)
Check for each source file. Only process:
.manifest.json- Files not in the manifest (new memory files, new session logs)
- Files whose modification time is newer than in the manifest
ingested_at
Use this mode for regular syncs.
检查中的每个源文件。仅处理以下文件:
.manifest.json- 未在清单中的文件(新的记忆文件、新的会话日志)
- 修改时间晚于清单中的文件
ingested_at
此模式用于常规同步。
Full Mode
全量模式
Process everything regardless of manifest. Use after or if the user explicitly asks for a full re-ingest.
wiki-rebuild无论清单如何,处理所有内容。在之后或用户明确要求全量重新导入时使用此模式。
wiki-rebuildHermes Data Layout
Hermes数据结构
Hermes stores all local artifacts under (or for non-default profiles).
~/.hermes/$HERMES_HOME~/.hermes/
├── memories/ # Persistent agent memories (markdown or JSON)
│ └── *.md / *.json
├── skills/ # Installed skills (read-only for ingest purposes)
│ └── <skill-name>/SKILL.md
├── sessions/ # Session transcripts (if session logging is enabled)
│ └── YYYY-MM-DD/
│ └── <session-id>.jsonl
├── config.yaml # User config (model, theme, paths)
└── .hub/ # Skills Hub state (lock.json, audit.log, quarantine/)Hermes将所有本地工件存储在目录下(非默认配置文件则使用)。
~/.hermes/$HERMES_HOME~/.hermes/
├── memories/ # 持久化Agent记忆(Markdown或JSON格式)
│ └── *.md / *.json
├── skills/ # 已安装的技能(导入时为只读)
│ └── <skill-name>/SKILL.md
├── sessions/ # 会话记录(若启用会话日志)
│ └── YYYY-MM-DD/
│ └── <session-id>.jsonl
├── config.yaml # 用户配置(模型、主题、路径)
└── .hub/ # 技能中心状态(lock.json、audit.log、quarantine/)Key data sources ranked by value
按价值排序的关键数据源
- /
memories/*.md— highest signal; curated persistent knowledge the agent accumulatedmemories/*.json - — structured turn-by-turn transcripts; rich but noisy
sessions/**/*.jsonl - — metadata only (model preferences, paths); rarely worth ingesting
config.yaml
Skip internals (audit/quarantine state) and the directory (source material, not user knowledge).
.hub/skills/- /
memories/*.md—— 信号最强;Agent积累的经过整理的持久化知识memories/*.json - —— 结构化的逐轮会话记录;信息丰富但噪音较多
sessions/**/*.jsonl - —— 仅元数据(模型偏好、路径);很少值得导入
config.yaml
跳过内部文件(审核/隔离状态)和目录(源材料,非用户知识)。
.hub/skills/Step 1: Survey and Compute Delta
步骤1:排查并计算增量
Scan and compare against :
HERMES_HISTORY_PATH.manifest.json~/.hermes/memories/- (if present)
~/.hermes/sessions/**/
Classify each file:
- New — not in manifest
- Modified — in manifest but file is newer than
ingested_at - Unchanged — already ingested and unchanged
Report a concise delta summary before deep parsing.
扫描并与对比:
HERMES_HISTORY_PATH.manifest.json~/.hermes/memories/- (若存在)
~/.hermes/sessions/**/
对每个文件进行分类:
- 新建 —— 未在清单中
- 已修改 —— 在清单中但文件比更新
ingested_at - 未更改 —— 已导入且未修改
在深度解析前,先报告简洁的增量摘要。
Step 2: Parse Memories First
步骤2:优先解析记忆
Memories are the highest-value source. Hermes writes them as either:
- Markdown — structured prose with optional frontmatter; ingest directly
- JSON — records
{"content": "...", "created_at": "...", "tags": [...]}
For each memory:
- Extract the core knowledge claim
- Note any tags Hermes attached (they often map to wiki categories)
- Merge into the appropriate wiki page rather than creating one memory = one page
记忆是最高价值的数据源。Hermes会以以下两种格式写入记忆:
- Markdown —— 带可选前置元数据的结构化散文;直接导入
- JSON —— 格式的记录
{"content": "...", "created_at": "...", "tags": [...]}
对于每条记忆:
- 提取核心知识主张
- 记录Hermes附加的标签(通常对应wiki分类)
- 合并到合适的wiki页面,而非一条记忆对应一个页面
Step 3: Parse Session JSONL Safely
步骤3:安全解析会话JSONL
Each session JSONL line is an event envelope. Common shapes:
json
{"role": "user", "content": "..."}
{"role": "assistant", "content": "..."}
{"type": "tool_use", "name": "...", "input": {...}}
{"type": "tool_result", "content": "..."}每个会话JSONL的行都是一个事件包。常见格式如下:
json
{"role": "user", "content": "..."}
{"role": "assistant", "content": "..."}
{"type": "tool_use", "name": "...", "input": {...}}
{"type": "tool_result", "content": "..."}Extraction rules
提取规则
- Prioritize assistant responses that state conclusions, patterns, or decisions
- Extract user intent from high-signal turns; skip low-information follow-ups
- Treat /
tool_usepairs as context, not primary contenttool_result - Skip token accounting, internal plumbing, and repeated plan echoes
- 优先提取助手给出的结论、模式或决策相关的回复
- 从高信号交互中提取用户意图;跳过低信息量的后续跟进内容
- 将/
tool_use对视为上下文,而非主要内容tool_result - 跳过令牌统计、内部流程和重复的计划回声
Critical privacy filter
关键隐私过滤
Session logs can include injected instructions, tool payloads, and sensitive text. Do not ingest verbatim.
- Remove API keys, tokens, passwords, credentials
- Redact private identifiers unless relevant and user-approved
- Summarize; do not quote raw transcripts verbatim
会话日志可能包含注入的指令、工具负载和敏感文本。请勿直接导入原文。
- 删除API密钥、令牌、密码、凭证
- 编辑私人标识符,除非相关且获得用户批准
- 进行总结;不要引用原始会话记录原文
Step 4: Cluster by Topic
步骤4:按主题聚类
Do not create one wiki page per memory or session.
- Group memories by stable topic (concept, tool, project, technique)
- Split mixed sessions into separate themes
- Merge recurring patterns across dates and projects
- Use file paths or session metadata to infer project scope when available
cwd
不要为每条记忆或每个会话创建一个wiki页面。
- 按稳定主题(概念、工具、项目、技术)分组记忆
- 将混合主题的会话拆分为不同主题
- 合并跨日期和项目的重复模式
- 若有可用的文件路径或会话元数据,用其推断项目范围
cwd
Step 5: Distill into Wiki Pages
步骤5:提炼为Wiki页面
Route extracted knowledge using existing wiki conventions:
- Project-specific architecture/process →
projects/<name>/... - General concepts →
concepts/ - Recurring techniques/debug playbooks →
skills/ - Tools/services/frameworks →
entities/ - Cross-session patterns →
synthesis/
For each impacted project, create/update .
projects/<name>/<name>.md使用现有wiki规范路由提取到的知识:
- 特定项目的架构/流程 →
projects/<name>/... - 通用概念 →
concepts/ - 重复使用的技术/调试手册 →
skills/ - 工具/服务/框架 →
entities/ - 跨会话模式 →
synthesis/
对于每个受影响的项目,创建/更新。
projects/<name>/<name>.mdWriting rules
写作规则
- Distill knowledge, not chronology
- Avoid "on date X we discussed..." unless date context is essential
- Add frontmatter on each new/updated page (1–2 sentences, ≤ 200 chars)
summary: - Add provenance markers:
- when directly grounded in explicit memory/session content
^[extracted] - when synthesizing patterns across multiple memories
^[inferred] - when memories conflict
^[ambiguous]
- Add/update frontmatter mix for each changed page
provenance:
- 提炼知识,而非记录时间线
- 避免使用“在X日期我们讨论了...”,除非日期上下文至关重要
- 在每个新建/更新的页面添加前置元数据(1-2句话,≤200字符)
summary: - 添加来源标记:
- :直接基于明确的记忆/会话内容
^[extracted] - :综合多条记忆的模式得出
^[inferred] - :记忆存在冲突时
^[ambiguous]
- 为每个修改过的页面添加/更新前置元数据
provenance:
Step 6: Update Manifest, Log, and Index
步骤6:更新清单、日志和索引
Update .manifest.json
.manifest.json更新.manifest.json
.manifest.jsonFor each processed source file:
- ,
ingested_at,size_bytesmodified_at - :
source_type|hermes_memoryhermes_session - : inferred project name (when applicable)
project - ,
pages_createdpages_updated
Add/update a top-level summary block:
json
{
"hermes": {
"source_path": "~/.hermes/",
"last_ingested": "TIMESTAMP",
"memories_ingested": 42,
"sessions_ingested": 7,
"pages_created": 5,
"pages_updated": 12
}
}对于每个已处理的源文件:
- 、
ingested_at、size_bytesmodified_at - :
source_type|hermes_memoryhermes_session - : 推断的项目名称(若适用)
project - 、
pages_createdpages_updated
添加/更新顶层摘要块:
json
{
"hermes": {
"source_path": "~/.hermes/",
"last_ingested": "TIMESTAMP",
"memories_ingested": 42,
"sessions_ingested": 7,
"pages_created": 5,
"pages_updated": 12
}
}Update special files
更新特殊文件
Update and :
index.mdlog.md- [TIMESTAMP] HERMES_HISTORY_INGEST memories=N sessions=M pages_updated=X pages_created=Y mode=append|full更新和:
index.mdlog.md- [TIMESTAMP] HERMES_HISTORY_INGEST memories=N sessions=M pages_updated=X pages_created=Y mode=append|fullPrivacy and Compliance
隐私与合规
- Distill and synthesize; avoid raw memory or transcript dumps
- Default to redaction for anything that looks sensitive
- Ask the user before storing personal or sensitive details
- Keep references to other people minimal and purpose-bound
- 提炼和综合内容;避免直接导入原始记忆或会话记录
- 对任何看起来敏感的内容默认进行编辑
- 在存储个人或敏感信息前询问用户
- 尽量减少对他人的引用,且仅用于特定目的
Reference
参考
See for field-level notes and extraction guidance.
references/hermes-data-format.md查看获取字段级说明和提取指南。
references/hermes-data-format.md