Step 9 refers to template generation. Existing template-based workflows generate reaction templates from reaction centres, expanding around them to the nearest neighbours. However, in this work, as carrier fragments already incorporate this knowledge, and involved carrier fragments can be determined based on the reaction centre, templates can be directly generated. For instance, in Figure , atom 8, which is part of the reaction centre, belongs to the aromatic hydroxyl carrier fragment. Likewise, atoms 4 and 6 belong to the anhydride carrier fragment. Thus, the template can be generated with the aromatic hydroxyl and anhydride carrier fragments on the LHS, and corresponding product atom fragments on the RHS. Mapping indices are preserved, with the template reflecting acetylation of the aromatic hydroxyl carrier fragment. In cases where the reaction centre involves multiple carrier fragments in the same molecule, the Bellman-Ford algorithm implemented in RDKit is used to compute the shortest path between fragments, and a larger representative fragment is generated as part of the template. More details on template generation are provided in the ESI Section S3.