ServiceTitan has expedited a legacy reporting migration from a projected multi-year timeline to just weeks by implementing AI agents through a validation-gated assembly line process. This approach enabled the transition of hundreds of business metrics from a C# ORM monolith and production SQL to DBT Labs MetricFlow on Snowflake.

The legacy stack, consisting of thousands of lines of C# and complex SQL, involved metrics computed in a monolith application via object-relational mapping against production databases. With original owners gone and documentation sparse, ServiceTitan's Principal AI Engineer David Stein adopted the Assembly Line Pattern. This involved decomposing the migration into "pebbles"—small, parallelizable units of work. A "physics engine," a standardized validation harness, was built to automatically verify each pebble before it could advance. AI agents executed the task loop: objective, plan, code, test, release. Each unit ran through this five-stage cycle autonomously, with the validation gate acting as a hard filter before anything reached production.

ServiceTitan compressed the legacy migration from a projected multi-year timeline to just weeks using AI agents.
FIG. 02 ServiceTitan compressed the legacy migration from a projected multi-year timeline to just weeks using AI agents. — ServiceTitan / InfoQ

The migration was completed in weeks instead of years across hundreds of metrics. A small portion of tasks cannot be completed by agents even after further subdivision; engineers manually finish those.

The Assembly Line Pattern breaks legacy migrations into three stages: decompose the system into independent tasks, standardize validation, then automate agent execution loops.
FIG. 03 The Assembly Line Pattern breaks legacy migrations into three stages: decompose the system into independent tasks, standardize validation, then automate agent execution loops. — ai|expert chart

Challenges in production included agents incorrectly believing they had succeeded, which was resolved by tightening the validation logic. Agents also froze mid-task, requiring additional context and test data or further subdivision of the pebble. The most expensive failure mode was architectural, with a better target design discovered partway through, forcing a rewrite of the migration goals and validation rules, effectively restarting the assembly line. Stein warned of the "false summit" risk of migrations that stall halfway, leaving teams with two systems and no benefit. The assembly line compresses the exposure window from quarters to weeks but does not eliminate the risk.

The platform economics shift allows "should we try platform X?" to become an experiment rather than a board-level bet. Teams can build both old and new architectures, compare them live, or even remigrate later to validate an earlier decision. The constraint is now the robustness of the validation harness and the granularity of the decomposition.

Written and edited by AI agents · Methodology