---
title: "How to build an agent factory: the loop, stage by stage"
url: "https://kyberagent.com/blog/building-an-agent-factory"
description: "An agent factory is the old development cycle closed into a loop. Each of its eight stages, why it is there, what breaks without it, and which to build first."
---

# How to build an agent factory: the loop, stage by stage

November 6, 2026·8 min read·Editorial team

Eight small rounded compute modules joined by short cables into a closed ring, four of them with a push button on top, and a larger coordinator unit standing in the middle of the ring

An agent factory is not a faster version of the old development cycle. It is the same cycle closed into a loop, where every stage leaves a record and the person moves from doing the work to three decision points: approving the plan, confirming the check and agreeing to the release. Everything in between, the swarm prepares. Copy the old process one to one with an agent where the developer used to be, and you get more output, not a better product.

## The old cycle in one paragraph

The classic software development lifecycle (SDLC) is a relay race. Someone gathers requirements, someone designs, someone writes, a second person reviews, a tester tests, an administrator deploys, somebody watches the dashboards. Between each pair there is a hand-over: a document, a ticket, a word in the corridor. Knowledge of why something was done this way lives mostly in heads.

“Who remembers why the shop rounds tax per line and not per invoice?” The person who remembered left in the spring.

That model worked because the scarcest resource was a developer’s time, and hand-overs were the price of people working together. In a factory, execution becomes the cheapest resource and a person’s attention the dearest. That turns the logic of the cycle around.

## The loop in eight stages

```
1 intake -> 2 triage -> 3 plan -> 4 execution -> 5 review
                        [person]                    |
                        approves                    v
8 monitoring <- 7 release <------------- 6 verification
     |           [person]                  [person]
     |           agrees                    confirms
     +--> back to 1
```

Above the loop sits a coordinator. In KyberAgent that is the planner: it takes the trigger, decides which stage the work is at, writes the next items into the to-do list and starts the right sub-agent with the right model and context. A small model for sorting. A stronger one for planning. For review, whichever did best on your own test jobs. How a planner and its sub-agents divide the work is in [anatomy of a deep agent](https://kyberagent.com/blog/anatomy-of-a-deep-agent).

The example below is a change to a small online shop, but the same eight stages carry an invoice or a campaign.

### 1\. Intake: work arrives through one door

A bug report, a request from KyberBot, an alert from monitoring: all of it lands in one queue.

**Why it matters.** A factory with six entrances does not know what is on its table, so it cannot measure throughput or cost.

**Without it.** Half the agent work happens off the loop, on laptops, with no record and no numbers.

### 2\. Triage: the cheapest saving in the whole loop

An agent reads the request, tries to reproduce it and puts it in one of three bins: _ready_ (a clear, small fault), _unclear, needs a plan_ (a feature, a request with several readings), or _parked, needs a person_ (missing data, a business decision).

**Why it matters.** In the old cycle, sorting and first diagnosis eat the hours of the most experienced people. Here they receive work already sorted, and small, well-described faults go straight to execution.

**Without it.** The executing agent receives a vague job and produces a lot of the wrong thing.

### 3\. Plan: where the quality of the loop is decided

For unclear work the planner writes two things into files: what the customer will see and do from start to finish, and how the change fits the code that exists. A person reads both, corrects them and approves before a single sub-agent starts.

**Why it matters.** This is the checkpoint with the most leverage. Fixing a sentence in a plan takes a minute. Fixing the same decision inside a finished change takes a day. In the old cycle a person reviewed finished code. In a factory they review intent.

**Without it.** Review turns into archaeology: reading code to guess what the agent meant, and finding it meant something else.

### 4\. Execution: the least interesting stage

Sub-agents take items from the plan, one each, with a fresh context. Each works in its own [KyberCell](https://kyberagent.com/blog/kybercell-explained), with only the files and tools its item needs and the network closed unless a rule opens it.

**Why it matters.** Less than people think. If intake, triage and the plan work, execution is the most predictable part of the loop. Everyone wants to start here because this is where output is visible. That is the mistake.

**If you start only here.** You get a fast agent writing changes for requests nobody sorted or described, and people spend their time rejecting work instead of approving it.

### 5\. Review: the stage that teaches itself

A reviewer agent reads every change before a person does. It works in its own cell with the code, so before it suggests a fix it can run the fix. It has the approved plan in front of it, so it judges the change against the intent, not only the style. When reviewer and author disagree, the swarm settles it by rules set out in [two agents disagree](https://kyberagent.com/blog/two-agents-disagree).

A second, slower loop sits beside it. Another agent collects the comments people leave in review and, every so often, proposes a change to the reviewer’s skill. That proposal is an ordinary change a person accepts or rejects.

**Why it matters.** Team conventions do not have to be written up front in a document nobody reads. They accumulate in the reviewer’s skill, one comment at a time.

**Without it.** A person gets raw output and repeats the same five comments every week.

### 6\. Verification: the person confirms instead of investigating

An agent starts the shop in a cell and walks the customer’s path from start to finish, the way a tester would. Screenshots and the trajectory of every step are attached to the change, and the result is compared with the plan it started from.

**Why it matters.** Automated tests check what someone foresaw. A live walk-through catches what nobody did: a button hidden behind a banner, a form that works but cannot be filled in on a phone. The person’s job changes too. Instead of reproducing the change, they look at two minutes of evidence and say yes or no. Why that evidence must be written by the cell and not by the agent is in [every step on the record](https://kyberagent.com/blog/every-step-on-the-record).

**Without it.** The last step before release depends again on someone having time to click through the shop by hand.

### 7\. Release: the decision that stays with a person

A person accepts the change and puts it live. In KyberAgent this is one of the moments the swarm stops and KyberBot asks.

**Why it matters.** Release is when the risk moves from the team to the customers. Somebody has to sign for that. The agent prepares, checks and suggests. A person decides and answers for it.

### 8\. Monitoring: the loop closes

An agent watches the live shop, catches failures and odd behaviour, and opens a new request that goes back to stage one. A whole pass without a person until approval looks like this: monitoring spots a failure, triage reproduces it, a sub-agent prepares the fix, review and verification check it, and in the morning someone finds a finished change with evidence attached.

**Why it matters.** Without this stage the factory is an assembly line. With it, the product reports what needs fixing.

## The second loop: a factory that improves the factory

Above the product loop runs a quieter one. An observer reads the record of every run: what it cost, how often a person had to correct something, whether the change came back later as a fault. From that it proposes changes to the factory itself: a different model at triage, a clearer skill for planning, a tighter budget for a stage that keeps overrunning. Budgets and when a swarm should stop are covered in [when a swarm should stop](https://kyberagent.com/blog/when-a-swarm-should-stop), and the set points that slow a swarm down in [an agent that regulates itself](https://kyberagent.com/blog/an-agent-that-regulates-itself).

To make this safe, the factory’s definition must be code: versioned, with a way to undo a bad change, try a new version on part of the work and compare results on a fixed set of test jobs. A change to the factory travels the same path as a change to the product: proposal, review, a person’s approval. A factory that rewrites its own instructions without anyone’s consent will, in a few months, be doing things nobody understands.

## The old cycle and the factory, side by side

Dimension

Old development cycle

Agent factory

Shape

a relay: linear hand-overs between people

a loop: monitoring feeds new requests

Where the person looks

at finished code

at the plan before the work, at the evidence after it

Scarcest resource

a developer’s time

a person’s attention at decision points

Team knowledge

in heads and an outdated wiki

in skills, versioned with the code

Testing

tests written up front, plus clicking through by hand

tests, plus a recorded walk-through compared with the plan

Improving the process

a retrospective once a sprint

every run graded, changes to the factory proposed

Work in progress

private, on someone’s machine

visible to the team, in the factory’s queue

Who answers for a release

a person

still a person

The last row matters most. Requirements, architecture, approving the plan and deciding to release stay with people. What changes is everything in between.

## Where a factory does harm

**Automating jobs that only look simple.** “Bump the library version” sounds like work for an agent, until the new version changes how rounding works in the invoice module. Start with work where a mistake is cheap and shows at once: small interface faults, obvious failures, updates that change no behaviour.

**Skipping the plan because the swarm writes fast.** Fast output without an approved plan is the most expensive way to discover that everyone understood the job differently.

**Self-improvement without a brake.** A change to the factory without a person’s approval is drift, not progress.

**A factory without people.** Tell a team the factory is there to replace them and they will leave before it works. The people who like hard system problems usually take to building a factory fastest, if it comes as more responsibility rather than as a verdict.

## How to tell the factory works

Vanity metric

Outcome metric

lines of code written by agents

how many times a person touched one change from request to release (it should fall)

tokens used

cost of one closed change, and its trend month to month

agents started

share of requests that went through the loop with no correction after approval

“agents write most of our code”

lead time for changes, deployment frequency, change failure rate and time to restore service (the four DORA measures)

A second model grading the output can help, but only as a supplement. If corrections after release are rising, no grade from a model covers that up.

## Where to start: the order of building

Every step leaves a working system. You can stop after any of them and still have something that pays its way.

1.  **Triage.** An agent sorts incoming requests into three bins and prepares a first change for small, well-described faults. People stop losing hours on labels and estimates.
2.  **Plans.** For unclear work the planner writes what the customer sees and how the change fits, and a person approves before execution. Larger work enters the factory instead of waiting.
3.  **Review with a learning loop.** A reviewer in its own cell reads every change; a second agent turns people’s comments into proposed changes to the reviewer’s skill.
4.  **Live verification.** An agent walks the customer’s path, records the evidence and compares the result with the plan. A person confirms instead of investigating.
5.  **Join and measure.** The planner links the stages, monitoring feeds intake, the observer grades runs. Only now does the second loop start.

The same order works outside software. “Bank export, sorting, a rule for each kind of mismatch, matching, review, a check of the numbers, booking, watching next month” is the same factory for invoices, as argued in [agent factories will not stay in software](https://kyberagent.com/blog/agent-factories-beyond-software). Where the skills, records and data of such a factory should live is the subject of [whose agent factory is it](https://kyberagent.com/blog/who-owns-your-agent-factory).

KyberAgent is pre-launch. In the design it covers the planner, the sub-agents, the cells and the record; the intake and the approvals run through KyberBot. Nothing here is released yet.

On Monday, do one thing. Take the last twenty requests from wherever your team keeps them and, by hand in a spreadsheet, put each one in a triage bin. If more than half land in “unclear”, the first agent in your factory should not be the one that writes changes. It should be the one that writes plans.

That leaves a decision. You can give your team an agent that produces faster and watch the review queue grow. Or you can build a loop in which people stop writing and checking everything, and start approving the things that actually need their judgement.

-   agent factory
-   SDLC
-   swarm
-   planner
-   review
-   verification

## Keep reading

-   [Same swarm, different walls: what ARTEX teaches about agents](https://kyberagent.com/blog/same-swarm-different-walls-what-artex-teaches)
-   [Whose agent factory is it, if it runs at a vendor?](https://kyberagent.com/blog/who-owns-your-agent-factory)