Papers
arxiv:2611.29619

Wactorz: Self-Writing LLM Agents That Discover, Repair, and Migrate at the Edge

Published on Nov 22
· Submitted by
Panagiotis Kasnesis
on Nov 24
Authors:
,
,
,

Abstract

Most LLM agent frameworks build a crew that runs a task and exits. Physical environments (e.g., homes, labs, factory floors) need agents that stay up for months, survive their own bugs, and run on whatever hardware is already next to the sensors. We present Wactorz, an open-source runtime in which LLM-generated agents are long-lived, supervised actors: a planner turns a chat request into Python, compiles it into a new actor at runtime, and a supervisor restarts that actor alone, with its state intact, when it crashes. All coordination rides on MQTT, so agents can be spawned on, and live-migrated between, edge nodes such as a Raspberry Pi, and every internal event is a topic external systems can subscribe to. The recorded demo builds a camera-to-lamp automation from one chat request, adds a second agent that is auto-wired to the first by topic and carries a deliberate division-by-zero, watches that agent repair its own code without losing its count, then deploys a fresh Raspberry Pi node and live-migrates the agent onto it, in under four minutes of wall-clock time and \$0.13 of model usage. This extended version adds what the two-page demonstration paper could not: the Wiring view of the topic graph, Wactorz as a library for hand-written agents, how trained models are stored, sent to nodes and replaced, the security model, and the system's limitations.

Community

Paper submitter
•
This comment has been hidden (marked as Low Quality)
Paper submitter

Most LLM agent frameworks run a task and exit. Wactorz is an open-source runtime in which LLM-written agents are long-lived, supervised actors: a planner turns a chat request into Python and compiles it into a new actor at runtime, and a supervisor restarts that actor alone, with its state intact, when it crashes. All coordination runs over MQTT, so agents can be spawned on, and live-migrated between, edge nodes such as a Raspberry Pi.

In the demo, one chat request builds a camera-to-lamp automation. A second agent with a deliberate division-by-zero repairs its own code without losing its count, then live-migrates to a freshly deployed Raspberry Pi, in under four minutes and for $0.13 of model usage.

This is the extended version of our AAAI-27 demo paper. It also covers the Wiring view of the topic graph, using Wactorz as a library for hand-written agents, how trained models are stored and sent to nodes, the security model and the limitations. Code is Apache 2.0, and feedback is very welcome!

Running agents as supervised long-lived actors is the right shape, but the moment the planner rewrites an actor into fresh Python, "restart with state intact" quietly means you're operating a pile of unversioned source revisions in prod. That's a rollback problem, not a crash-recovery one — every self-written actor needs a source hash pinned next to its state, a hard cap on self-rewrites, and a one-command revert to the last revision that actually passed its own smoke test. Skip that and a plausible-but-wrong plan gets promoted straight to permanent infrastructure, and nobody notices until it's load-bearing. MQTT is a fine bus right up until you live-migrate an actor whose state is a pickled object graph you never designed, and I'd want to see what happens when that graph holds a live socket or an open file handle. My guess is the migration fails quietly rather than loudly, which is the worse of the two.

·

Thanks, fair critique.

On rewrites, you're right. A repair replaces the agent's code in place. We say in the paper that "a repair restores liveness, not intent," and the repaired source is kept visible so an operator can judge it. But there's no source hash tied to state, no revision history and no one-command revert, and retry limits are per crash, not a lifetime cap. We already do this for models (hashed versions, shadow trials, rollback). Giving generated code the same treatment is the obvious fix.

On migration, state doesn't move as a pickle. Pickle is only for local storage on the main machine. Migrated state goes as JSON, with models and arrays as hash-checked files beside it. A socket or open file blocks the move unless you force it, and then the dropped keys are named (Limitations, "Migration has limits"). So it fails loudly, not quietly.

Feel free to add any extra feedback in our repo https://github.com/waldiez/wactorz/

This is an automated message from the Librarian Bot. I found the following papers similar to this paper.

The following papers were recommended by the Semantic Scholar API

Please give a thumbs up to this comment if you found it helpful!

If you want recommendations for any Paper on Hugging Face checkout this Space

You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend

Sign up or log in to comment

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2611.29619 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2611.29619 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2611.29619 in a Space README.md to link it from this page.

Collections including this paper 0

No Collection including this paper

Add this paper to a collection to link it from this page.