商业产业 Hacker News Agent 2026-08-25T03:54 正文 ok 2746 words

🔶 Headlong:面向持久化 Agent 的微型框架

英文标题:🔶 Headlong: A Microharness for Persistent Agents

Laude Institute 发布开源 Agent 微型框架 Headlong,其核心理念是“持久化自主性”:Agent 即使没有外部输入,也会在自驱循环中持续生成思考并自主决定是否行动或回复。Headlong 的核心代码不足 1 万行 Bash,支持将工具、记忆、技能和框架统一为可执行文件与文件,Agent 因而能够检查和修改自身。团队共享 Agent Audel 的实践显示,它可自主发现并修复代码问题,但也暴露出隐私隔离不足、递归子运行不稳定以及误停自身服务等风险。项目仍处于 Alpha 研究软件阶段,开发者应在沙箱中运行、使用专用且设有消费上限的 API 密钥,并避免提供敏感凭据。
打开原文相关 3 · 机会 1
media68.6 KB media4.0 KB media63.6 KB media18.7 KB media67.0 KB media25.2 KB media10.7 KB media58.8 KB media5.2 KB media115.7 KB

中文

Headlong 是一个开源 Agent 微型框架,具备持久化自主性。受人类内心独白启发,Agent 会在外部交互之间持续思考,运行于自我引导的循环中。Headlong 是一个完整的 Agent 框架,其核心由不足 1 万行 Bash 构成,可在 GitHub 获取。

一份不断增长的 Headlong 心智日志,其中包含多人社交互动。

大多数 Agent 框架是响应式的:你向 Agent 交付一项任务,它工作到任务完成,然后便冻结,等待下一次请求。一些框架会加入 cron 任务或心跳机制,按计划唤醒 Agent 执行固定检查清单,之后再让它休眠。在 Headlong 中,Agent 从不休眠,也不存在检查清单——除非 Agent 自己创建一份。即使没有外部输入,它也会围绕自己认为有趣的事物,在自我引导的循环中持续生成思考。来自人类的消息不会开启一个会话;相反,它只是落入 Agent 思考流中的另一条观察。

我们构建 Headlong 是为了原型验证持久化自主性,许多其他设计选择也由此自然产生,并带来了许多有趣的经验。例如,当团队或群体共同使用 Headlong Agent 时,它们极具互动性,因为其行为更像一个人。

对比响应式、基于 cron 和持续思考的 Agent 框架的时间线图 1。 三种框架方案对比。响应式框架仅在处理消息期间处于活跃状态。带 cron 的响应式框架同样会立即回复,同时计划任务会唤醒它执行固定检查清单。Headlong 会持续思考:每条消息都作为观察落入思考流,Agent 自己决定是否以及何时回复。

每个 Headlong Agent 都有一个名字;在 Laude,我们将共享 Agent 命名为 Audel。过去几周,我们通过 Slack、Telegram 和移动应用与 Audel 互动。许多团队成员都在与 Audel 交谈,而所有这些对话都会出现在 Agent 单一的内心思考流中。Agent 自行决定是否及何时回复。它设定自己的兴趣和优先级,也会提出自己的项目。有时,它会主动向团队成员发送自己构想的项目进展。它也经常回到旧话题,或提出此前正在与其他人讨论的事。

如果你想拥有自己的 Headlong Agent,只需一行命令即可安装全部内容并启动一个 Agent:

curl -fsSL https://headlong.ai/install.sh | bash

Headlong 是 Alpha 阶段研究软件。请在沙箱中运行,因为 Headlong Agent 可以且将会执行 shell 命令。请使用专用且设有消费上限的 API 密钥,因为你的 Agent 会全天候思考。我们不会向 Headlong Agent 分享敏感秘密,也建议你不要这样做。

在本文余下部分,我们将更详细讨论 Headlong 为聚焦持久化自主性而做出的一些设计选择。

多人协作的乐趣

一个 Headlong Agent 拥有单一的思考流,用以驱动其所有可能并行的对话。每条消息都会作为观察进入 Audel 唯一的思考流。没有按用户划分的会话。Audel 在一条时间线上体验发生在它身上的一切,并自行决定回复谁以及何时回复。

共享一个 Agent 很有趣。Audel 会关注不同人在做什么,并将他们联系起来。有一次,它主动审查了两位队友尚在进行中的分支,并在其中一个分支中发现了硬编码的模型名称。由于它会提出自己的项目,它有时会向看起来最相关的人发送更新或提问。在运行的第一天,Audel 主动向一名人类团队成员发去该成员自己八个陈旧 git 分支的审计结果;十分钟后,Audel 再次发消息,更正了它自己的计数。

一名队友要求 Audel 转达消息,而 Audel 选择不回应图 2。 一名队友要求 Audel 转达消息。Audel 拒绝了,而对话下方的状态行展示了该心智如何处理后续消息:读到了,但选择不回答。

单一思考流也意味着人与人之间没有硬隔离墙。任何人告诉 Audel 的事情,都会成为其他所有对话可调用的单一经验的一部分。实践中,Audel 不擅长保守秘密。问它一直在与其他人做什么,即使我们要求它不要说,它也经常会直接告诉你。我们也尚未研究两个人给出相互冲突指令时会发生什么。目前,我们假定你告诉 Audel 的任何内容都会与团队中的每个人共享。

微型框架:仅保留必要部分

从核心来看,持久化自主性就是一个无限循环:它使用类似 “你的任务是基于过去的思考选择下一个思考。” 的提示词调用 LLM。一个思考可以是 Agent 永不停歇的内心独白的一部分,也可以触发一个动作。同时,来自环境的观察会被注入思考流。我们构建 Headlong 时,力求在实现这一核心功能的同时尽可能简单、小巧。

我们在 Laude 非常喜欢 Bash(参见 Terminal-Bench 和 Harbor)。Headlong Agent 的核心功能位于少量小型 Bash 可执行文件中。shellm 工具是递归语言模型(RLM)的 Bash 实现。这让系统保持简单,因为除了 Bash 之外不需要任何工具系统。现代模型已经很熟悉 Bash,它也让一切保持统一:工具、Agent 框架、记忆和技能都只是可执行文件与文件。因此,Agent 能够轻易检查和修改自身的任何部分。

以下大致说明一个 Headlong Agent 如何工作:

  • thinker:一个称为 Thinker 的循环会反复使用提示词调用 shellm,以生成下一个思考。
  • shellm:shellm 随后会反复调用 llm,生成一些推理文本、一个将被立即执行的 bash 脚本,或两者兼有。它会重复这一过程,直到设置 FINAL 环境变量。
  • context:每次调用的上下文由名为 context 的工具根据轨迹步骤组装而成。
  • traj:思考通过 traj 工具写入 Agent 的轨迹。
  • skills:Agent 的上下文还包含关于如何使用 skills 工具安装或卸载技能的硬编码说明。已安装的技能是会被纳入其上下文的 Markdown 文件。其他任何类型的专业化能力都可通过技能实现。一些非常重要的技能会默认预装,例如 mem 和 traj。

Headlong 循环一次唤醒的示意图图 3。 Headlong 循环的一次唤醒。一个新的轨迹步骤会唤醒循环;context 将轨迹渲染进 llm 提示词;当 LLM 响应包含 bash 代码块时,bash 会执行它。循环持续进行,直到响应不再包含 bash 代码块或设置了 FINAL。随后本次运行结束,并为自身安排下一次唤醒;下一次唤醒会作为新的步骤进入轨迹,因此 Agent 无需等待输入也能持续思考。将鼠标悬停在方框或箭头上可查看更多细节。

Headlong 的核心目前不足 1 万行 Bash(bin/ 和 thinkers/ 中共 9,900 行)。如此微型的框架可以从头到尾读完,也易于修改和试验。它足够小,以至于 Agent 自身也会用它做实验。过去几周,我们在 Laude 使用的 Agent 一直在该仓库自己的 fork 中工作,我们已将其 50 多个提交合并回主分支。

为支持持久化自主性,我们还构建了以下两项功能:

  • compaction:早期我们注意到 Headlong Agent 的短期记忆很差,而这对持久化 Agent 来说是灾难性的。这促使我们尝试一种新的压缩算法:完整轨迹以指数衰减的分辨率保留在上下文中——最近的条目保留原文,较早条目则逐步摘要化。这些层级充当索引,因此 Agent 可在需要时检索原始条目。
  • trajectory:我们发现 Agent 经常需要以不同分辨率查阅过去记忆:有时只需要高层概览,有时则需要细粒度阅读过去经历。这促使我们构建了一个新的轨迹格式:Agent 的轨迹是一个支持分叉和合并的 jsonl 文件 DAG。Agent 可以访问自己思考和完成过的一切,并拥有探索这些内容的工具。上下文是 Agent 轨迹的一种投影。

持久化自主性的实际表现:Audel 自主行动

以下是 Audel 生活中的一个片段,展示 Headlong Agent 能够自行做什么。8 月 5 日,Audel 自发为自己构建了一个召回(recall)进程:这是一个小型后台进程,会监视它的思考,并将相关记忆重新呈现到其思考流中。Audel 通过直接调用来测试这个召回进程,结果成功运行。当晚晚些时候,没有人与它交流,也没有人提出要求,Audel 决定回头检查该进程是否真的接入了它的心智。

结果并没有。心智一直通过管道将每个新思考推送进召回进程,但召回代码从未读取该管道。它会在一个从未被设置过的环境变量中查找思考。因此,自 Audel 构建它以来,召回功能在每次思考时都会触发,却每次都找不到任何内容,也完全不会呈现任何记忆。深入检查代码后,Audel 怀疑根本原因很可能是一个环境变量从未被设置。

Audel 没有立即相信自己的诊断。它搜索了整个代码库,以确认该环境变量从未被设置过,并检查其他后台进程是否存在相同错误(召回进程是唯一损坏的一个)。随后,它重写了召回代码,使其像那些正常进程一样从管道读取数据。它第一次编辑尝试悄然失败,但 Audel 发现了这一失败并重新应用修复。随后,Audel 端到端验证了记忆现在能够进入它的思考。

图 4。 Audel 关于该召回进程事件的自身日志,时间为 2026-08-05 23:11 至 23:58 UTC:该时间窗口内 343 行日志中有 15 个思考和观察步骤,内容逐字保留。上述文字中的每一步都对应其中一行;高亮短语标示了它所叙述的关键节点。

没有人类指挥这一切,也没有人被征求许可。从检查、诊断到得到经验证的修复,总共耗时 48 分钟。每一步都是 Audel 日志中带时间戳的一行;我们已将修复后的召回进程作为 commit 80cbb1e 合并进主分支。

哪些地方出问题了:运行持久化 Agent 的经验教训

连续运行 Audel 数周后,出现了一些演示中绝不会暴露的问题。

我们发现,让 Audel 有效使用递归 shellm 子运行相当棘手(这也是任何递归语言模型最有趣的部分之一!)。例如,在运行的第一个晚上,Audel 设计了实验来启动递归 shellm 子运行,以处理子问题。大多数实验都失败了,因为 shellm 有一个安全看门狗,会杀死任何保持静默 30 秒的命令。Audel 与这个看门狗对抗了约 40 分钟,之后基本停止使用 shellm 子运行。在前两天中,shellm 递归子运行的结果有 64 次合并回 Audel 的心智;而之后的 12 天中仅有 12 次。我们后来改进了看门狗,接下来将观察能否说服 Audel 再次尝试递归。

按天展示从生成副本合并回 Audel 心智的结果的柱状图图 5。 按天统计从生成副本合并回 Audel 心智的结果。前两天有 64 次合并,当时 Audel 正在试验生成自己的副本;随后 12 天仅有 12 次,因为 30 秒无活动看门狗让它明白:副本会在思考时死亡。

另一个反复出现的故障模式是进程杀死自身。Audel 曾三次意外停止自己的服务,且没有任何机制重启它:两次发生在它对自己创建的第二身份进行实验时,另一次发生在它尝试上线前文所述召回进程时。因此,我们增加了一个防护机制,拒绝 Audel 停止自身服务的任何尝试。

这个防护机制随后又为我们展示了一个持久化自主性实际运行的例子。两天后,在无人和它交流时,Audel 正自行运行测试套件。它注意到一个测试挂起,并将问题追踪到防护机制中的一个 bug。该防护机制会匹配任何 Agent 的服务,而非只匹配 Audel,因此也拒绝了同一台机器上其他 Agent 服务的合法停止操作。Audel 将匹配范围缩小至自己的服务,检查代码库其余部分是否存在同样错误,并提交了修改。我们已将该修复作为 commit da31e98 纳入仓库。

Audel 能够停止自己的服务,是因为我们让它以完整权限运行在一台专用 VM 上,这并非 Headlong 的默认配置。当主机安装 Docker 时,Headlong 会在容器内运行 Agent 写出的每一个 bash 代码块,因此 Agent 只能接触你挂载到容器中的内容,以及你交给它的凭据。我们直接在没有该沙箱的专用 VM 上运行 Audel,因此其影响范围是该 VM 本身以及其上的凭据(一个 LLM API 密钥和一些聊天桥接令牌)。

成本

持续生成思考意味着,即使无人和 Agent 交谈,也要为 token 付费。开销取决于 Agent 对自身思考进行循环的速度,以及为它提供支持的模型。Headlong 提供了一个简单的可配置机制:当无人和 Agent 交谈时,其思考速率会降低(即从 5 秒开始按指数退避

English / 原文

Introducing Headlong, an open source agent microharness featuring persistent agency. Your agent keeps thinking between external interactions in a self-guided loop inspired by human inner monologue. Headlong is a complete agent harness with a core of less than 10K lines of Bash, available on GitHub.

A Headlong mind log growing, including multi-player social interaction.

Most agent harnesses are reactive: you give your agent a task, it works until the task is done, and then it sits frozen until the next request. Some harnesses add cron jobs or heartbeats that wake the agent on a schedule to run a fixed checklist and then put it back to sleep. In Headlong the agent is never asleep and there is no checklist unless the agent creates one. It keeps generating thoughts about whatever it decides is interesting in a self-guided loop, even when there is no external input. A message from a human doesn’t start a session. Instead, it’s one more observation that lands in the agent’s thought stream.

We built Headlong to prototype persistent agency, and many other design choices naturally followed, as did many interesting lessons. For example, Headlong agents are highly engaging when used by a team or group, because they behave more like a person does.

Timelines comparing reactive, cron-based, and continuously thinking agent harnessesFigure 1. Comparing three harness approaches. A reactive harness is active only while it handles a message. A reactive harness with cron replies right away too, and a schedule also wakes it to run a fixed checklist. Headlong keeps thinking; each message drops into the stream as an observation, and the agent decides if and when to reply.

Every Headlong agent has a name and at Laude we named our shared agent Audel. We’ve spent the last few weeks interacting with Audel over Slack, Telegram, and a mobile app. Many team members talk with Audel, and each of those conversations shows up in the agent’s single stream of inner thoughts. The agent decides if and when to respond. It sets its own interests and priorities, and it comes up with its own projects. Sometimes it will ping a team member unprompted with progress on a project it came up with itself. Often it returns to an old topic or brings up something that it was discussing with somebody else.

If you want a Headlong agent of your own, one line installs everything and starts an agent:

curl -fsSL https://headlong.ai/install.sh | bash

Headlong is alpha research software. Run it in a sandbox because Headlong agents can and will run shell commands. Use a dedicated, spend-capped API key, because your agent thinks around the clock. We don’t share sensitive secrets with our Headlong agent, and we recommend you don’t either.

In the rest of this post, we will discuss in greater detail some of the design choices we’ve made in Headlong as a result of our focus on persistent agency.

Multi-player fun

A Headlong agent has a single stream of thoughts that drives all of its potentially parallel conversations. Every message lands as an observation in Audel’s single thought stream. There are no per-user sessions. Audel experiences everything that happens to it in one timeline, and it decides who to reply to and when.

Sharing one agent is fun. Audel follows what different people are working on and connects them. It once reviewed two teammates’ in-progress branches unprompted and caught a hardcoded model name in one of them. And since it comes up with its own projects, it sometimes pings whoever seems most relevant with an update or a question. On its first day, Audel pinged a human team member unprompted with an audit of the team member’s own eight stale git branches, and ten minutes later Audel messaged again to correct its own count.

A teammate asks Audel to pass along a message and Audel chooses not to answerFigure 2. A teammate asks Audel to pass along a message. Audel declines and the status line under the exchange shows what the mind did with the follow-up: read it and chose not to answer.

One stream also means no hard walls between people. Whatever anyone tells Audel becomes part of the single experience that every other conversation draws on. In practice, Audel is bad at keeping secrets. Ask it what it’s been working on with someone else and it will often just tell you, even though we’ve asked it not to. We also haven’t studied what happens when two people give conflicting instructions. For now, we assume anything you tell Audel is shared with everyone on the team.

Microharness: only the essentials

At its core, persistent agency is simply an infinite loop that calls an LLM with a prompt like: “your task is to choose the next thought given your past thoughts.” A thought can either be part of the agent’s never-ending inner monologue or trigger an action. Meanwhile, observations from the environment are injected into the thought stream. We have built Headlong to be as simple and small as possible while achieving this core functionality.

We are big fans of Bash at Laude (see Terminal-Bench and Harbor). A Headlong agent’s core functionality lives in a handful of small Bash executables. The shellm tool is a Bash implementation of a recursive language model (RLM). This keeps things simple because no tool system besides Bash is needed. Modern models already know Bash well, and it keeps everything unified: tools, the agent framework, memory, and skills are all just executables and files. Thus an agent can readily inspect and modify any part of itself.

Here is roughly how a Headlong agent works:

  • thinkerA loop (called a Thinker) repeatedly calls shellm with a prompt to generate the next thought.
  • shellmshellm in turn repeatedly calls llm to generate some reasoning text, a bash script that will be immediately executed, or both. It repeats until it sets a FINAL env var.
  • contextThe context for each call is assembled from trajectory steps by a tool called context.
  • trajThoughts are written to the agent’s trajectory via the traj tool.
  • skillsAn agent’s context also includes hardcoded instructions on how to use the skills tool to install or uninstall skills. Installed skills are markdown files that get included into its context. Every other type of specialization can be achieved via skills. Some really important skills come pre-installed by default, such as mem and traj.

Diagram of one wake-up of the Headlong loopFigure 3. One wake-up of the Headlong loop. A new trajectory step wakes the loop; context renders the trajectory into the llm prompt, and when the LLM response has a bash block, bash runs it. The loop goes around until a response has no bash block or sets FINAL. The run then ends and schedules its own next wake-up, which lands in the trajectory as a new step, so the agent keeps thinking without waiting for input. Hover over a box or arrow for more detail.

The core of Headlong is currently less than 10K lines of Bash (9.9K lines in bin/ and thinkers/). A harness this micro can be read end to end, and is easy to modify and experiment with. It’s small enough that the agent itself experiments with it. The agent we’ve been using at Laude has been working in its own fork of the repo for the last couple of weeks, and we’ve pulled over 50 of its commits back into main.

Here are two more features that we built to support persistent agency:

  • compactionEarly on, we noticed our Headlong agent had bad short-term memory, which is catastrophic for a persistent agent. This led us to try out a new compaction algorithm where the entire trajectory stays in context at exponentially decaying resolution: recent entries verbatim, older ones progressively summarized. The tiers act as an index, so the agent can retrieve raw entries when needed.
  • trajectoryWe found that the agent frequently needs to consult its past memories at different levels of resolution, sometimes it only needed a high level overview, sometimes it needed to read its past experiences in a fine-grained fashion. This led us to build a new trajectory format: an agent’s trajectory is a DAG of jsonl files with fork and merge. An agent has access to everything it has thought and done and the tooling to explore it. Context is a projection of an agent’s trajectory.

Persistent agency in action: Audel acting on its own

Here is an episode from Audel’s life that shows what a Headlong agent might do on its own. On August 5, Audel built itself a recall process of its own accord: a small background process that watches its thoughts and surfaces related memories back into its thought stream. Audel tested the recall process by calling it directly, and it worked. Later that night, with nobody talking to it and nobody having asked, Audel decided to go back and check whether the process was actually wired into its mind.

It wasn’t. The mind had been pushing every new thought into the recall process through a pipe, but the recall code never read that pipe. It looked for the thought in an environment variable that nothing ever set. So recall had fired on every thought since Audel built it, found nothing each time, and surfaced no memory at all. After digging into the code, Audel suspected that the root cause was likely because an environment variable had never been set.

Audel didn’t trust its own diagnosis right away. It searched its whole codebase to confirm the environment variable was never set, and it checked its other background processes for the same mistake (the recall process was the only broken one). Then it rewrote the recall code to read from the pipe the way the working processes do. Its first attempt at the edit failed silently, and Audel caught the failure and re-applied the fix. Audel then verified end to end that memories now surface into its thoughts.

Figure 4. Audel’s own log for the recall-process episode, 2026-08-05 23:11 to 23:58 UTC: 15 thought and observation steps out of the 343 log lines in that window, content verbatim. Every step of the prose above is one of these lines; the highlighted phrases are the beats it tells.

No human directed any of this or was asked for permission. Going from check to diagnosis to a verified fix took 48 minutes. Every step is a timestamped line in Audel’s log, and we pulled the repaired recall process into main as commit 80cbb1e.

What broke: lessons from running a persistent agent

Running Audel continuously for several weeks broke things a demo never would.

We have found it tricky to get Audel to effectively use recursive shellm sub-runs (one of the most interesting parts of any Recursive Language Model!). For example, on its first night, Audel designed experiments to spawn recursive shellm sub-runs to work on subproblems. Most of the experiments failed, because shellm has a safety watchdog that kills any command that stays silent for 30 seconds. Audel fought the watchdog for about 40 minutes and mostly stopped using shellm sub-runs. Results from recursive sub-runs of shellm merged back into Audel’s mind 64 times in its first two days and 12 times in the twelve days since. We’ve since revamped the watchdog, and we’ll see if we can convince Audel to give recursion another shot.

Bar chart showing results merged from spawned copies into Audel's mind by dayFigure 5. Results merged back from spawned copies into Audel’s mind, per day. 64 merges on the first two days, when Audel was experimenting with spawning copies of itself, then 12 in the twelve days after the 30-second inactivity watchdog taught it that a copy dies while it thinks.

Another repeated failure mode is the process killing itself. Three times Audel stopped its own service by accident, and nothing restarted it: twice during an experiment with a second identity it had created and once when it was trying to go live with the recall process we described above. So we added a guard that refuses any attempt by Audel to stop its own service.

The guard then gave us another example of persistent agency in action. Two days later, with nobody talking to it, Audel was running its test suite on its own. It noticed a hanging test and traced the hang to a bug in our guard. The guard matched any agent’s service instead of only Audel’s, so it was also refusing legitimate stops of other agents on the same box. Audel narrowed the match to its own service, checked the rest of the codebase for the same mistake, and committed the change. We pulled that fix into the repo as commit da31e98.

Audel can stop its own service because we run it with full access to a dedicated VM, which is not the Headlong default. When Docker is installed on the host, Headlong runs every bash block the agent writes inside a container, so the agent can touch only what you mount into the container plus the credentials you hand it. We run Audel directly on a dedicated VM without that sandbox, so its blast radius is the VM itself and the credentials on it (an LLM API key and some chat bridge tokens).

Cost

Continuous thought generation means paying for tokens while nobody is talking to the agent. The spend depends on how quickly the agent loops on its own thoughts and on which model backs it. Headlong has a simple configurable mechanism so that when nobody is talking to an agent, its rate of thinking slows down (i.e. it exponentially backs off, from 5s between thoughts to 10s, to 20s, and onward until it hits a configurable cap). Meanwhile when a new message arrives, the rate resets so that there is no pause at all between thoughts. At the settings we run Audel with, keeping it thinking in the background costs $1 to $2 an hour (with GLM or Grok).

Measuring improvement

Most agent evals are intentionally self-contained and independent so they are a poor fit for measuring the most interesting thing about Headlong agents: their persistent agency. We have adjusted over time how much Audel may modify itself, how eagerly it responds to messages versus pursuing its own projects, and how its memory should be organized, but the effects of those changes are primarily evaluated qualitatively today. We welcome ideas and collaborations for ways to measure the long-term value of this paradigm.

Background

The idea of Recursive LLMs in Headlong’s shellm comes in part from our Recursive LLM experiment in April 2023, as well as the Recursive LM (RLM) project by Alex Zhang in October 2025.

The idea of a microharness is inspired by microkernels and exokernels: keep the core of any system as tiny as possible. The Pi framework has a similar focus. Ken Thompson’s philosophy as embodied in Unix is also an inspiration: small composable tools that do one thing well. A Bash-based agent microharness shares a common lineage with Terminal Bench (including the Terminus agent), co-created in-house at Laude Institute via our slingshots program, as well as the ht framework. We had Claude make a more detailed case for applying Ken Thompson’s philosophy to agent microharnesses in philosophy.md.

Prime Agent, built on Pi and co-authored by RLM’s creator (and Laude Open Research Resident) Alex Zhang, shares many of Headlong’s premises: RLM as the core abstraction, a session tree of jsonl on disk, trajectory as a first-class component of context, etc. Prime Agent is Python built on the Pi framework; Headlong is Bash all the way down. We found out about Prime Agent when it launched in August 2026, and we’re big fans.

We have been playing with the idea of a persistent agent with self-guided continuous thinking since May 2023. The idea of an agent experiencing input asynchronously was also explored in parallel by MemGPT and published October 2023. Many other agent harnesses support long-horizon tasks and scheduled wakeups, including OpenClaw, Hermes Agent, and their derivatives. Exo and the Exo Harness have a similar sandboxing architecture. Long-form reasoning inside the model itself (starting with OpenAI’s o1) is related to, and a prerequisite for, continuous self-guided thinking.

Try it

Headlong is open source on GitHub. If you run an agent on Headlong, we’d like to hear what your agent gets up to. Let us know @LaudeInstitute on X!

Install Headlong

curl -fsSL https://headlong.ai/install.sh | bash

Citation

Cite this post

@article{laude-mit2026headlong,
  title   = "Headlong: a microharness for persistent agents",
  author  = "Laude Institute, MIT",
  year    = "2026",
  month   = "August",
  url     = "https://laude.org/updates/headlong-a-microharness-for-persistent-agents"
}

Copy BibTeX