Skip to content

Agent Patches

Agents should edit ArchAI through explicit operations, canonical paths, selectors, and deterministic evals.

const patch = branch.patch([
{
type: "computeBuildableEnvelope",
targetPath: "site.main.parcels.pcl_001",
params: {
includeRules: ["setbacks", "heightLimit", "lotCoverage"]
}
},
{
type: "generateFloorplates",
targetPath: "buildings.b_001",
params: {
envelope: "site.main.envelopes.primary",
maxDepth: mm(14500)
}
},
{
type: "placeCore",
targetPath: "buildings.b_001.systems.core.main",
params: {
strategy: "central",
stairs: 2,
elevators: 2
}
}
]);

Use selectors when applying an operation to a set.

path("buildings.b_001.levels.*.floorplate")
kind("space").where(program == "bedroom")
within("site.main.envelopes.primary")
dependsOn("site.main.parcels.pcl_001.constraints.zoning")
const result = await branch.evaluate(patch, {
scope: "affected",
tiers: [0, 1, 2, 3],
returnRepairHints: true
});
if (result.valid && result.score > branch.currentScore()) {
await branch.commit(patch, "Generate compliant massing and core option");
} else {
await branch.rollback(patch);
}
{
"kind": "operationSuggestion",
"op": "fitMassingToEnvelope",
"targetPath": "buildings.b_001",
"params": {
"reduceFootprintBySqm": 24.6
}
}