AI Engineer · Published 2026-09-27

Building Self-Improving Agent Software Factories — Suraj Gupta, Warp

Open on YouTube ↗

Summary

Overview

  • Speaker: Suraj Gupta
  • Channel: AI Engineer
  • Main topic: Self-improving agent software factories using skills, persistent memory, and model routing
  • Purpose: To provide software engineers with concrete, implementable frameworks for building self-improving agent software factories that optimize their skills, memory, and model usage without constant human intervention. Suraj Gupta, AI Engineering Lead at Warp, discusses how to transition from building individual software engineering AI products to building self-improving software factories. He breaks down self-improvement into three concrete pillars for agent factories over time: skills (procedural memory via inner/outer agent loops), persistent memory (fact stores scoped to agents updated via background extraction), and model routing (optimizing Pareto efficiency across models like Opus, GLM, and Haiku using custom rules and eval sidecars).

Topic Map

Introduction to Warp and Software Factories

  • Explanation: Suraj introduces Warp's evolution from a terminal-based agentic development environment (with 1 million active users) to a cloud agent platform that enables teams to build software factories.
  • Key claims:
    • Warp started as a modern-day terminal with an agentic development environment.
    • Warp is now building a cloud agent platform to enable teams to build software factories.
    • Software engineering is shifting from building products to building software factories and maintaining them.
  • Examples:
    • Building state-of-the-art agentic development environments.
  • Terminology:
    • Warp
    • software factory
    • agent development environment
  • Why it matters: Establishes the industry transition from building individual coding agents to orchestrating automated software factories.

Skills and Procedural Memory

  • Explanation: Explains how skills give agents procedural memory, and how outer-loop agents observe inner-loop runs to update and improve skills automatically.
  • Key claims:
    • Skills provide agents with procedural memory for repeated tasks like triage.
    • Static skill prompts get stale over time as human feedback and agent runs accumulate.
    • An outer-loop agent can observe inner-loop triage runs, look for mistakes and feedback, synthesize lessons, and update skill definitions via pull requests.
  • Examples:
    • A GitHub issue triage agent whose SKILL.md gets automatically updated and reviewed via a pull request.
  • Terminology:
    • skills
    • procedural memory
    • inner loop
    • outer loop
    • triage agent
    • SKILL.md
  • Why it matters: Enables agents to adapt their operating procedures autonomously based on past performance and human feedback.

Persistent Memory and Fact Stores

  • Explanation: Covers agent persistent memory as scoped fact stores where outer-loop agents extract facts and learnings from agent runs to prevent repeated mistakes.
  • Key claims:
    • Relying on luck or re-gathering context for recurring issues wastes tokens and time.
    • Persistent memory acts as a fact store scoped to an agent.
    • An outer-loop agent extracts facts, learnings, and outcomes from inner-loop agent sessions into memory stores for future runs to lean on.
  • Examples:
    • A Sentry agent that collects root-cause analysis memories over time and uses them to debug similar future issues faster.
  • Terminology:
    • persistent memory
    • fact store
    • Sentry agent
    • root-cause analysis
    • memory versioning
  • Why it matters: Reduces token consumption and speeds up agent execution by preventing agents from re-solving previously analyzed problems.

Model Routing and Pareto Efficiency

  • Explanation: Explains why model routing is vital to avoid prohibitive costs when running simple tasks on expensive models, using auto models and custom rule-based orchestrators.
  • Key claims:
    • Running all agents on expensive models like Opus for simple tasks like triage or CI fixes becomes prohibitively expensive.
    • Model routing optimizes Pareto efficiency across models based on specific task classes.
    • Warp provides out-of-the-box auto models and allows custom model routing configuration via YAML rule definitions.
  • Examples:
    • Routing database migrations to GLM and runbooks/API documentation to Qwen.
  • Terminology:
    • model routing
    • Pareto efficiency
    • auto models
    • eval sidecar
    • orchestrator
    • Opus
    • GLM
    • Haiku
    • Qwen
  • Why it matters: Controls operational costs while ensuring the right model is chosen for each specific subtask in a software factory.

Key Points

The shift from coding agents to software factories

  • Explanation: Software engineering is evolving from building standalone coding agents to constructing and maintaining self-improving software factories.
  • Evidence: Warp's transition from a terminal agent tool to a cloud agent platform.
  • Practical implication: Engineers need to design feedback loops and automation pipelines around their agents rather than treating them as static scripts.

Outer loops for skill improvement

  • Explanation: An inner-loop agent executes tasks using a skill file, while an outer-loop agent monitors performance, analyzes feedback, and updates the skill file.
  • Evidence: GitHub issue triage skill updates tracked through Git pull requests.
  • Practical implication: Agent capability can be version-controlled and human-reviewed via standard Git workflows.

Automatic extraction of persistent memory

  • Explanation: Agents extract facts and lessons from session outputs automatically so future sessions can leverage past learnings.
  • Evidence: Sentry error-handling memory store usage demonstrated in Warp Cloud Agent platform.
  • Practical implication: Agents become faster and more accurate over time without requiring manual context re-injection.

Configurable model routing

  • Explanation: Routing tasks to different LLMs based on task classification rules optimizes cost and performance.
  • Evidence: YAML configuration defining model preferences for database migrations versus documentation tasks.
  • Practical implication: Teams can prevent runaway API costs while maximizing task success rates.

Frameworks, Models & Processes

Self-Improving Agent Factory Framework

  • How it works: Combines inner-loop execution agents with outer-loop improvement agents that update skills, extract persistent memories, and route tasks to optimal models.
  • Components:
    • Inner loop agent execution
    • Outer loop skill improvement
    • Persistent memory fact store
    • Model router and eval sidecar
  • When to use: When scaling multi-agent software development workflows and deployment automation in production.

Examples & Case Studies

A GitHub issue triage agent reviews issues, gets feedback via comments and thumbs up/down, and an outer-loop agent updates the SKILL.md file via a pull request.

  • Illustrates: Skill self-improvement loop using outer-loop agents and Git version control.
  • Lesson: Skill updates should be tracked via Git pull requests so humans can review and prevent skill degradation.

A Sentry agent stores root-cause analyses in a persistent memory store and uses past memories to resolve recurring errors faster.

  • Illustrates: Persistent memory and automated post-session fact extraction.
  • Lesson: Persistent memory stores eliminate wasted tokens on re-gathering context for previously solved issues.

Actionable Takeaways

  • Immediate:
    • Implement outer-loop agents to review and update agent skill definitions.
    • Attach persistent memory fact stores to agent workflows to retain learnings across sessions.
    • Use model routing rules to map specific task classes to cost-effective models.
  • Strategic:
    • Transition software engineering practices from building products to building self-improving software factories.
    • Treat agent skills and memories as version-controlled code artifacts subject to human review and observability.
  • Questions to investigate:
    • How do you prevent negative feedback loops or hallucinations from corrupting agent skill files?
    • What are the optimal evaluation sidecar metrics for automated model routing decisions?

Claims Worth Verifying

  • Warp has about a million active users using its modern-day terminal agent development environment. (statistical)
  • Persistent memory works across all harnesses on Oz, including Warp's proprietary harness, Claude Code, and Codex. (architectural)

Notable Quotes

"Self-improvement is about agents being able to improve over time, agents and models, and facing out humans from that loop so that way the the improvement loop can be automatic." "Skills are a great way to give your agents procedural memory."

Compressed Summary

  • Software engineering is transitioning from building products to building self-improving software factories.
  • Skills provide procedural memory and can be automatically improved via inner and outer agent loops.
  • Persistent memory acts as a scoped fact store updated via automatic post-session extraction.
  • Model routing optimizes Pareto efficiency and controls costs across diverse LLM selections.
  • Keywords: agents, software factory, memory, routing, skills
  • Core insight: Building effective agent software factories requires self-improvement mechanisms across skills, persistent memory, and model routing to automate optimization while keeping workflows observable and cost-effective.

Core insights

6
Architecturehigh noveltymoderate evidence

Self-improvement is split into two distinct loops: an inner loop that executes tasks using existing skills, and an outer loop that observes inner-loop runs and mutates the agent's skills, memory, and configuration. The outer loop is a separate agent doing meta-work on the artifact (a SKILL.md file), not the executing agent reflecting on itself.

Why it matters

It places improvement responsibility in a separate agent/process rather than in-context self-critique, which makes the improvement step asynchronous, inspectable, and versionable. Builders must decide what the outer loop can mutate (skills, memory) versus what stays fixed.

Generalization

Any agent system can be decomposed into an execution plane and an improvement plane, where the improvement plane consumes execution telemetry as its input dataset.

An outer-loop agent can observe inner-loop triage runs, look for mistakes and feedback, synthesize lessons, and update skill definitions via pull requests.
Open source video
Practicehigh noveltymoderate evidence

Skill improvements are delivered as Git pull requests against the skill definition file, so agent capability changes flow through the same review, versioning, and rollback machinery as normal code.

Why it matters

This converts an autonomous, potentially degrading self-modification into a reviewable change with a diff, an author, and an audit trail. It also identifies who owns the review bottleneck as the factory scales.

Generalization

Treat agent behavioral artifacts (prompts, skill files, routing rules) as reviewed source code rather than runtime state, and gate autonomous writes behind the same workflow.

A GitHub issue triage agent whose SKILL.md gets automatically updated and reviewed via a pull request.
Open source video
Skill updates should be tracked via Git pull requests so humans can review and prevent skill degradation.
Open source video
Mechanismmedium noveltymoderate evidence

Persistent memory is not written by the executing agent during its run; a separate background extraction process reads completed inner-loop sessions and distills facts, learnings, and outcomes into fact stores scoped to a specific agent.

Why it matters

Decoupling memory writes from execution avoids spending in-run tokens and context on memory upkeep and keeps the memory store curated rather than an append-only session log. Scoping the store to an agent is a deliberate boundary decision that limits cross-contamination of facts.

Generalization

Memory should be an asynchronous ETL pipeline over agent session traces, with an explicit scope key (agent, repo, service) and a versioning story, rather than an in-loop write.

Persistent memory acts as a fact store scoped to an agent.
Open source video
An outer-loop agent extracts facts, learnings, and outcomes from inner-loop agent sessions into memory stores for future runs to lean on.
Open source video
Mental Modelmedium noveltymoderate evidence

Procedural memory (how to do a task, held in a skill file) and declarative memory (facts about past incidents, held in a fact store) are treated as two separate subsystems with separate update loops and separate review processes.

Why it matters

Conflating them leads to a single blob store that is neither a good procedure nor a good knowledge base. Separating them lets you apply code review to procedures and eviction/versioning policy to facts.

Generalization

Split agent long-term state along the procedural/declarative axis, because the correct update and validation mechanism differs for each.

Skills provide agents with procedural memory for repeated tasks like triage.
Open source video
Persistent memory acts as a fact store scoped to an agent.
Open source video
Mechanismmedium noveltymoderate evidence

Model selection is pushed out of the agent and into a declarative rule-based router keyed on task class, with an eval sidecar providing the quality signal; the design goal is a Pareto frontier over cost and quality rather than a single best model.

Why it matters

Routing decisions become configuration that can be changed without touching agent code, and the eval sidecar implies routing decisions are validated against measured task success rather than intuition.

Generalization

Treat per-subtask model choice as a policy layer with its own config and evaluation harness, not as a hardcoded constant inside each agent.

Model routing optimizes Pareto efficiency across models based on specific task classes.
Open source video
Warp provides out-of-the-box auto models and allows custom model routing configuration via YAML rule definitions.
Open source video
Tradeofflow noveltyweak evidence

Uneven task difficulty within a factory makes uniform premium-model usage economically unviable; routing is a cost-forcing function rather than a pure optimization.

Why it matters

It reframes model choice as a budget constraint that shapes architecture: which subtasks get decomposed and routed cheaply versus kept on frontier models.

Generalization

Any high-volume agent pipeline will need a cost-tiering layer, and the tiering boundaries should follow task classes with measurable failure tolerance.

Running all agents on expensive models like Opus for simple tasks like triage or CI fixes becomes prohibitively expensive.
Open source video

Deep dives

5

Outer-loop convergence and skill quality drift over successive self-modification cycles

Research question

Does an outer-loop agent that proposes SKILL.md diffs converge to higher task success over N cycles, or does skill quality oscillate/regress as merged PRs accumulate?

Why

The entire 'self-improving factory' premise rests on an unmeasured assumption that the improvement loop is net-positive over time. If it is not, the correct architecture is a bounded loop with periodic skill reset rather than an open-ended one, which changes how builders budget review effort and version skill files.

An outer-loop agent can observe inner-loop triage runs, look for mistakes and feedback, synthesize lessons, and update skill definitions via pull requests.
Open source video
Skill updates should be tracked via Git pull requests so humans can review and prevent skill degradation.
Open source video
Source video

How the eval sidecar actually closes the loop on routing rules

Research question

Is the eval sidecar an offline harness that derives YAML routing thresholds, or an online scorer that can trigger rerouting mid-traffic — and which produces a better cost/quality frontier?

Why

'Eval sidecar' is named but never mechanized. Whether routing policy is set offline or adjusted online determines whether routing is a config artifact or a control system, which changes the failure modes (stale rules vs. thrashing) and what telemetry must be retained.

Model routing optimizes Pareto efficiency across models based on specific task classes.
Open source video
Warp provides out-of-the-box auto models and allows custom model routing configuration via YAML rule definitions.
Open source video
Source video

Fact-store scope granularity, conflict resolution, and stale-fact contamination

Research question

What scope key (agent, repo, service, task class) maximizes retrieval precision while minimizing cross-contamination and superseded-fact steering of future runs?

Why

Scoping memory to an agent is stated as a boundary decision but no policy is given for overlap, conflict, or eviction. Since wrong facts silently degrade future runs, this is the highest-leverage unaddressed correctness risk in the persistent-memory pillar.

Persistent memory acts as a fact store scoped to an agent.
Open source video
Reduces token consumption and speeds up agent execution by preventing agents from re-solving previously analyzed problems.
Open source video
Source video

Human review as the throughput limiter of a self-improving factory

Research question

At what PR volume does human review of outer-loop skill updates become the binding constraint, and what is reviewer time per skill PR?

Why

The outer loop is automated but its gate is human. If review time per PR is constant, factory scale is capped by reviewer headcount — a concrete capacity ceiling that determines whether the review gate can survive scale or must be partially automated.

Skill updates should be tracked via Git pull requests so humans can review and prevent skill degradation.
Open source video
A GitHub issue triage agent whose SKILL.md gets automatically updated and reviewed via a pull request.
Open source video
Source video

Cost-tiering boundaries as an architectural constraint on task decomposition

Research question

At what task volume and model price differential does rule-based routing produce material cost reduction, and do routed cheap models stay on the cost/quality frontier on real distributions?

Why

If routing does not actually reduce cost per unit work, the whole tiering layer is overhead. The answer also shapes decomposition: tasks must be split at boundaries with measurable failure tolerance for cheap models, which is an architecture decision, not just a config one.

Running all agents on expensive models like Opus for simple tasks like triage or CI fixes becomes prohibitively expensive.
Open source video
Model routing optimizes Pareto efficiency across models based on specific task classes.
Open source video
Source video

Article ideas

4

Your Agent's Prompts Are Source Code Now: Why Self-Improvement Needs a PR Gate

Moving agent behavioral artifacts into versioned files with pull-request review is the only path to autonomous self-improvement that does not quietly degrade, which means the bottleneck of agent evolution shifts from model capability to human review throughput.

Angle

Argue that diffability, authorship, and rollback matter more than the cleverness of the outer-loop agent, then quantify where the review gate breaks.

Source video

Procedural and Declarative Memory Are Different Subsystems, and Conflating Them Breaks Both

Skills and fact stores must be split because the correct update mechanism differs categorically: procedures want code review, facts want versioning and eviction policy, and any single memory blob serves neither well.

Angle

Take the procedural/declarative axis as the primary design split for long-term agent state, and show where a merged store fails on both retrieval and validation.

Source video

Memory Is an ETL Pipeline, Not a Scratchpad

Writing memory inside the agent run is the wrong default; background extraction over completed session traces keeps memory curated and keeps in-run context and tokens spent on the actual task.

Angle

Reframe memory maintenance as asynchronous data engineering with scope keys, versioning, and contamination monitoring rather than a runtime concern.

Source video

The Execution Plane and the Improvement Plane: A Two-Plane Model for Agent Systems

Splitting agent systems into an execution plane and a separate improvement plane that consumes execution telemetry as its input dataset is a more useful organizing abstraction than in-context self-critique, because it makes improvement asynchronous, inspectable, and testable.

Angle

Present the two-plane decomposition as a design pattern, with the improvement plane's input dataset, mutation surface, and gate as its defining parameters.

Source video

Project ideas

4

Skill Drift Bench

beyond-evals

Running an outer-loop skill-updating agent for N successive update cycles on a fixed task distribution produces a measurable net improvement that plateaus or regresses after a finite number of cycles, rather than improving monotonically.

Proof of concept

Implement a triage agent with a SKILL.md, an outer-loop agent that proposes skill diffs from recorded runs and feedback, and an automated merge path; replay a fixed frozen task distribution after each cycle and record task success rate and diff size per iteration.

Measurement

Task success rate and failure-class breakdown per cycle over N=20 cycles, plus the cycle index at which success rate stops improving or declines; regression detection via a held-out task slice never seen by the outer loop.

Source video

Scoped Fact Store with Conflict Resolution on Write

movement-lab

A fact store with explicit scope keys and conflict resolution on write yields higher retrieval precision and lower stale-fact contamination over time than an append-only session log scoped to the same agent.

Proof of concept

Build a background extraction process over completed agent sessions that writes facts into a store keyed by (agent, repo, service) with supersession rules; run both this store and an append-only baseline against a repeated-failure workload.

Measurement

Retrieval precision on a labeled fact set, contamination rate (retrieved facts that are superseded or wrong), tokens and latency per repeated failure class versus a no-store baseline, tracked over successive weeks of accumulation.

Source video

Eval-Sidecar Router with Derived YAML Thresholds

gatehouse

Routing thresholds derived automatically from an eval harness that scores task-class outcomes per model achieve a non-dominated cost/quality frontier versus static human-authored rules, and misrouting is detectable as a distinct failure class at request time.

Proof of concept

Instrument a router with declarative YAML task-class rules, run an eval sidecar that scores per-class outcomes for each candidate model, auto-derive thresholds, and log every routing decision with the rule that fired for auditability.

Measurement

Cost per successful task and success rate versus static routing across at least three task classes, plus false-downgrade rate (tasks sent to an underpowered model) and the fraction of routing decisions attributable to a single rule.

Source video

Review-Load Ceiling Calculator

new

Human review time per skill PR is roughly constant, so factory scale (agent count times update frequency) is bounded by reviewer headcount, and the binding constraint arrives before agent-side compute does.

Proof of concept

Instrument a pipeline where the outer loop opens skill PRs at controlled rates; measure reviewer minutes per PR, acceptance rate, and the rate at which the PR queue grows without bound at fixed reviewer capacity.

Measurement

Reviewer minutes per PR distribution, PR acceptance rate, queue depth over time at fixed reviewer count, and the agent-update rate at which queue depth grows monotonically.

Source video

Architectural implications

3

Skill definitions become versioned artifacts rather than static prompts embedded in an agent.

Before

Skill prompts are static and go stale as human feedback and agent runs accumulate.

After

Skill definitions live in a file that an outer-loop agent proposes diffs against, merged via pull request.

Consequence

Agent behavior becomes diffable, reviewable, and rollback-able, and the review step becomes a scaling bottleneck and a place for degradation to be caught.

Source video

Memory becomes background-extracted state rather than in-run context accumulation.

Before

Agents re-gather context for recurring issues, wasting tokens and time.

After

An extraction process writes scoped facts into a store that future runs read from.

Consequence

Requires memory versioning, scoping policy, and eviction strategy, since stale or wrong facts will silently steer future runs.

Source video

Model choice is externalized from the agent into a router with declarative rules.

Before

An agent or team picks one model, typically the most capable, for all tasks.

After

Task classes are mapped to models via YAML rules, with an eval sidecar providing quality signal.

Consequence

Routing configuration becomes a first-class artifact requiring its own evaluation and monitoring; misrouting is now a new class of production failure.

Source video

Tradeoffs and failure modes

3

Autonomous skill rewriting

Benefit

Skills adapt to accumulated human feedback and observed mistakes without manual editing.

Cost or risk

Self-modification can degrade skill quality; the summary explicitly treats skill degradation as the risk that justifies a human review gate.

Skill updates should be tracked via Git pull requests so humans can review and prevent skill degradation.
Open source video
Source video

Persistent fact stores

Benefit

Reduces token consumption and speeds up agent execution by preventing agents from re-solving previously analyzed problems.

Cost or risk

Facts must be versioned and scoped; the summary introduces memory versioning as a concept, implying stale or incorrectly scoped facts are a real hazard.

Reduces token consumption and speeds up agent execution by preventing agents from re-solving previously analyzed problems.
Open source video
Source video

Rule-based model routing

Benefit

Controls operational costs while ensuring the right model is chosen for each specific subtask.

Cost or risk

Routing accuracy depends on task classification quality and eval sidecar signal; a wrong rule silently sends tasks to an underpowered model.

Model routing optimizes Pareto efficiency across models based on specific task classes.
Open source video
Source video

Open questions

4

How is the eval sidecar actually wired into routing decisions — offline benchmarks that set the YAML rules, or online scoring that can trigger rerouting?

Why unresolved

The summary names 'eval sidecar' as terminology but provides no mechanism for how it feeds routing or memory decisions.

Research direction

Prototype a router where an eval harness scores task-class outcomes per model and derives routing thresholds, then measure quality delta versus static routing.

Source video

What is the correct scope granularity for a fact store, and how are conflicting or superseded facts resolved across agents that overlap in domain?

Why unresolved

The summary states memory is scoped to an agent but gives no policy for overlap, conflict, or eviction, and only mentions versioning as a term.

Research direction

Build a memory store with explicit scope keys and conflict-resolution on write; benchmark retrieval precision and stale-fact contamination over time.

Source video

Does the outer-loop improvement process actually converge, or does it oscillate/degrade as skill PRs accumulate over many iterations?

Why unresolved

The summary asserts the loop works but reports no longitudinal measurement of skill quality across update cycles.

Research direction

Track skill performance metrics across N successive outer-loop update cycles on a fixed task distribution to detect regression or drift.

Source video

At what volume does human PR review of skill updates stop being a viable gate?

Why unresolved

The human review, not the outer loop, is the throughput limiter; the summary offers no data on review load.

Research direction

Measure reviewer time per skill PR to estimate the ceiling on factory scale before review becomes the constraint.

Source video

Key claims

7
causalVerification needed

Running all agents on expensive frontier models for simple tasks becomes prohibitively expensive.

Evidence

Running all agents on expensive models like Opus for simple tasks like triage or CI fixes becomes prohibitively expensive.

Question

At what task volume and model price differential does routing produce a material cost reduction versus a single premium model?

Source video
causalVerification needed

Static skill prompts degrade over time as feedback and runs accumulate.

Evidence

Static skill prompts get stale over time as human feedback and agent runs accumulate.

Question

Can staleness be measured as a decline in task success rate over time for a fixed skill file?

Source video
causalVerification needed

An outer-loop agent can observe inner-loop runs and update skill definitions via pull requests.

Evidence

An outer-loop agent can observe inner-loop triage runs, look for mistakes and feedback, synthesize lessons, and update skill definitions via pull requests.

Question

What is the acceptance rate of outer-loop-generated skill PRs, and do merged changes improve or regress downstream task success?

Source video
causalVerification needed

An outer-loop agent extracts facts and outcomes from inner-loop sessions into memory stores for future runs.

Evidence

An outer-loop agent extracts facts, learnings, and outcomes from inner-loop agent sessions into memory stores for future runs to lean on.

Question

How much token and latency reduction does a populated fact store deliver on repeated failure classes versus no store?

Source video
factualVerification needed

Warp allows custom model routing configuration via YAML rule definitions and ships out-of-the-box auto models.

Evidence

Warp provides out-of-the-box auto models and allows custom model routing configuration via YAML rule definitions.

Question

What is the rule schema, and can routing decisions be overridden or audited at request time?

Source video
opinionVerification needed

Model routing is the mechanism for achieving Pareto efficiency across models by task class.

Evidence

Model routing optimizes Pareto efficiency across models based on specific task classes.

Question

Is the cost/quality frontier actually non-dominated in practice, or do routed cheap models fall off the frontier on real task distributions?

Source video
predictionVerification needed

Software engineering is shifting from building products to building and maintaining software factories.

Evidence

Software engineering is shifting from building products to building software factories and maintaining them.

Question

What fraction of engineering effort in teams adopting this pattern shifts to maintaining factory infrastructure versus shipping product features?

Source video

Connections

5