智能体框架图解指南
Exploring Pi, OpenCode, Hermes, and OpenClaw.
探索 Pi、OpenCode、Hermes 和 OpenClaw。
Not all agent harnesses are created equally. Harnesses like Pi, OpenCode, Hermes, and OpenClaw each have their own philosophy and give you different capabilities. Choosing one over the other can have a significant impact on your application and choosing which one to use isn’t all that straightforward.
并非所有智能体运行框架都生而平等。像 Pi、OpenCode、Hermes 和 OpenClaw 这样的运行框架各有自己的理念,并为你提供不同的能力。选择其中一个而非另一个,可能会对你的应用产生重大影响,而决定使用哪一个也并非那么简单直接。
In fact, if we place the exact same LLM inside each of them, we get four completely different agents:
事实上,如果我们把完全相同的 LLM 放进它们每一个里面,就会得到四个截然不同的 agent:

The exact same LLM inside four different open-source agent harnesses
完全相同的 LLM 位于四个不同的开源智能体运行框架中
Pi is your most minimalistic agent whereas OpenCode uses a shared server to handle different clients. Hermes loops skills back into its memory while OpenClaw has over 30 chat channels. And these are only some of the differences...
Pi 是最精简的 agent,而 OpenCode 使用共享服务器来处理不同的客户端。Hermes 会把技能回写到自己的记忆中,OpenClaw 则有 30 多个聊天渠道。而这些还只是部分差异……
I dove into the source code and explored in more than 30 custom visuals how these harnesses work from the ground up. To do so, we start from an educational harness that my co-author and I created called TinyAgent for our book An Illustrated Guide to AI Agents.
我深入研究了源代码,并通过 30 多张自制图剖析了这些 harness 从底层是如何运作的。为此,我们从我和合著者为我们的书 An Illustrated Guide to AI Agents 所创建的教学用 harness TinyAgent 开始。
Because these frameworks update quickly, I thought it might be helpful if I focused on a specific snapshot. That will also make it easier to update this guide in a year ;)
由于这些框架更新很快,我觉得聚焦于某个特定快照可能会更有帮助。这也会让一年后更新本指南变得更容易 ;)

Pinned snapshots comparing TinyAgent, pi, OpenCode, Hermes, and OpenClaw by language, codebase size, Turn 1 tokens, and focus
置顶快照,按语言、代码库规模、第 1 轮 token 数和关注点对 TinyAgent、pi、OpenCode、Hermes 和 OpenClaw 进行比较
Here are the snapshots for you to inspect them yourself:
以下是这些快照,你可以自行查看: