ULUAI agents beehive

How to build an AI software factory, or get one ready-made in ULU

· 15 min read · by EndorphinLab, the makers of ULU

To build an AI software factory, split the way you already work into stages, give each stage one agent with a defined input and output, put approval gates in the workflow itself, and log every run. Then use those logs to improve one thing at a time. The agents are the easy part. Knowing whether a change made them better is the hard part, and it is the reason to build a factory at all. If you would rather use one than build one, ULU gives you a ready AI software factory on your own computer; both routes are below.

  • A software factory has two jobs: to make agent work visible and controlled, and to make it improvable.
  • You need five components: a runner, a store, an orchestrator, traces and a context layer. The last is the hardest.
  • A pull request is not the finish line. Run the software, try to break it, and show a person the evidence.
  • Four good results in five runs tell you very little: the true success rate could be anywhere from about 38% to 96%.
  • If you work alone, you can skip the infrastructure: ULU runs an AI agent team locally, with the cost of every step in view.

What an AI software factory does

An AI software factory is a platform that runs AI agents through a defined software workflow, records what they do, and lets you change that workflow based on the record. If the idea itself is new to you, start with what an AI software factory is. This article is about building one.

The popular picture is a black box: a ticket goes in, finished software comes out, nobody looks inside. That is a poor design goal. Somebody still has to decide what is worth building, and somebody has to notice when the box is wrong. A useful factory is the opposite of a black box.

It does two things that a coding agent on each person's laptop cannot do well:

  • Governance. One place decides which agents, skills and tools are in use, what each may reach, and where a person must approve.
  • Improvement. Every run leaves a record, so you can see which instructions work, which send agents in circles, and what each result cost. Fix one skill and the fix reaches everybody.

Build it yourself, or use ULU

ULU is an AI software factory for your own computer: a desktop app for Claude Code. You describe a project in plain words, and it sets up the AI agents, the order, the approvals and the records. Choose by what you want to own.

Building an AI software factory compared with using ULU
You needBuild it yourselfULU
AI agents and their rolesWrite and maintain the prompts and skillsTen ready teams, or one designed from your description
Order and approvalsBuild an orchestrator and gatesA fixed flow that stops for you on the design and the release
Tokens and costAdd tracing and a dashboardCost, time and context in view at every step
Project memoryBuild a context layerULU Brain, included
AI modelAny you connectYour own Claude plan or API key
Central control for many teamsYes, if you build itNo, it runs on your computer

To get the factory without building the infrastructure, install ULU. See ULU prices.

Do you need a custom AI software factory?

Often not. If your current workflow does the job and you are the only person using it, moving it to the cloud gives you the same results plus servers to look after. Have an answer to "why?" before you start.

Which setup fits which situation
Your situationStart withMove on when
One person, one projectA coding agent on your computer, a written spec and testsYou keep repeating the same steps by hand
One person, several projectsA local AI agent team such as ULU, with fixed stages and a cost recordWork has to run when your computer is off
A small teamShared skills and agents in version control, shared checksNobody can say which version of a skill works better
Many teamsA central factory with identities, gates and tracesIt is already the right size; grow the measuring

How to build an AI software factory in seven steps

1. Write down the workflow you already trust

Do not invent a new process for the agents. Write the one that works today as a graph: what starts it, what each stage receives, what it hands on, and where it can be sent back. A common line is triage, specification, plan, build, review, test, deploy and watch.

2. Make the specification the contract

Whatever you leave out, an agent will fill in, usually with something average. So let one agent question the specification before another builds from it: what is missing, what contradicts itself, what happens when something fails?

The same document pays you back at the end. A reviewing agent can compare the result with it and ask three questions: was everything built, was anything built that nobody asked for, and was each point tested? Without a written intention, a review can only say whether the code looks reasonable.

3. Give each stage one agent, one input, one output

The simplest stage is a coding agent started without a window, with a prompt and some input files, that writes a result and stops. That is enough for a first version. Keep the shape of the output fixed, so you can later swap the prompt, the model or the whole agent and compare. How the roles divide the work is covered in AI agent teams explained.

4. Put the gates in the workflow, not in the prompt

"Please wait for approval" is a request, and an agent can miss it. A gate is different: the orchestrator does not start the next stage until a person has said yes, so there is no path around it. Treat tests, linters and permission limits the same way. A rule the system enforces is worth more than a rule the agent is asked to remember.

Use few gates and put them where a mistake is expensive: the specification, the design, the release. A person asked to approve everything soon reads nothing.

5. Log everything from the first run

You cannot go back and record what you did not keep. For each stage, save:

  • the input, the output and the version of the prompt and skills used;
  • the model, the tokens, the cost and the time;
  • every tool call, with its errors and retries;
  • the test results, and what the person at the gate decided and why.

Keep secrets and personal data out of the traces, and decide who may read them. A complete log of everything is also a complete leak of everything.

6. Let agents read the logs and people judge them

Nobody reads thousands of traces. An agent can. It can notice that a stage calls the same tool wrongly three times before it gets it right, and flag it. Often the repair is a single line in an instruction file that says how the tool is used.

Keep the decision with a person. The agent points at what looks wrong; you decide whether it is. Check some of its verdicts by hand too, because an AI judge can be confidently mistaken.

7. Change one thing and run it again

Because the inputs are saved, you can run the same tasks through two versions of a workflow and compare. This is where a factory ends arguments. A favourite skill, a fashionable method, a bigger model: each either improves the results or it does not.

The five components of an AI software factory

Most of a software factory is ordinary platform engineering, and the same few parts do several jobs.

Software factory architecture: what each component does and how to start
ComponentWhat it doesSimple first version
RunnerStarts an agent in isolation, stops it, restarts it when it failsOne container per stage
StoreHolds agents, skills, policies, inputs and outputs, with versionsA git repository and an object store
OrchestratorMoves work along the graph and holds it at gatesA durable job queue with a state per task
Traces and metricsRecords what happened, what it cost and how it endedOpenTelemetry and one dashboard
Context layerGives each agent the code and knowledge its task needsA clean checkout and plain text search

A basic version is a small project. The integrations around it are not: repository access, chat, tickets, an identity for each agent. Expect those to take longer than the agents did.

The context layer is the hard one

Give an agent too little and it guesses. Give it too much and it pays for every word on every call. Start with files and search, and add a graph or search by meaning only when your traces show agents failing to find things. When we ran our own agents with a project memory on and off, it helped on some questions and saved nothing on others. The numbers are in how to save tokens with AI coding agents.

The pull request is not the output

If agents write code faster than people can read it, a factory that ends at a pull request only moves the queue. The output should be working software with evidence attached. Three kinds of evidence help most.

Run it and try to break it

Tests written by the agent that wrote the code can share its misunderstandings. So start the application somewhere safe and attack it: bad input, missing permissions, heavy load, a lost connection. Turn every failure you find into a script that runs each time. Measure response time and memory as well as correctness, so a change that makes a page half as fast is caught before release.

Show it

An agent that can operate a browser can click through a new feature and record it. Half a minute of video tells a person more about a screen than a long diff does. For a service with no screen, show the requests, the replies and the measurements.

Watch it after release

A change can pass every check and still be wrong for users. Release it to a small share first, watch the errors and the usage that belong to that change, and send what you learn back to triage.

None of this makes code review pointless. Security, payments, data migrations and architecture still deserve a careful reader. The evidence lets that reader spend time where it counts.

How many runs before you can trust a result?

More than most people think. Suppose a skill works in four runs out of five. Is its failure rate 20%? You cannot tell. The table gives the 95% range for the true success rate (Wilson interval) when you observe 80%.

What an observed 80% success rate tells you at different sample sizes
RunsSuccessesThe true rate is plausibly between
5438% and 96%
504067% and 89%
50040076% and 83%

This is the strongest argument for a shared factory. One developer rarely repeats a task often enough to separate a better skill from a lucky week. Until you have the volume, trust only large differences, and repeat the same task instead of comparing different ones.

AI software factory metrics

  • Cost per accepted change, not cost per run. A cheap run that gets rejected is not cheap.
  • First-pass rate: how often a stage's work is accepted without being sent back.
  • Retries and loops per stage, which point at unclear instructions.
  • Escaped defects: problems found after release.
  • Human minutes per change, the number a factory is meant to bring down.

For what tokens, context and limits mean for the bill, read what AI agents cost.

Keep AI code quality from sliding

When agents keep building on code that agents wrote, quality can fall a little with each change. SlopCodeBench, a benchmark in which 15 coding agents repeatedly extended their own work, found structural erosion rising in 77% of the sequences and verbosity in 75.5%. Asking for quality in the prompt gave a cleaner start, but did not slow the decline.

The study tested prompts, not a factory with enforced rules, so it does not prove that gates solve the problem. It does show that asking is not enough. Reasonable defences are limits on complexity and duplication that fail the build, architecture decided by a person and written into the specification, and regular work whose only purpose is to simplify.

AI models, tokens and cost

Tokens are the running cost of an AI software factory, and most of them are not your code. In one of our own team runs, about 95% of the tokens were the same instructions sent again on every call. Keep agent instructions short, and let the model read them from cache instead of writing them again: a token sent for the first time cost us about 40 times a cached one.

Newer models do by themselves some of what used to need careful scaffolding, and a tight set of rules can even get in the way of a strong model. Retest your harness when you change models, and remove what no longer helps. Keep what protects you: permissions, gates and tests.

Smaller and open models are a different case. They gain more from structure, and for a narrow stage such as triage one may be good enough at a lower price. Your traces can answer that: run the same saved tasks on both and compare the cost per accepted change. Before buying hardware to run your own models, rent it, measure, and include the cost of keeping it busy and maintained.

Who does what

A factory separates two kinds of work. Product engineers use it: they decide what to build, write the specification and judge the result. Factory engineers build and tune it: stages, context, checks, models. One person can do both. What neither can hand over is the judgment about what is worth making and whether the result is any good.

What you get with ULU

ULU is a desktop app for Claude Code, built for people who do not want to assemble these parts. It covers the local end of this article:

  • Stages. You describe a project and get a team of agents that plan, design, build, review, test, secure and release in a fixed order.
  • Gates. Every team stops for your approval on the design and on the release.
  • Records. The cost, time, files and context of every step are in view, and test counts are shown per suite.
  • Context. ULU Brain keeps a project memory of the code, its tests and its history.
  • Improvement. When a run ends, the team reports what went well and what it would change in its agents and skills. You choose what to keep.

It is not a central platform for an organization: it runs on your computer, and it does not replay saved tasks through rival workflows or manage agent identities across teams. If you need those, you need the larger build described above. A local team is still a good way to find out which stages and gates suit you first.

Questions people ask

Should an AI software factory run locally or in the cloud?

Start locally if you work alone. Move to the cloud when several people share it, when runs must continue without your computer, or when you need one place for permissions and records. The workflow can stay the same.

How long does it take to build an AI software factory?

Someone comfortable with containers can have a simple line of agents running in a weekend. Integrations, context, evaluation and access control take much longer and keep changing, so plan for a platform you maintain and not a project you finish.

What is the difference between an AI software factory and an AI agent loop?

A loop is one agent working toward a goal, with checks that send it back until it passes. A software factory runs many such loops as stages, with shared control, gates and records, so the loops themselves can be compared and improved.

Can an AI software factory run without people?

For routine, well-tested changes it can come close. For new products, people still define the intention and accept the result. Remove a gate only when your own records show that it no longer catches anything.

Is an AI software factory only for software?

No. The same stages, gates and traces can run research, documentation or reporting. Software is simply a good place to begin, because so much of the result can be tested automatically.

Run your AI software factory today

Building your own makes sense when many teams share it. For your own projects, ULU gives you the AI agents, the approvals, the memory and the cost of every step without the infrastructure. Install ULU, describe what you want to build, and watch the factory work.

Summarize with AI

Ask your assistant to read this article and tell you what matters for you.