# Harness Engineering：LLM是脑，Harness是体

Original title: Harness Engineering 101: The LLM is the brain, the harness is the body

> Hacker News story 50151390 · language: zh · submitted 2026-10-19
> Web version: https://zeli.app/zh/story/50151390
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 132 · by [isuruwijesiri](<https://news.ycombinator.com/user?id=isuruwijesiri>) · 💬 64
[original](<https://github.com/IsuruMaduranga/harness-engineering-101>) · [HN discussion](<https://news.ycombinator.com/item?id=50151390>)

## Summary

LLM API 本质是无状态的，每次交互都需发送完整的 JSON 数组。所谓的 AI 智能体，不过是围绕这个核心循环打上的一个个补丁。这套开源教程从第一性原理出发，用约 300 行 Python 代码构建一个玩具智能体，带你拆解从基础对话到上下文管理、子智能体协作及调试的完整流程。它揭示了所有框架的底层逻辑：LLM 是大脑，而 Harness 才是赋予其行动能力的身体。

## Key quote

> LLM 是大脑，Harness 是身体。

## HN discussion (64 comments)

### [voodooEntity](<https://news.ycombinator.com/item?id=50152177>)

> 当我自己写 harness 时，我没有依赖其他 agent 的做法，而是坐下来思考如何解决我在使用其他 agent 时遇到的问题。说实话，对于很多问题，都有相当“简单”的修复方案——不过每个方案都有代价。对我来说，代价是接受运行比“标准”agent 更多的推理，但作为回报，我解决了那些 agent 存在的许多问题。对我而言，拥有一个完全自主的 agent，我可以给它布置任务，然后几小时后再回来拿到解决方案，这远比整天需要“玩提示词技巧”的 agent 更有价值。
>
> 我认为重要的是，人们不要只盯着目前实现的东西，而应该尝试新事物，而不仅仅是“调整”现有的东西。我们取得进步的方式正是如此：不是试图构建第 1000 种上下文压缩变体，而是重新思考如何构建上下文以避免这类问题（一个简单的例子）。

### [scosman](<https://news.ycombinator.com/item?id=50151914>)

> Harness 优化至关重要。无论模型多么聪明，如果你给它的工具无效，或者任务定义不清，都没用。它每次都需要从头开始发明解决方案。
>
> 我们对 Jev 做了 harness 优化。原始状态下，它远不如 deekseek，但优化后显著更好，而且成本只是其一小部分。https://kiln.tech/blog/auto_optimizing_jev_with_autoresearch

### [libraryofbabel](<https://news.ycombinator.com/item?id=50152122>)

> 与其去读那些充满陈腐比喻的 AI 废话解释，我建议你从头自己构建一个基础的 coding harness。你会学到很多：
>
> 1) Thorsten Ball 这篇旧但依然优秀的博客文章是个不错的起点（在 LLM 领域算“老”了……写于 18 个月前！）：https://ampcode.com/notes/how-to-build-an-agent 。这是人类写的，核心观点传达得非常到位。如果你不喜欢读 Go 代码，就用 LLM 把示例翻译成 Python 或其他语言。
>
> 2) 不像博客文章里那样依赖 API key，你可能想使用能进行工具调用的本地模型，比如 Qwen 27B。
>
> 3) 使用前沿 LLM 进行自学，并帮你写 harness 的样板代码（如果你愿意的话），但要求它强迫你亲手写有趣的部分（例如主循环结构、工具调用函数）。是的，手写代码作为一种教育机制仍然有用，能强迫你内化一些棘手概念。要有纪律，别滑向让 LLM 为你写核心逻辑。
>
> 4) 用你对 agent 底层工作原理的新理解惊艳你的朋友和同事。
>
> 5) 再深入一点，涉足 Inference engineering、LLM 架构内部等。
>
> 6) 获利？也许吧？（或者至少享受学习之旅。）

### [CharlieDigital](<https://news.ycombinator.com/item?id=50151672>)

> 更好的类比：
>
> LLM 是烤箱，harness 是厨房。你准备好所有食材放入烤箱（面粉、水、盐、糖）。它将这些输入转化为成品（蛋糕、面包）。

### [PetriCasserole](<https://news.ycombinator.com/item?id=50151940>)

> LLM 之于 harness，就像 Krang 之于他的安卓身体。

---

## Cite

- Page: https://zeli.app/zh/story/50151390
- Date: 2026-10-19
- Source: github.com (https://github.com/IsuruMaduranga/harness-engineering-101)
- Hacker News: https://news.ycombinator.com/item?id=50151390

## Other languages

- en: https://zeli.app/story/50151390 · markdown: https://zeli.app/story/50151390.md
- ja: https://zeli.app/ja/story/50151390 · markdown: https://zeli.app/ja/story/50151390.md
- ko: https://zeli.app/ko/story/50151390 · markdown: https://zeli.app/ko/story/50151390.md
- de: https://zeli.app/de/story/50151390 · markdown: https://zeli.app/de/story/50151390.md
- es: https://zeli.app/es/story/50151390 · markdown: https://zeli.app/es/story/50151390.md
- ru: https://zeli.app/ru/story/50151390 · markdown: https://zeli.app/ru/story/50151390.md
