AI Engineering

Building a Software Factory with AI Agents: What a Real Initiative Taught Us

What we learned building BeLoop: how AI agents plan, review and deliver real software across two codebases, where the workflow broke, and how we fixed it.

Last updated 9 min readBy Anas Nafees

An AI assistant can write a working function before you finish your coffee. What it cannot do on its own is the rest of the job: agree the plan with you first, have someone else check the work, run the real tests, and leave a record of who approved what.

That gap is why we built BeLoop at Sofyrus. It is a software factory: AI coding agents work through the same stages a good team does, they review each other, and a person approves every step before the next one starts.

This post is not a product tour. It is what we learned running a real initiative through it, including the parts that broke.

What we mean by a software factory

A software factory turns one request into delivered, checked code through a fixed process, the same way every time. The agents do the typing. The process decides what counts as done.

A chat window gives you an answer. A factory gives you a trail:

What a team needsAI chat on its ownBeLoop
Knows your codebaseWhat you paste inIndexed, every answer cites the file and lines
A plan agreed before codeUp to youA spec, design and task plan you approve
Independent reviewThe model checks its own workOther agents review, each with one focus
Tests that actually ranIts word for itBeLoop runs your build and tests itself
Several codebases at onceOne chat at a timeInitiatives with contracts between repositories
Who approved whatLost in chat historyRecorded for every stage

BeLoop does not replace Claude Code, Codex, Antigravity or OpenCode. It uses them, through the accounts your team already has, and puts them in one process.

The test: a national health integration across two codebases

We did not test BeLoop on a to-do app. We gave it real work on NeoHealthCare, our healthcare platform: a country plugin system, starting with India's ABDM (Ayushman Bharat Digital Mission), switchable per tenant and working end to end.

The work spans two codebases: neoweb, the web app, and neobackend, a set of NestJS microservices. The request went in as one paragraph, written the way you would explain it to a colleague.

What came out of planning, before any code was written:

OutputWhat it held
Clarification14 questions, each asked only because the answer changes the work, each with a suggested answer
DesignBuilt on facts read from the real code, with file paths and line numbers
Breakdown10 epics, each assigned to neoweb or neobackend
Contracts6 API contracts between the web app and the backend
Acceptance16 criteria, each traced to the epics that prove it
PrototypesA clickable mock of the new screens; one epic alone has 11 screens and states

One line from the design shows why grounding matters. It notes that an existing appointment endpoint returns a ForbiddenException object instead of throwing one, so a new hook must fire only when the branch check passed. A model guessing from patterns would miss that. An agent that read the file did not.

How the factory runs

Every piece of work moves through the same stages. A bug fix skips the design stages; an initiative gets them all.

Eight-stage BeLoop workflow from request and clarification through design, build, review, testing and approval
Eight-stage BeLoop workflow from request and clarification through design, build, review, testing and approval

One request moves through a reviewed, tested delivery trail.

What stood out on the ABDM run:

  • Questions first. Agents ask only what changes the outcome, and suggest an answer you can accept with one click.
  • Reviewed before you see it. Each spec and design goes to fresh reviewers at once, each with one focus: coverage, testability, clarity, fit with the code, risk. On one ABDM screen design the reviewer raised 15 findings, and the author answered every one before it reached us.
  • Screens before code. The UI/UX stage builds a clickable prototype of every screen and state. You point at the exact element you want changed and comment on it.
  • Work that keeps moving. When one agent hit its usage limit, its task moved to the next agent assigned to that job, with no one stepping in.
  • Proof, not promises. BeLoop runs the project's own build and tests itself. An agent saying “it passes” counts for nothing.

What broke, and what we built so it cannot strand work again

A demo runs once, on a good day. Real work runs for days, through restarts, expired logins and usage limits. Running ABDM for real showed us where BeLoop was fragile. Each problem became a fix with a test.

Watchdog recovery loop moving failed agent work from the last good commit to the next agent and tested delivery
Watchdog recovery loop moving failed agent work from the last good commit to the next agent and tested delivery

BeLoop resumes failed work from the last good commit and escalates after three attempts.

What happenedWhat BeLoop does now
Claude Code's login expired mid-buildThe work moved to another agent within seconds; the person signs in again when convenient
An agent went silent for 20 minutesA quiet-turn guard ends the silent turn and hands the task to the next agent
Quitting BeLoop to install an update counted as a failure; three quits blocked three epicsA clean quit hands work back to the queue without counting; only a crash counts
A retry resumed after a restart mistook its own progress for the person stepping in, and stoppedA watchdog checks every minute that anything marked working really has a job running, and restarts it from the last good commit
A killed git process left a lock file that blocked a workspaceLocks older than two minutes, held by nothing, are cleared and the command retried
Problems were hard to diagnose after the factOne log for everything: every action and who took it, errors with their stack, agent sessions, kept 30 days

The watchdog has a limit. A stage that keeps breaking three times in an hour is handed to a person with a clear reason, instead of being retried forever. Recovery should never hide a real problem.

What comes next: a factory for regulated industries

Healthcare taught us that “the tests pass” is not enough. Teams in health, finance and enterprise software also need proof that the code is safe and compliant before it ships. The next layers, in the order we plan to build them:

  1. A security gate before delivery: secret scanning, known vulnerabilities in dependencies, and code scanning, with fixes queued as normal work.
  2. Compliance profiles for SOC 2, HIPAA and PCI DSS, checked on the code itself, with an evidence pack for every release. Evidence for an auditor, not a certificate.
  3. Doubt reviews on the build: reviewers who hunt for missed edge cases, failure paths and race conditions in what was built.
  4. Team coding rules, written once and checked on every change.
  5. Duplicate and single-responsibility checks when work from several epics merges.

After those comes a shared domain language: a glossary per part of the business, so people and agents mean the same thing by “account” or “policy”.

Questions people ask us

What is a software factory?

A fixed process that turns a request into reviewed, tested, delivered code. In BeLoop, AI agents do the work at each stage and a person approves every stage before the next starts.

Does BeLoop replace Claude Code or Codex?

No. BeLoop runs the coding agents you already use, Claude Code, Codex, Antigravity and OpenCode, through your own accounts. It never reads or stores their logins.

Can it work on an existing codebase?

Yes. That is its main use. You pick a connected repository or a folder and the branch to start from. BeLoop works on its own copy, on its own branch, and delivers a pull request.

What is an initiative?

A goal that spans several codebases, such as a web app and its backend. BeLoop plans it once, agrees the contracts between the repositories, then splits it into epics for each one.

How do agents check each other?

A spec or design goes to fresh reviewers at the same time, each looking for one kind of problem, such as test coverage or security risk. The author must answer every finding before the stage reaches you.

What happens when an agent hits its usage limit?

The work moves to the next agent assigned to that job, and comes back when the limit resets.

Where does our code go?

BeLoop runs on your own computer, with its own database. Agents never push or deploy. You merge what you approved.

About the author

Anas Nafees builds BeLoop at Sofyrus Technologies: the lifecycle engine, the multi-agent orchestration and the self-repair that keeps long-running work moving. He spends his days running real initiatives through it and fixing what they expose.

LinkedIn · Website

Want to see BeLoop on your own codebase? Talk to Sofyrus.

Keep reading

Explore more insights from Sofyrus on product engineering, AI delivery, and enterprise technology.