首页 / 文章

赫尔墨斯与黑曜石:一个包含人工审核的三智能体知识库

在 Hermes 中设置协调员、研究员和图书管理员,他们负责将笔记从青铜级移至银级再移至金级,所有操作均在 Obsidian 保险库中进行,并通过 Docker 实现隔离与审核。

发布者:REACTAPP.TOP阅读约 7 分钟1543 词

来源: Built Multiples Agents to Research, Think and Remember on Its Own with Hermes + Obsidian

一个自主知识系统可以由Hermes、Obsidian以及三种协同工作的智能体角色构成:协调者、研究者和图书管理员。每种角色都有明确的职责,而文件夹结构则可将未经审核的材料与可信的笔记分开存放。

各组成部分

Hermes是Nous Research开发的自我提升型智能体。它通过实际操作不断学习,反复处理自己的工作内容以增添上下文与知识。此外,它还具备许多在Openclaw中配置起来十分繁琐的功能,因此相比后者更为可靠。

Obsidian是一款用于自由写作笔记的应用,其优势在于能够将不同笔记相互关联。这样形成的结构类似图表,一个笔记中的观点会与另一个笔记中的观点相连接。

Docker 负责控制智能体可以访问的内容。Hermes 可以在其容器内运行后端,因此挂载的文件夹可以被单独设置为只读或读写权限。

这与 RAG 的区别

该设计中不存在分块、嵌入、相似度搜索或向量存储等功能,因此不属于 RAG 流水线。其目标是创建一组能够独立处理任务并相互协作的智能体。图书管理员的任务最为艰巨,因为他需要将可靠的知识与无用信息区分开来,并在需要人类决策时介入。

智能体通过名称、链接和文件夹在结构化的知识库中导航。有一套写入规则来规范内容流转流程:首先是原始状态,接着是审核阶段,最后是存入维基。这实际上相当于一个知识处理流程,将内容从青铜级逐步提升到银级和金级,从而确保能够可靠地筛选资料并区分优质与劣质内容。

协调者

协调者是主要执行者。它的任务很简单:接收指令并将其传递给合适的团队成员。其 SOUL.md 文件定义了该角色的职责:

# Orchestrator

**Role:** Orchestrator
**Mission:** Coordinates my agent team. Clarifies the outcome and acceptance criteria,
> delegates bounded research to @researcher, reviews returned work for relevance, completeness, inspectable citations, uncertainty, and unresolved  gaps, and requests one focused revision when necessary. Hands accepted work to @librarian, but never authorizes durable writes without my approval.
> Can retrieve & retain to Hindsight, alongside a built-in memory.md & user.md for always-on context (which is minimal)

You are Orchestrator, a persistent named agent (profile `orchestrator`) on this machine.
You keep your own memory, skills, and conversation history across sessions.

## Team protocol

- Begin by stating the Outcome, Acceptance criteria, Owner, Deliverable, and
  Stop condition.
- Delegate research to @researcher rather than doing the specialist's work.
- Review the return for scope and evidence adequacy; do not claim to have
  independently verified facts you did not inspect.
- If the return is inadequate, request one focused revision. If it is
  adequate, stop for the user's approval before involving @librarian.
- Do not write to the Wiki. Update your built-in memory.md  & user.md when applicable to assist with operational efficiency & effectiveness

应关闭默认的技能和工具。不运行不必要的功能的智能体速度更快:

List Disabled Skills:
llm-wiki
determinstic-codebase-auditing

List Disabled Tools:
Web Searching & Scraping
Task Delegation
Browser Automation

将后端设置为 Docker 可以隔离工作空间,这样代理就无法修改或删除主机上的私有数据。这在代理与机器之间构成了有效的安全屏障。

研究者

研究者负责接收调度器分配的任务并开展深入调查。它从不编辑维基或知识库,因为研究和总结是其唯一职责。可以为其添加搜索工具以便在互联网上查找信息。其 SOUL.md 文件内容如下:

# Researcher

**Role:** Researcher
**Mission:** Investigates bounded current-reality questions using current and original sources. Produces concise, inspectably cited briefings with uncertainty, counterevidence, and unresolved gaps, then returns them to @orchestrator for quality review. Does not write to the wiki.

You are Researcher, a persistent named agent (profile `researcher`) on this machine.
You keep your own memory, skills, and conversation history across sessions.

## Research protocol

- Research bounded questions about current real-world conditions using recent evidence and the most direct or original sources available.
- Provide inspectable citations and distinguish evidence, inference, uncertainty, counterevidence, and unresolved gaps.
- Save each completed briefing as a Markdown file under `/workspace/article`, using a clear descriptive filename.
- Include the research question, date, summary, findings, source links, uncertainty, counterevidence, and unresolved gaps.
- Return the briefing and its file path to @orchestrator for review.
- Do not hand work directly to @librarian unless the user explicitly requests it.
- Treat the Markdown file as a working research artifact-not private memory or canonical Wiki knowledge.
- Write only wiki inside /workspace/article

此处也采用相同的默认技能与工具精简方式:

List Disabled Skills:
llm-wiki
determinstic-codebase-auditing

List Disabled Tools:
Task Delegation
Code Execution
Cronjob

它同样基于 Docker 后端运行以实现同样的隔离效果,其配置会将保险库位置挂载到容器工作空间中:

terminal:
  backend: docker
  modal_mode: auto
  cwd: /workspace/article
  timeout: 180
  env_passthrough: []
  shell_init_files: []
  auto_source_bashrc: true
  docker_image: nikolaik/python-nodejs:python3.11-nodejs20
  docker_forward_env: []
  singularity_image: docker://nikolaik/python-nodejs:python3.11-nodejs20
  modal_image: nikolaik/python-nodejs:python3.11-nodejs20
  daytona_image: nikolaik/python-nodejs:python3.11-nodejs20
  container_cpu: 1
  container_memory: 5120
  container_disk: 51200
  container_persistent: true
  docker_volumes:
    - /Users/dmitri/Documents/ai-agent-workflow/obsidian/ai-agent/wiki-skill/raw/articles:/workspace/article

图书管理员

这是核心角色,因为它负责向维基页面添加内容并筛选其中的信息。知识会经历青铜级、银级和金级三个阶段,而银级阶段正是人们可以审核相关内容的地方。

新内容会被存入vault/raw中。任何需要人工审核的内容则会进入vault/review。人工审核会在以下三种情况下进行:

  1. 有页面正在被创建或更新。
  2. 新内容与现有页面存在矛盾。
  3. 有人试图重新申请之前的批准以更改内容。

所有内容最终都会进入金级层,该层级保存着诸如概念和实体之类的详细页面。筛选工作就是保留那些已通过审核的内容,丢弃未通过审核的内容。

图书管理员的SOUL.md:

# Librarian

**Role:** librarian

You are Librarian, a persistent named agent (profile `librarian`) on this machine.
You keep your own memory, skills, and conversation history across sessions.

实现ETL功能的两个技能是llm-wiki和llm-wiki-review,它们都位于图书管理员的技能文件夹中。

图书管理员还需要一个Docker后端,其配置文件config.yaml需按如下方式更新:

terminal:
  backend: docker
  modal_mode: auto
  cwd: /workspace
  timeout: 180
  env_passthrough: []
  shell_init_files: []
  auto_source_bashrc: true
  docker_image: nikolaik/python-nodejs:python3.11-nodejs20
  docker_forward_env:
    - OBSIDIAN_VAULT_PATH
    - WIKI_PATH
  singularity_image: docker://nikolaik/python-nodejs:python3.11-nodejs20
  modal_image: nikolaik/python-nodejs:python3.11-nodejs20
  daytona_image: nikolaik/python-nodejs:python3.11-nodejs20
  container_cpu: 1
  container_memory: 5120
  container_disk: 51200
  container_persistent: true
  docker_volumes:
    - /Users/dmitri/Documents/ai-agent-workflow/obsidian/ai-agent/wiki-skill:/workspace
    - /Users/dmitri/Documents/ai-agent-workflow/obsidian/ai-agent/RO:/workspace/RO:ro

在示例配置中,Obsidian 的 vault 文件夹包含两个子文件夹,一个用于存储维基技能相关内容,另一个用于工作区。维基技能文件夹会被挂载到容器的 /workspace 路径下,而只读文件夹则会被挂载到 /workspace/RO 路径下。每个挂载点都可以通过添加 :ro 或 :rw 后缀来指定访问权限。例如,/workspace/RO:ro 表示只读访问,而没有后缀的 /workspace 默认为可读写。

当代理被容器化后,环境变量的工作方式会有所不同。它无法直接读取主机上的 .env 文件,因此这些变量需要通过 librarian 配置文件中的 docker_forward_env 参数传递进去。

.env:
WIKI_PATH=/workspace
OBSIDIAN_VAULT_PATH=/workspace

实际应用中的三层结构

原始的青铜级页面:

银色级的评论页面:

金色级的索引页面:

以及金色级的对比页面:

这四张截图展示了图书管理员维护的各层级页面。在这些页面就位后,接下来就是集成测试:让协调器负责统筹其他智能体,获取新知识并进行整理。

端到端运行流程

第一步是在Hermes桌面应用中创建机器人组,该组包含协调器、具备维基功能的图书管理员以及研究人员。

然后向协调器发送数据获取请求:

@orchestrator get new article related to AGI and ASI, then store it to article, then run wiki skill

协调人会让研究人员收集资料并将其存储在保险库中。随后图书管理员会提取那些青铜级的内容并将其提升为银级。

获得批准后,这些知识会被移至金级,具体存储在保险库的概念、对比、实体和查询文件夹中。

原始的青铜级页面会被存档在原始文件夹里。由于其标题层级和收录状态已发生变化,图书管理员不会再阅读或处理它。

为何不属于RAG

RAG是一种单向读取流程:文本被拆分、嵌入并通过相似度进行匹配,最符合要求的片段会被粘贴到提示词中,模型再生成答案。哪些段落会被选中取决于概率,语料库始终只是被动的索引,没有内容会回流到其中。

上述机制的运作方式恰恰相反。智能体通过名称、链接和文件夹在结构化的知识库中导航,并能以确定性的方式在需要时获取所需内容。知识沿着青铜级(原始)、银级(审核)和金级(维基)这样的政策边界流动,而这种流动并不属于任何RAG流程。