Key Takeaways

  • Yohei Nakajima built BabyAGI Inside by embedding an agent control loop directly into Qwen weights, replacing external Python orchestrators with compiled circuits.
  • The architecture stacks Divyansh Agrawal's Qwenputer with Vishal Baraiya's qwenFS file system to manage state, memory, and scheduling inside the model itself.
  • The system runs a bounded loop that creates tasks, writes ledger entries, executes reasoning steps, and terminates only when the internal circuit emits a HALT token.
  • On a 2B parameter Qwen model, the compiled controller successfully divided and solved multi-step arithmetic like (2 + 3) * 4, proving that stateful execution works without an outer runtime.
  • Scaling this approach beyond toy math requires compiling into models larger than 2B parameters, where the base network possesses enough reasoning capacity to perform complex actions.

Compiling State Machines into Neural Weights

Most agent architectures depend on an external loop. A Python program sends a prompt, inspects the JSON payload, appends the response to a message history array, and calls the model again. If the runtime crashes, the agent stops. Nakajima decided to test whether that external scaffolding could be removed entirely.

To build BabyAGI Inside, Nakajima combined two experimental projects: Divyansh Agrawal's Qwenputer, which compiles deterministic compute into transformer weights, and Vishal Baraiya's qwenFS, which acts as a virtual file system inside the network. By merging these systems, Nakajima created a network that handles its own state transitions. The external code has only one job: feed the prompt and wait.

As Nakajima explained, “The circuit spits out halt. And the Python code just triggers the model with input and then it's just looking for the halt token.” (play from 11:57) Between that first trigger and the termination token, every decision about reading tasks, prioritizing work, and storing state occurs within the forward passes of the model itself.

The Bounded Loop and the 2B Arithmetic Ceiling

BabyAGI Inside does not run indefinitely. Instead, it operates within strict computational boundaries. Nakajima configured the controller to run a fixed sequence of iterations, ensuring that the model does not wander into infinite generation loops.

“It's bounded. It's like X number of loops,” (play from 10:45) Nakajima said. “It's bounded. It's not fully unbounded. But yes, it's basically a controller that calls Qwen when it's time for Qwen to do a task or read a task.” (play from 10:48) The internal controller forces the model to generate a task list, log ledger updates through qwenFS, execute the current objective, and advance the counter.

The primary constraint of the experiment was the base model size. Running on a 2B parameter Qwen checkpoint, the network could execute the control flow reliably, but lacked the raw intelligence for open-ended software tasks. Nakajima observed that “the only thing it did really right was this short arithmetic thing where you're like here take two, add three, multiply by four. But split it into tasks and do them one at a time.” (play from 12:26)

The architecture functions properly, but the underlying model scale creates a hard ceiling. As Nakajima noted, “the whole point was to prove that a controller loop could live inside the weights. The 2 billion model is not good enough to run an agent. So now I need to scale it up to stronger models for it to actually be an agent.” (play from 12:43)

What to Do With This

Audit your agent stack for loops that simply shuffle state between an LLM and a database. If your external code spends cycles parsing JSON schemas just to decide which prompt to send next, experiment with hardcoding deterministic circuits into the system prompt or embedding them into smaller specialized fine-tunes. Run a test where your orchestrator does nothing except pass raw tokens until an explicit terminal token triggers an exit.