Building a Software Factory with AI Agents and Automation Loops

software_factory · Tech · 2026 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: AI-assisted software development

The Memo team wanted a software factory where agents could plan, implement, review, repair, and monitor a product without humans manually driving each pull request.

Constraints:

Architecture

Memo's software factory centers GitHub issues and pull requests as the durable work queue. Feature-planning and feature-building automations create and implement work, a PR reviewer opens blocking GitHub conversations, agent loops resolve those conversations, a PR shepherd revisits stale or needs-human PRs, and post-merge/incident automations connect CI and Sentry back into bug reports and improvement loops.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  github-issues[GitHub Issues] --> feature-planner[Feature Planner]
  feature-planner --> feature-builder[Feature Builder]
  feature-builder --> pull-request[Pull Request]
  pull-request --> pr-reviewer[PR Reviewer]
  pr-reviewer --> agent-resolution-loop[Agent Resolution Loop]
  agent-resolution-loop --> pull-request
  pull-request --> pr-shepherd[PR Shepherd]
  pr-shepherd --> agent-resolution-loop
  agent-resolution-loop --> automation-auditor[Automation Auditor]
  sentry[Sentry] --> incident-responder[Incident Responder]
  incident-responder --> github-issues
  pull-request --> post-merge-verification[Post Merge Verification]
  post-merge-verification --> github-issues
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
GitHub Issues Durable input queue for feature requests, bugs, acceptance criteria, and backlog state. Feature Planner, Feature Builder
Feature Planner Automation that triages user-generated issues and either asks for more information or sends work onward. GitHub Issues, Feature Builder
Feature Builder Scheduled implementation automation that turns issues into pull requests. GitHub Issues, Pull Request
Pull Request Shared artifact for agent-authored code, comments, review conversations, and merge decisions. Feature Builder, PR Reviewer, PR Shepherd, Post Merge Verification
PR Reviewer Automation that checks implementation against the spec and opens blocking comments/conversations. Pull Request, Agent Resolution Loop
Agent Resolution Loop Repeated agent work that resolves reviewer comments and improves code until merge rules pass. PR Reviewer, Pull Request, Automation Auditor
PR Shepherd Hourly fail-safe that revisits stale or needs-human pull requests and fixes agent-resolvable issues. Pull Request, Agent Resolution Loop
Automation Auditor Meta-automation planned to review automations, automation runs, and redundant review steps. Agent Resolution Loop
Incident Responder Scheduled automation connected to Sentry that converts captured bugs into triage artifacts. Sentry, GitHub Issues
Sentry Production error source for client-side and server-side bugs. Incident Responder
Post Merge Verification Verification layer that checks merged code and feeds failures back into bugs or review loops. Pull Request, GitHub Issues

Data flow

A user or human creates a GitHub issue, the feature planner decides whether to request more information or hand it to the feature builder, the builder opens a pull request, the PR reviewer creates comments that must be resolved, automated loops revise the code until conversations close, and fail-safe/post-merge automations pick up stale, failed, or production-error cases.

3 supporting quotes
“the feature planner will pick up a user generated issue and either go work on it or request more information if it's, you know, a high-level feature”transcript, stated
“once the PR was opened, we triggered a review. This review created comments and conversations that based on our rule set need to be resolved before we can merge the branch.”transcript, stated
“while the conversations and the comments are not resolved, we will have our loops firing and improve the code until all the issues are fixed.”transcript, stated

Why this architecture

The architecture treats every development bottleneck as a feedback loop: agents do the routine implementation/review/fix work, humans move up to designing loops and reviewing higher-level artifacts, and redundant automations catch failures when primary loops stall.

3 supporting quotes
“you're now not in the loop, you're on the loop. You're designing the feedback loops as opposed to implementing the feedback loops.”transcript, stated
“it also creates a redundancy, right? Um, to make sure that your primary loop, while hopefully it's designed as as best as possible, uh, has a fallback”transcript, stated
“Give me the bottom line. What did this change? What did it impact? Are there any key decisions made inside of this PR?”transcript, stated

Scale

Alternatives considered (roads not taken)

Manual GitHub issue and PR handling

Rejected because: Manual work defeated the point of a software factory and could not keep up with autonomous development loops.

“you wanted to, but obviously manual work defeats the purpose here. So once the feature builder picks up, creates a push pull request”transcript, stated

Escalating every needs-human pull request directly to a person

Rejected because: The team added a PR shepherd that first checks whether the original needs-human assessment was wrong and fixes agent-resolvable issues.

“for PRs like the other one that have hit like a needs human situation, the shepherd actually reviews it on a secondary loop”transcript, stated

Line-by-line human review of all agent-generated diffs

Rejected because: The workflow moved human review toward architecture diagrams, entity diagrams, and bottom-line impact artifacts.

“You know, reviewing an entity, you know, entity diagram, reviewing sort of an architecture diagram, etc. You would talk about story book the other day.”transcript, stated

Full compliance-style multi-reviewer approval for every generated PR

Rejected because: The team described risk-classified auto-approval for low-risk changes so review effort stays focused on complex changes.

“if you touch parts of the code base that we deem to be low risk, documentation, certain parts of the code base that are non-critical or don't touch any data or things like that, that those are now actually auto-approved.”transcript, stated

Patterns

multi-agent-orchestration (agent architecture)

Separate automations handle planning, building, PR review, comment resolution, stale-PR shepherding, auditing, and incident response.

“I have Agent review, agent resolves its own comments, etc. etc. until, you know, until They they do run if you look at the automation view”transcript, stated

durable-execution (orchestration)

GitHub issues, PR conversations, labels, schedules, and stale-state checks preserve work across repeated autonomous runs.

“This means it's kind of hit a wall. It can't progress without human review.”transcript, implied
“anything that hasn't been touched in a long time, either through, for example, failed automation. This can happen as well sometimes.”transcript, stated

fallback-degradation (resilience)

The PR shepherd acts as a secondary loop when the primary review and resolution flow stalls or misclassifies an issue as requiring a human.

“to assess whether or not the initial assessment was correct and fixes any issues that the agent itself can fix.”transcript, stated

observability-tracing (operations)

Daily metrics, CI performance checks, and Sentry-connected incident response feed operational signals back into development work.

“how many uh, lines of code were written, how many PRs were merged, uh, what's our test coverage”transcript, stated
“connected to Sentry. So all the bugs that we uh, capture through Sentry go through the incident responder.”transcript, stated

human-in-the-loop-gate (governance)

The system reduces human involvement for low-risk changes while preserving human merge responsibility and escalation paths.

“the human still presses the review or sorry, presses the merge. So, they're still taking and assuming responsibility for it”transcript, stated

Tradeoffs

Development-loop ownership

Chose Humans designing and supervising feedback loops over Humans manually implementing each feature or fix.

Rationale: The team wanted humans to operate at the loop/architecture level while agents performed repeated implementation, review, and fix cycles.

“you're now not in the loop, you're on the loop. You're designing the feedback loops as opposed to implementing the feedback loops.”transcript, stated

Risk-based approval model

Chose Auto-approval for low-risk code paths with human merge accountability over Mandatory full human review for every PR.

Rationale: The approach preserves compliance and accountability while avoiding a review bottleneck for simple, non-critical changes.

“it's auto-approved, so it's unblocked, you know, because a lot of, you know, if you're running with like SOC 2 or these other compliance frameworks”transcript, stated

Redundant review loops

Chose Secondary PR shepherd review over Trusting the first automation's needs-human/stale state.

Rationale: A second loop can catch automation failures, stale branches, and wrongly escalated PRs before they stop the factory.

“This can happen as well sometimes. Uh, an automation run can fail and then, uh, fall through the cracks.”transcript, stated

Meta-automation for factory improvement

Chose Automation auditor reviewing automations and runs over Manual periodic audit of duplicated or inefficient automation steps.

Rationale: The same loop-based approach can identify redundant review work and suggest improvements to the factory itself.

“this is really intended to be an auditor for all the automations that we have. Review the code, review the automations, review the automation runs.”transcript, stated

Gotchas (what bit them)

Autonomous PRs can hit a wall and mark themselves as needing a human even when the underlying issue is agent-fixable.

Root cause: The primary automation can fail, stall, or misclassify limitations without a secondary reviewer.

Resolution: Add a PR shepherd fail-safe that rechecks stale or needs-human PRs on a schedule and fixes what agents can fix.

“the automation edit the needs human label. This means it's kind of hit a wall. It can't progress without human review.”transcript, stated
“the shepherd actually reviews it on a secondary loop um, to assess whether or not the initial assessment was correct”transcript, stated

Review becomes the bottleneck once agents can raise large volumes of PRs.

Root cause: Compliance-style multi-reviewer controls do not scale to hundreds or thousands of agent-generated pull requests.

Resolution: Classify low-risk changes for auto-approval while reserving human attention for complex or sensitive changes.

“if you're running with like SOC 2 or these other compliance frameworks, a very typical sort of control is to have multiple reviewers on an individual PR.”transcript, stated
“spending all our time when we're doing the actual review on the complex PRs and things like that.”transcript, stated

Human reviewers cannot efficiently inspect every generated diff at software-factory scale.

Root cause: Agent-generated changes produce too many low-level code artifacts for traditional review to remain the primary oversight mechanism.

Resolution: Shift review toward bottom-line summaries, architecture diagrams, domain-boundary checks, and other higher-level artifacts.

“Don't show me the diff. Don't show me the changes. Give me the bottom line. What did this change? What did it impact?”transcript, stated

Evaluation

The factory evaluates PRs through automated code review, blocking comment-resolution conversations, post-merge verification, CI performance monitoring, daily metrics, and Sentry-backed incident response.

Metrics: Merged pull requests · Lines of code written · Test coverage · CI performance checks · Sentry-captured client/server bugs · Stale or needs-human PRs

3 supporting quotes
“This review created comments and conversations that based on our rule set need to be resolved before we can merge the branch.”transcript, stated
“how many uh, lines of code were written, how many PRs were merged, uh, what's our test coverage”transcript, stated
“connected to Sentry. So all the bugs that we uh, capture through Sentry go through the incident responder.”transcript, stated

Outcomes

The demo describes a live factory for Memo with hourly builder/shepherd loops and a 15-minute Sentry incident-responder loop; some auditor and performance automations were still upcoming.

“I am not touching anything directly on GitHub. The only thing that we do in GitHub is ultimately we can open bug reports”transcript, stated
“You can also see that the performance monitor automation auditor and the weekly recap haven't uh, run yet. They will get active in the next few days as well.”transcript, stated