商业产业 Hacker News AI 2026-10-06T06:49 正文 ok 1226 words

🔶 Autolith:可自我修改的通用 Lisp AI Agent

英文标题:🔶 Autolith: A self-modifiable general purpose Lisp AI agent

Autolith(AL)是运行在实时 Common Lisp 镜像中的终端 AI Agent,能够观察、内省并在线修改自身代码和状态,同时通过世代、检查点与恢复镜像降低自修改风险。它支持 Linux、macOS、多个 BSD 发行版及 Windows,并可通过独立二进制包、Nix 或源码方式运行。其输入窗口本质上是 Lisp REPL,开发者既可用自然语言发出提示,也可直接执行精确的 Common Lisp 表达式、调用工具和管理子 Agent。Autolith 还提供隔离 Lisp REPL、RLM 大上下文推理、可追溯推理记录及会话保险库等机制,为需要可编程、可自省 Agent 的开发者提供了不同于传统终端 Agent 的工作方式。
打开原文相关 3 · 机会 1
media210.1 KB media46.6 KB

中文

docs/autolith-banner.png

Autolith,或称 AL,是一个运行在实时 Common Lisp 镜像中的终端 Agent。它能够观察、自我修改、发现并内省自己的代码、实时状态以及正在执行的工作。这使 Autolith 可以适应用户偏好或任务所需的条件。听起来或许不稳定,但 Autolith 会创建可由你或它自身回滚到的镜像世代。即使进行彻底的“额叶切除术”也不会让系统无法恢复:AL 会重新加载到恢复镜像,诊断问题,并可选择修复问题。

Autolith 对良好的人体工学、视觉体验、遵循 XDG 标准等方面有适度关注,同时尽量减少侵入性。它并不是一个“小型游戏引擎”,但已经相当接近一台 Lisp Machine。

Autolith 支持以下平台:

  • Linux(x86_64 + aarch64)
  • macOS(x86_64 + aarch64)
  • FreeBSD(x86_64)
  • NetBSD(x86_64)
  • OpenBSD(x86_64)
  • Windows(x86_64),通过源码检出运行

始终欢迎加入更多平台支持!

有关 Autolith 的问题与议题可在 Lambda Symbolics Zulip 上讨论。账户确认邮件很可能会进入垃圾邮件箱。

Autolith 通过独立二进制发行包和 Nix 支持 Linux、macOS 及 BSD 系统。Windows 可从源码检出运行,使用 script\bootstrap.ps1 和 bin\autolith.cmd;详见指南。

通过 curl 管道传入 shell 的安装程序会为你的平台安装或更新打包发行版。在将其管道传入 shell 前,请先检查安装脚本,或者把生命托付给我们,嘿嘿。

curl -fsSL https://sh.lambda-symbolics.com/autolith | sh

Nix 同时提供完整运行时:

nix run github:lambda-symbolics/autolith

如需改为从源码检出构建,请遵循指南中的“Source checkout”章节。

可通过网页流程或 API 密钥验证服务提供商:

autolith auth chatgpt
autolith auth gemini
autolith auth grok
autolith auth nous
autolith auth anthropic
autolith auth fireworks
autolith auth opencode
autolith auth openrouter
autolith auth mistral

然后启动 Autolith:

可选的全屏终端

Autolith 默认以内联方式运行。可使用 autolith --fullscreen 在由应用程序拥有的全屏视口中启动一个会话,或者在 Autolith 提示符中保存这一偏好,以便未来启动时沿用:

(preferences-set-fullscreen (application-configuration *active-application*) t)

全屏模式会保持对话记录可滚动,并将编辑区固定在底部。使用 PageUp、PageDown、Ctrl-Home、Ctrl-End 或鼠标滚轮在对话记录中移动。空会话会在编辑区上方显示居中的 Lisp Machine 启动面板。

提示输入框就是 REPL

在 Autolith 中,消息窗口就是一个具备常见交互能力的 LISP REPL。你可以使用普通自然语言编写提示,也可以在需要精确本地操作或计算式提示时输入一个表达式。

(describe 'application)
(resource.read :uri "workspace:.")
(prompt (read-file "review-notes.org"))

表达式会在活动镜像中运行。

用于自我修改和临时 Lisp REPL 的工具

Autolith 提供了一套组织完善的 self 工具,可用于实时检查和修改其自身。你可能认为对自己进行实时脑部手术会带来灾难性后果,但 Autolith 能够分类处理并回滚变更。

类似的一组 lisp 工具使 Autolith 无需散落大量临时 Python3 脚本,而是在其内置的 Common Lisp 运行时中完成这些工作;不过这些操作运行在干净、且与 Agent 镜像隔离的 REPL 中。这不仅减少了一项系统依赖,也让 Autolith 能够更好地观察自己的脚本。

Autolith 可以决定是保持同一个 Lisp REPL 存活,还是创建一个全新的 REPL,并且能够维护多个 REPL。

(lisp.eval :forms '("(+ 20 22)") :repl "scratch")
(lisp.describe :designator "APPLICATION" :target "self")
(self.status)

lisp.* 使用具备堆隔离的具名 SBCL worker,并且可以显式针对只读的活动检查。self.* 会修改或报告活动的 Autolith 镜像。

Autolith 可以将大型输入视为环境而不是提示。infer 会针对你显式传入的上下文运行一次受限推理,返回一个 Lisp 值,并且绝不会触碰你的对话:

(infer "List the invariants this file maintains."
       :context (list #p"src/conversation/store.lisp"))

Frame 可以递归执行,通过 rlm-map 扇出,并且当你提供 JSON Schema 契约时,返回经过验证的数据而非自然语言。调用次数、token 数和递归深度均来自同一共享预算,因此扇出操作无法超出其预算;私有 Frame 对话也不会污染你的对话或提示缓存。

rlm-complete 是完整形式:输入会被存储为内容寻址对象,根模型只能看到它的标签、大小和摘要;然后根模型会在隔离环境中编写 Lisp,以便对输入进行切片、搜索和子推理。超过服务提供商上下文窗口的输入会以这种方式处理。

(rlm-complete "Summarize every incident in this log."
              :context #p"/var/log/huge.log")

模型通过 rlm.infer、rlm.map 和 rlm.complete 工具访问相同的操作。每个 Frame 都会在 data/inferences/ 下持久化保存自己的追踪记录,之后可通过 inference:<trace-id> URI 读取,因此你仍可以追问某次推理为何得出相应结论。

有关契约、预算、策略及设计决策,请参阅 RLM。

消息只是语法糖

当你输入类似以下的消息:

Hello Autolith! How do you do?

它只是以下形式的语法糖:

(prompt "Hello Autolith! how do you do?")

这省略了 :to 参数的默认值:

(prompt :to 'autolith "Hello Autolith! how do you do?")

因此,如果你要求 Autolith 委派工作(在大多数模型下,它很可能会自行这么做),它可以在子 Agent 运行时继续工作,而你也可以与这些子 Agent 对话。如果有一个可见子 Agent 名为 test-review,你可以通过向它发送提示来引导该子 Agent:

(prompt :to 'test-review
        "Run the focused tests and report only failures.")

为方便起见,它下一条有用的自然语言回复会返回主终端。

如果你希望拉取更新,可以轻松完成:

或者在 shell 中执行 autolith update。

Autolith 与其他 Agent 的差异

纯文本、可调用命令、工具和显式 Common Lisp 共同使用 Autolith 的 REPL(或者,按其他 Agent 的叫法,是提示窗口/输入框)。这意味着你可以轻松构建脚本,也可以像 clanker 一样调用工具。

精确的表达式可以计算提示或返回结果,模型将能够看到这些结果。

例如,如果你将提示写入文件,只需执行:

(prompt (read-file "path"))

如果愿意,你也可以进行模板化处理。

响应迅速且不打扰终端的工作方式

Autolith 默认采用内联展示,通常使用终端的基础 16 色。使用 --fullscreen 可启用由应用程序拥有的对话记录视口。

内联模式会输出提示标记,因此支持 shell 提示导航的终端也可以在发送给 Autolith 的消息之间跳转。

行编辑器采用功能相当强大的 clinedi,应能支持你习惯使用的各种编辑便利功能和快捷键。

对话采用只追加、可读的文件存储。

引导消息和后续消息会保存在按对话划分的保险库中,即使活动镜像崩溃或系统突然关闭也不会丢失。该保险库(有意设计为)不会被自动重新提交,因为你可能希望在恢复先前工作前先诊断崩溃原因。

你可以使用以下命令与保险库交互:

(vault)         ; 查看 vault 里有什么
(vault-restore) ; 重新提交 vault 中的后续消息和引导消息
(vault-discard) ; 删除 vault 内容

最后,检查点、私有变更提交、世代和一个干净的恢复镜像使实时工作可被重建,因此要彻底“切除”AL 的大脑并不容易。

Autolith 采用 ISC 许可证。参见 LICENSE。

English / 原文

docs/autolith-banner.png

Autolith, or AL, is a terminal agent inside a live Common Lisp image. It can observe, self-modify, discover, introspect its own code, its live state and what it’s doing. This lets Autolith adapt to the user’s preferences or to what is needed for the task. This may sound unstable, but Autolith creates generations of this image your or it can rollback to. Even a full frontal lobotomy is not a showstopper as AL will just reload into a recovery image and diagnose and optionally fix the issue.

Autolith has a moderate focus on good ergonomics, good visuals, following XDG standards and similar, and minimal intrusiveness. It is not a “small game engine”, but it is pretty close to a Lisp Machine.

Autolith supports the following platforms

  • Linux (x86_64 + aarch64)
  • MacOS (x86_64 + aarch64)
  • FreeBSD (x86_64)
  • NetBSD (x86_64)
  • OpenBSD (x86_64)
  • Windows (x86_64), from a source checkout

Adding more platform support is always welcome!

Autolith questions and issues can be discussed on the Lambda Symbolics Zulip. Account confirmation emails are likely to land in spam.

Autolith supports Linux, MacOS and the BSDs via standalone binary releases and Nix. Windows runs from a source checkout through script\bootstrap.ps1 and bin\autolith.cmd; see the guide.

The curl-into-sh installer installs or updates the packaged release for your platform. Inspect the installer script before piping it into a shell, or trust us with your life, hehe.

curl -fsSL https://sh.lambda-symbolics.com/autolith | sh

Nix also supplies the complete runtime:

nix run github:lambda-symbolics/autolith

To build from a source checkout instead, follow the guide’s Source checkout section.

Authenticate providers either with web flows or API keys:

autolith auth chatgpt
autolith auth gemini
autolith auth grok
autolith auth nous
autolith auth anthropic
autolith auth fireworks
autolith auth opencode
autolith auth openrouter
autolith auth mistral

Then start Autolith:

Optional fullscreen terminal

Autolith is inline by default. Start one session in the application-owned fullscreen viewport with autolith --fullscreen, or save the preference at the Autolith prompt for future launches:

(preferences-set-fullscreen (application-configuration *active-application*) t)

Fullscreen keeps the transcript scrollable and pins the composer at the bottom. Use PageUp, PageDown, Ctrl-Home, Ctrl-End, or the mouse wheel to move through the transcript. An empty session displays a centered Lisp-machine startup panel above the composer.

The prompt input is the REPL

In Autolith, the message window is just a LISP repl with familiar interactivity, you can make prompts in regular prose, or you can enter a form when you need an exact local action or a computed prompt.

(describe 'application)
(resource.read :uri "workspace:.")
(prompt (read-file "review-notes.org"))

The form runs in the active image.

Tools for self modification and ephemeral Lisp REPLs

Autolith has a well organized suite of self tools for inspecting and modifying itself live. You would think that doing live brain surgery on yourself would be catastrophic, but Autolith can triage and revert changes.

Similar set of lisp tools let Autolith avoid littering temporary Python3 scripts, instead doing these things in its bundled Common Lisp runtime, but in REPLs that are pristine and separate from the agent’s image. That’s one less system dependency, and it also lets Autolith observe its scripts better.

Autolith can decide if it wants to keep the same Lisp REPL alive or to create a pristine one, and can maintain multiple.

(lisp.eval :forms '("(+ 20 22)") :repl "scratch")
(lisp.describe :designator "APPLICATION" :target "self")
(self.status)

lisp.* uses named, heap-isolated SBCL workers and can target read-only active inspection explicitly. self.* changes or reports the active Autolith image.

Autolith can treat a large input as an environment instead of a prompt. infer runs one bounded inference over context you pass explicitly, returns a Lisp value, and never touches your conversation:

(infer "List the invariants this file maintains."
       :context (list #p"src/conversation/store.lisp"))

Frames recurse, fan out through rlm-map, and return validated data instead of prose when you give them a JSON Schema contract. Calls, tokens, and recursion depth come out of one shared budget, so a fan-out cannot outspend its allocation, and the private frame conversations cannot pollute yours or your prompt cache.

rlm-complete is the full form: the input is interned as a content-addressed object, the root model sees only its label, size, and digest, and it writes Lisp in an isolated environment to slice, search and sub-infer over it. Inputs larger than the provider context window are processed this way.

(rlm-complete "Summarize every incident in this log."
              :context #p"/var/log/huge.log")

The model reaches the same operations through the rlm.infer, rlm.map and rlm.complete tools. Every frame persists its own trace under data/inferences/, readable afterwards through inference:<trace-id> URIs, so you can still ask why an inference concluded what it did.

See RLM for contracts, budgets, policies and the design decisions.

Messages are just syntax sugar

When you type a message like:

Hello Autolith! How do you do?

It is just syntactic sugar for:

(prompt "Hello Autolith! how do you do?")

This omits the default value for the :to parameter:

(prompt :to 'autolith "Hello Autolith! how do you do?")

So if you ask Autolith to delegate work (it is likely to do it on its own with mostmodels), so it can keep working while the children run, you can talk to them as well. If one visible child is named test-review, you steer the sub-agent by prompting it:

(prompt :to 'test-review
        "Run the focused tests and report only failures.")

As a convenience, its next useful verbal response returns to the primary terminal.

If you want to pull an update, you can do so easily:

Or do autolith update in your shell.

Autolith differences from other agents

Plain text, callable commands, tools, and explicit Common Lisp share Autolith’s REPL (or prompt window/input, as you may know it from other agents). This means that you can construct scripts easily, and you can call tools just like the clanker does it.

Exact forms can compute prompts or return results, and the model will see them.

For example, if you put your prompt to a file, you can just do:

(prompt (read-file "path"))

You could do templating, too, if you like.

Responsive and inobtrusive terminal work

Autolith defaults to inline presentation and generally uses your terminal’s base 16 colors. Use --fullscreen for an application-owned transcript viewport.

Inline mode emits prompt markers, so terminals with shell-prompt navigation can also jump between messages to Autolith.

The line editor is the fairly powerful clinedi, it should support all the editing niceties and shortcuts you are used to.

Conversations use append-only readable files.

Steering messages and follow-ups survive active-image crashes and abrupt shutdowns in a conversation-scoped vault. The vault is (intentionally) not resubmitted automatically, since you may want to diagnose a crash before you resume your previous work.

You can use the following commands to interact with the vault:

(vault)         ; see what's in da vault
(vault-restore) ; re-submit follow-ups and steering messages in the vault
(vault-discard) ; delete vault contents

Finally, checkpoints, private mutation commits, generations, and a pristine recovery image keep live work reconstructible, so it’s hard to terminally lobotomize AL.

Autolith is ISC licensed. See LICENSE.