Blog

Building a Software Factory

Abstract

Everybody in the AI / developer world is talking about software factories. But what is a software factory—and where can I get one? Are loop engineering and graph engineering earlier names for the same thing, or only parts of it?

This article follows that progression of ideas, compares the choices hidden behind the same label, and lays out a practical path toward a software factory of your own.

Back in March 2026, Andrej Karpathy kicked off the hype around loop engineering with his post on automatically optimizing training with nanochat. This loop, named autoresearch, conducted a series of experiments. In autoresearch each iteration creates a hypothesis, implements it, and validates it experimentally. If that experiment shows an improvement the change is kept, otherwise it is thrown out and the next iteration begins.

Karpathy’s loop describes one tight feedback cycle: form a hypothesis, implement it, measure the result, and keep or discard the change. Graph engineering widens that view. Instead of one agent session returning to its own next iteration, several sessions can work on separate pieces, pass results to one another, and wait on dependencies.

That is a useful description of an agent workflow, but not a new discovery: humans have always split work into dependent pieces. The new term mainly draws attention to the connections between agent sessions.

Software factory changes the question again. It is less concerned with the shape of those connections than with the outcome: can this combination of agents, tools, and checks produce software repeatedly, with a useful degree of automation? In that sense, a software factory is a facility for building software with AI—not one prescribed architecture. Of course, there were software factories before AI, but now everything is about AI.

This definition is so vague that everybody has its own software factory: firstmate, pstack, Uncle Bob’s swarmforge, Steve Yegge’s gastown, gascity, software-factory, all those propietery setups of the large AI companies, and many more. Github currently has ca. 3,500 repositories that match to the search term "software factory".

What they all have in common is the purpose: to build software with AI. Most combine some version of four layers:

  • A work ledger: issue tracking, acceptance criteria, and a place to record what an agent did and what remains open.
  • An execution environment: agent sessions, supervisors, worktrees or other source-code clones, and sometimes sandboxing.
  • Coordination and visibility: inter-agent communication, starting and stopping agents, watchdogs, and a terminal, desktop, web, or mobile UI for following their work.
  • Quality and delivery gates: tests, linters, test environments, automated review, and possibly automatic merging.

The category names are less important than the choices inside them. A factory that lets a human talk to every agent needs different coordination from one that routes work through a supervisor. A factory that merges automatically needs stronger verification than one that always waits for a maintainer.

Those choices are usually fixed, and often implicit, in existing implementations:

  • humans interact only with one agent vs human interacts with any agent that requires feedback
  • always merge automatically vs. never merge automatically
  • trunk-based development vs. releases
  • always refactor based on CRAP metrics or code coverage

These two lists show the size of the design space for software factories. Therefore, it is not surprising that there are so many different software factory projects on Github. In the end, you have to build your own software factory. It might be tempting to take one of those existing projects as a starting point, and sometimes that might even be right. But in general I believe it is better to use the existing projects only as inspiration for how they handle a specific aspect. By all means, try out any software factory you can find, find out where it is positioned in the design space. How it integrates the different aspects mentioned above. But it is unlikely that you find exactly the right match.

Instead, it is prudent to start small and progress towards a software factory in multiple steps.

  1. Make the work explicit and small

    The goal of this step is to craft issues that enable agents to work without being babysitted most of the time. To achieve that use a durable issue ledger that is agent accessible. I.e. Github issues with a github cli that agents can use. Alternatively, you can use a local alternative like beads. It syncs through a separate git remote, but keeps most interactions local. Focus on clear acceptance criteria and issues that are small enough to review. stage architecture and product decisions should stay with you.

  2. Use multiple agents and give each agent an isolated workspace

    At this stage, we start using multiple agents in parallel and for that to be successful each agent needs its own working copy of the source. Git worktrees are a natural fit to get cheap copies of the whole source code. When multiple copies of the software under development run, conflicting usage of ports becomes a problem. That can be solved if needed, by putting the whole worktree and agent into a container, or by setting up container stack with a different network name per environment.

    With some experience with multiple agents, a solution to keep an overview over all the agents starts to become a necessity. The classical solution are terminal multiplexer likes screen or tmux. But its modern, agent-aware, counter-parts are often a much better fit, e.g. herdr, rex, cmux.

  3. Automate cheap checks before expensive ones

    In order to further progress towards a software factory, you should invest in the developer / agent experience. Introduce, if they aren’t there already: code formatters, linters, additional type checking, static analysis, more extensive test coverage, code metrics with targets to stay under, etc. They can be executed by your agents, at will. But some of them should be integrated into the agent harness using agent hooks, or into version control using git hooks. Every tool that is automatically called at the right time, reduces the token spend. But only, if agents know they don’t have to call them, and if the output of these hooks is minimal on success. All these tools have been a development best-practices for some time, although there are still many projects that lack them.

    Beyond existing best practices, setup integration and E2E test suites, setup a browser the agent can drive to access the app. If you are not developing a web app build a setup in which the agent can interact with the system under development, that might be a virtual desktop to interact with a desktop app, some tooling to interact with a network daemon, a virtual terminal to interact with cli command, a VM to interact with a new operating system, whatever you are developing.

    Before you progress to the next stage, start to require evidence of a successfull test of each implemented feature. An agent could take screenshots, record videos, show network traces, record terminal interactions, show logs, whatever fits. But that evidence should be attached to the issue it is working on.

  4. Introduce a review/verification loop

    Now with the extensive verification tooling in place, we can introduce a review loop. When an implementer agent declares its work done, a separate reviewer should get the full repository or source code or branch and the original ticket and investigate the evidence presented by the implementer as well as review the source code. Any review feedback returns to the implementer with a hard limit on the number of loop iterations.

  5. Only then automate routing and merging

    Finally, we have everything in place to delegate work automatically and to merge automatically — sometimes. When hard limit of the review limit has been reached, you should be informed to take over the review. In other cases the merge can happen automatically unless you want to introduce a classifier step that estimates the blast radius of this change.

With all this in place, you start to have a software factory. You also got a glimpse on the number of design decisions involved. Usually, large numbers of details to handle are a reason to look for a ready-made solution, but in this case — I believe — the options depend so much on your development process, your project, your requirements. Therefore, installing something ready-made is not going to cut it. At least without extensive customization.