A Building as a Repository: KIR, a Typed Intermediate Representation for Agent-Authored Building Information Models
This paper introduces KIR, a typed intermediate representation that treats building information models as versioned programs to systematically detect and represent seven specific failure modes in autonomous agent-authored construction, demonstrating significant improvements in error diagnosis and code compactness compared to direct host API manipulation.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine a world where the blueprints for our cities are not just static drawings, but living instructions written by intelligent software agents. These agents are designed to construct digital models of buildings, layer by layer, room by room, using complex software that architects and engineers rely on every day. The challenge is that these software programs were built for human hands, not for autonomous machines. They react to commands in ways that are often unpredictable: a tool might fail silently, a choice might be made without a record of why, or a critical piece of information might vanish without a trace. When a human architect makes a mistake, they can see the error, understand the context, and fix it. When a software agent makes a mistake in this environment, it often cannot tell what went wrong, what it was trying to do, or whether the building it created actually matches the design it was given. The result is a system where the computer might claim a job is done, even if the building it produced is flawed or incomplete.
This is the problem a researcher named Dmitry Kuklev set out to solve. He asked a simple but profound question: what if we stopped asking these agents to write the raw code that talks directly to the building software, and instead asked them to write a clear, typed plan that a compiler could check before anything was built? The result is a new system called KIR. It treats a building not as a collection of files, but as a program held in a versioned repository, much like a library of instructions that can be read, checked, and revised. The core idea is that before an agent tries to build a wall or place a door, it must first write down exactly what it intends to do, and a separate system must verify that the plan is sound, that the references are clear, and that the consequences are known. If the plan is ambiguous, the system refuses to proceed and explains exactly why, offering a list of possible corrections. This approach shifts the burden from guessing and hoping to knowing and verifying.
The researchers built this system to handle seven specific ways that a building project can go wrong without anyone noticing. In the old way of doing things, an agent might try to select a specific floor level, but if two levels have similar names, the software might just pick the first one it finds and move on, leaving the agent unaware that it chose the wrong one. In the new system, this ambiguity is caught immediately. The system stops the process and presents a refusal record that lists the exact problem and the available candidates, forcing the agent to make a deliberate choice. Similarly, if an agent leaves a value blank, expecting the software to fill it in with a default, the new system records exactly where that default came from. It keeps a permanent log of whether a value was written by the agent, calculated by a macro, or supplied by the software itself. This creates a trail of provenance, a history of every decision made in the construction of the model.
To test this idea, the researchers created a controlled environment where they could run experiments without needing the actual building software running. They built a compiler that takes the agent's typed plan and checks it against a snapshot of a building model. In one experiment, they fed the system forty-two different programs, some of which contained deliberate errors designed to break the system. The system successfully refused twenty-nine of these flawed programs, providing detailed diagnostic codes that explained exactly what was wrong. Crucially, it did this without crashing or throwing an uncaught error; it simply stopped and explained the problem. For the programs that were accepted, the system generated a massive amount of code to run in the actual building software. A single building design that took one hundred lines of instructions to describe in the new system expanded into nearly four million characters of code when translated for the host software. This massive difference highlights the complexity of the underlying software and the value of having a compact, human-readable plan that sits between the agent and the machine.
The system also introduced a new way of thinking about the state of a building project. In traditional systems, a transaction is either successful or it fails. In this new system, there is a third state: unconfirmed. If the software sends a command to build a wall but the response is lost or unclear, the system does not guess whether it worked. Instead, it marks the action as unconfirmed and requires a specific verification step before it can be retried. This prevents the system from assuming a building element exists when it might not. The researchers also built a "reverse path," a way to read a finished building model back into the system's language. This process checks that every element in the model can be accounted for. If the system encounters a piece of the building it cannot understand or express, it does not silently drop it; it records it as an "atom" with a specific reason for the failure, ensuring that no part of the building is lost in translation.
The evaluation of this system was rigorous. The researchers tested it on a simulated sixty-story tower, a complex structure with hundreds of floors and thousands of columns. They found that the system could generate the entire building plan in a compact format of just over eleven thousand characters, which then expanded into the necessary code for the host software. They also tested the system's ability to handle conflicts when multiple agents try to edit the same building. The system uses a method called compare-and-swap, which ensures that if two agents try to change the same part of the building at the same time, the system detects the conflict and refuses to merge the changes until the agents resolve the disagreement. This prevents the kind of data corruption that often happens when multiple people work on the same digital file.
However, the researchers are careful to state what they have not yet proven. While the system works perfectly in their offline tests and generates code that compiles successfully, they have not yet run a controlled comparison to see if agents using this new system are better at building things than agents that write code directly. That experiment is planned but not yet done. The current results show that the system is robust, that it catches errors that would otherwise go unnoticed, and that it provides a clear, inspectable record of every decision made. It separates the validity of the plan from the success of the execution and the correctness of the final design, treating them as three distinct things that must be verified separately.
The significance of this work lies in its shift from a model of blind execution to one of evidence-based construction. By treating the building as a program that can be read, checked, and revised, the system gives autonomous agents the ability to reason about their own actions. It provides a vocabulary for failure, allowing the system to say "I cannot do this because X" rather than just failing silently. This approach does not just make the software more reliable; it makes the process of building with agents transparent and accountable. The researchers have shown that it is possible to build a system where the computer knows what it is doing, why it is doing it, and what it has achieved, creating a foundation for a future where intelligent agents can collaborate with humans to design and build the complex structures of our world. The work stands as a demonstration that with the right tools, the gap between an agent's intention and the final result can be bridged with clarity and precision.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.