# How Software Factories Improve Themselves — Suraj Gupta, Warp

## Executive summary

The presentation outlines three architectural patterns for building self-improving software factories: implementing outer-loop agents for skill refinement, utilizing persistent memory stores for traceable facts, and employing model routing to optimize cost and performance. These methods allow automated development environments to continuously improve their capabilities, moving beyond simple agent execution to self-optimization.

## Key takeaways

- Outer-Loop Agents for Skill Improvement: Instead of relying solely on an inner-loop agent to execute a skill (e.g., triage), an outer-loop agent observes the inner agent's runs and human feedback. Improvements to the skill are then formally tracked and reviewed via a Pull Request (PR) in Git, ensuring observability and preventing regressions. (4:15, 5:00)
- Persistent Memory as a Fact Store: Persistent memory acts as a versioned, traceable fact store scoped to an agent (e.g., a Sentry agent). This allows future runs to leverage previously gathered root cause analysis or context, preventing the waste of tokens and time re-gathering known information. (5:35, 6:35)
- Model Routing for Cost Efficiency: Model routing prevents excessive costs by preventing simple tasks (like triage or minor CI fixes) from running on high-cost models (e.g., Opus). Users can define custom rules or use auto-models to direct tasks to the most efficient model (e.g., using GLM for UI tasks). (8:45, 9:40)

## Technical details

- Skill Improvement Loop: The process involves an inner-loop agent executing a skill, an outer-loop agent collecting feedback signals (thumbs up/down, user comments), synthesizing improvements, and finally updating the inner skill via a PR. This ensures that all skill transformations are tracked in Git. (4:15, 5:00)
- Memory Functionality: Memory stores collect facts and learnings from agent runs. The system supports versioning, human review, and deletion of memories, and crucially, works across multiple harnesses, including Warp Zone, proprietary harnesses, Claude Code, and Codex. (6:35, 8:15)
- Model Routing Implementation: Model routing can be implemented via out-of-the-box 'auto models' or by defining custom rules (e.g., 'database migrations done with GLM'). The system can run evaluation sidecars to determine the best model for a specific class of task, such as finding that 'UI tasks are really well done with GLM.' (9:50, 11:40)

## Practical implications

- Implement an outer-loop agent layer to formalize and review all improvements to core agent skills, treating skill updates as first-class Git artifacts.
- Integrate a versioned, traceable fact store (persistent memory) into agent workflows to prevent redundant context gathering and accelerate root cause analysis.
- Audit agent workflows to identify tasks that can be safely offloaded from high-cost models (like Opus) to more efficient alternatives (like GLM) using model routing rules.

## Topics

Software Factories, Agentic Development, Outer-Loop Agents, Persistent Memory, Model Routing, CI/CD Automation, GitOps, Warp

Source: https://www.youtube.com/watch?v=TN3mj92oZ8I
