Summary

This year I presented my open-source project revit-rag at AU26. While preparing the talk, Fable and Astra came out, and I came to see that much of the work that used to depend on RAG can now be done by the LLM directly. After a few rounds of vibe coding tests, though, one problem was still there: the model can still misunderstand or misuse the Revit API.

With that question in mind, within a week of the AU26 talk I started to rebuild the project. I no longer keep one large RAG framework. It is split into three fairly independent parts: Skills, an Agent, and API documentation search. Development no longer calls RAG at every step; it searches only when an API is uncertain.

During the rebuild I also ran into the efficiency of automatic testing. The common approach relies on screenshots, image analysis, coordinate recognition and simulated clicks. It does automate the test, but it calls a vision model again and again, and the token cost is high. So I combined geometric coordinate conversion, reproducible random clicks and a small number of screenshots into an automatic test flow that takes the model data as its main evidence and cuts the repeated visual analysis.

As AI-assisted programming spreads, the way engineers work with code is changing. The aim of this project is to turn what I have learned in Revit development into reusable Skills and an Agent workflow: to lower the barrier to development and debugging, and to constrain the model with clear rules and verification steps so that the generated code is more reliable. The rest of this article describes the project structure, the test method and the results.

Project: https://github.com/revitbridge

The project

The project has three modules. Each can be installed on its own, and they can be combined:

PartWhat it isWhat it solves
skillsCoding rules and procedures written for the LLMTells it in advance about the pitfalls I have hit, so it makes fewer known mistakes
agent (revit-bridge)A bridge into Revit, plus automatic testingLets it read data, dry-run code and test the product on a real model
docs (revit-api-docs)A searchable Revit API referenceOne lookup when an API is uncertain gives the exact interface

Skills

The Skills give the LLM Revit programming rules and procedures: model changes must sit inside a Transaction, how to handle failures, and the API differences between Revit versions.

These rules come from repeated development and correction in real projects. An LLM can already do a great deal of the coding, but it still makes mistakes that look reasonable and yet block the task.

For example, when changing a wall’s thickness, some agents first check the wall type with IsVerticallyCompound and refuse to run when it is true. For the ordinary wall in this test, that check made the add-in exit before it changed anything. In the tests below, 20 of the 39 products built without a connection to Revit contained this check. When generated code cannot be debugged directly against Revit, such problems are usually found only when the user runs it and reports back to the LLM, which costs debugging time and tokens.

The Skills are organised in a lightweight way and can be used quickly in dsh, Codex and Claude Code. There are six of them:

skillPurpose
revit-coreRequired reading before writing Revit C#: the snippet contract, internal units, ElementId and other version differences, the Revit 2024 to 2027 runtime matrix
revit-task-briefRewrites a designer’s one-sentence request into a testable brief
revit-bridgeThe procedure for creating, changing and querying elements in the open model through the bridge
revit-addin-devCreating, continuing, debugging and migrating a standalone Revit C# add-in
revit-addin-testTesting a compiled add-in in a real Revit
revit-addin-releaseMulti-year builds, the installer and acceptance on a real machine

Every rule has the same structure: scenario, wrong code, right code, versions and source. Here is the ElementId example from revit-core:

---
schema_version: 1
id: revit-core/elementid-value
revision: 1
title: "ElementId: use Value (long); IntegerValue is obsolete in 2024-2025 and gone from 2026"
summary: "`ElementId.Value` (long); `IntegerValue` is obsolete in 2024-2025 and gone from 2026"
stage: [orient, write, fix]
kind: pitfall
revit: ">=2024 <2028"
order: 30
triggers:
  symbols: [IntegerValue, ElementId]
  errors: [CS1061, CS0618]
---

## Scenario

Element ids are 64-bit: `ElementId.Value` returns `long`. Code written for older Revit uses `IntegerValue` (`int`) and `new ElementId(int)`.

## Wrong

```csharp
int id = wall.Id.IntegerValue;   // 2024-2025: warning CS0618 (obsolete); 2026 and later: CS1061
```

## Right

```csharp
List<long> ids = new FilteredElementCollector(document)
    .OfClass(typeof(Wall))
    .ToElementIds()
    .Select(id => id.Value)
    .ToList();
long first = ids.Count > 0 ? ids[0] : ElementId.InvalidElementId.Value;
Element again = document.GetElement(new ElementId(first));
return new { Count = ids.Count, First = first, Found = again != null };
```

## Versions

- 2024.0 to 2025.4: `IntegerValue` and the `ElementId(Int32)` constructor are marked obsolete; the property's message: "This property is deprecated in Revit 2024 and may be removed in a future version of Revit. Please use the Value property instead."
- 2026.0, 2026.4, 2026.5, 2027.0, 2027.2: both are gone. `Value` (`Int64`) and `ElementId(Int64)` exist in every version checked.

## Source

- revit-api-docs data set (Revit 2026): `ElementId.Value` "Provides the value of the element id as a 64-bit integer" (`public long Value { get; }`); the `ElementId` member list has `ElementId(Int64)` and no `IntegerValue`.
- Metadata of the Revit API assemblies 2024.0, 2024.3, 2025.0, 2025.4, 2026.0, 2026.4, 2027.2 and the installed 2026.5 and 2027.0, including the obsolete messages quoted above (2025.5 not checked).

Agent

The Agent module is built around revit-bridge. It connects the Skills, automatic testing and API documentation search into one development flow. This is also closer to the project’s original goal: to let a developer write, verify and deliver with tools that are as light as possible.

Skills alone have two limits: they cannot check an exact API definition, and they cannot connect to a running Revit to test. revit-bridge fills both gaps. The agent can simulate user operations in the real model, read the result and iterate on the error messages; it calls the documentation search only when an API is uncertain.

The overall workflow:

Flow diagram: a one- or two-sentence request, rewritten as a testable brief, read the open model, write the core logic, compile check, dry run, build the add-in DLL, test in the real Revit, deliver the add-in and a report. A failed compile check, dry run or test goes back to writing the core logic. Reading the model, compiling, the dry run and the test all happen in the open, real Revit model. revit-docs is asked only when an API is uncertain.

The tool and the job at each step:

StepWith whatWhat it does
Rewrite the briefskill revit-task-briefTurns a one-sentence request into numbered behaviour, inputs with units, cancel and failure rules, and how it will be accepted
Read the open modelthe bridge’s query toolsGets the project’s real families, types and marks instead of assuming “the project should have them”
Write the core logicskills revit-core, revit-addin-devThe core logic lives in its own file, takes plain values only, and touches no dialog and no pick
Look up the docsrevit-docsOnly when an API is uncertain, not at every step
Compile checkcheck_codeCompiles in Revit without running
Dry rundry_run_codeReally runs the code on the open model and then always rolls it back; returns what would be added, modified and deleted, and every warning and error Revit raised
Test in the real Revittest_addin_commandLoads the built DLL, picks by element id, feeds the input file, reads the result back, then restores the model

The compile check, the dry run and the real-Revit test are three verification points. When any of them fails, the agent goes back to coding with the specific diagnostics. In this flow the dry run’s changes are rolled back and the model is restored after the test, so no person has to step in on each iteration and no test change stays in the model.

Docs

revit-docs (package name revit-api-docs) comes from the data module of the original revit-rag project and holds the Revit 2026 API reference. I separated it so that the Agent can call it on demand, and to leave room for further retrieval experiments. I ran two rounds of retrieval evaluation and changed the database structure and the retrieval strategy according to the results.

Two terms first:

  • Jev is a reranking service from TypeSafe; the model version during the tests was jev-1.14.0. Retrieval first recalls a set of candidate entries; Jev gives each candidate a relevance score from 0 to 1, and the candidates are reordered by that score.
  • nDCG@5 measures whether the correct API entry is in the top 5 and how high it ranks. The maximum is 1.

Round one: the existing retrieval plus Jev

Round one used data set v1.0 and 60 English queries covering API names, designer-style task descriptions, fix hints after a compile error, and things that are not in the database. No vector search in this round:

RecallNo rerankWith Jev rerank
The existing keyword search (LIKE substring matching)0.5930.815
BM25 (SQLite FTS5 full-text index)0.6750.871

All values are nDCG@5. With either recall method, ranking improved clearly once Jev was added. Checking query by query, no query that was a hit before became a miss after reranking. On the compile-error fix hints alone, keyword search scored 0.200 and BM25 with Jev reached 0.914.

This round also showed where reranking ends: Jev can only reorder the candidates it is given and cannot bring back what recall missed. The original keyword search failed to put the correct answer among the top 30 candidates for 8 queries.

Round two: adding vectors, and a comparison with Cohere

Round two enlarged the query set to 223: 110 queries about a single API and 113 complex tasks that need 2 to 4 APIs together:

RecallNo rerankJev rerankCohere rerank-v3.5
BM250.5650.7880.674
Vector + BM25 hybrid0.5650.8640.700
Vector only0.5550.8100.680

Under all three recall strategies Jev scored higher than Cohere, and the gap grew as the candidate pool grew. For the complex tasks, keeping Jev and only replacing BM25 recall with hybrid recall raised the top-5 hit rate from 0.726 to 0.872.

Round two also found a key problem in data set v1.0: the record IDs of the vector store did not match the SQLite row numbers. Of the 27,596 shared IDs, only 2 pointed to the same entry. In the database as published at that time, vector search could therefore return unrelated entries, and hybrid search was in effect no different from BM25 alone. Note that the vector results in the table above come from data that the experiment first realigned by entry name.

Changes to the database and the retrieval

Based on the two rounds, I made these changes:

VersionChangeEffect
0.2.0Keyword search moved from LIKE substring matching to BM25 on an SQLite FTS5 index; identifiers also match by their camel-case partsMisspelt or unknown names (such as FiltredElementColector) get candidates instead of “not found”
0.2.0Jev reranking added; the rerank HTTP connection is reusedA query with Jev reranking went from about 2.1 seconds to about 0.4 seconds for each later call, while the candidates grew from 10 to 30
0.3.0Data set v1.1: the vector store is rebuilt from the SQLite rows, and every record id is its row numberA vector hit comes back as the entry it describes
0.3.0Data set v1.1: 1,266 pages added (1,040 constructors, 226 interface members and similar), 28,862 entries in allEntries such as new XYZ(x, y, z) and IExternalEventHandler.Execute can be found
0.3.0Vector documents changed from “almost only the entry name” to “entry name : summary”Hybrid search without reranking went from 0.610 to 0.647
0.3.0Vector and BM25 results are merged by reciprocal rank fusion (RRF)Without reranking, vector hits can reach the top 5: 0.557 to 0.647, complex tasks 0.355 to 0.459
0.3.0With a TypeSafe key set, Jev reranks by default; Cohere is optional and the fallback

After the changes I evaluated data set v1.1 again with the same 223 queries:

Configuration (data set v1.1)nDCG@5
BM25 only, no key needed0.557
Vector + BM25 fused, no rerank0.647
Vector + BM25 fused, with Jev rerank0.842

The results show that Jev’s main value is more accurate ranking, while the speed gain comes mainly from reusing the HTTP connection. A query with reranking now takes about 0.4 to 0.5 seconds. On cost, the average input in round one was about 5,400 tokens per query, about 0.0002 US dollars at the price at that time.

In the real Agent workflow, documentation search does not run through every step. It is triggered on demand when an API definition is in doubt.

Test overview

To evaluate this approach I chose four coding-agent lines, Grok, GPT, Gemini and DeepSeek, and designed two Revit add-in development tasks. Each agent did the code generation, the testing and the final acceptance on its own, covering as much as possible of the path from request to product.

All add-ins the agents produced (called “products” below) were accepted by a script in the same Revit 2026 test model. With revit-bridge connected, all 38 valid runs met the completion bar; without it, the overall completion rate was below one half.

The test file (Revit 2026) is on Autodesk Drive: open the test model. Every run and every judgement in this article used this one model.

The tests ran from 14 to 16 November 2026: 154 runs, 135 of them valid. All model costs in this article are estimates from public list prices, not billed amounts.

Key numbers

ItemResult
Full setup (skills + bridge + docs)38 / 38, both tasks completed in every run
Native (prompt only)19 / 38 completed
Skills only, no bridge16 / 40 completed, no better than native
Cache hit of prompt tokens94.8%; 478 million of 505 million prompt tokens came from cache
Model usage of the four lines in totalAbout 231 US dollars, estimated from tokens at each provider’s list price, 154 runs
Model tokens used by the automatic judging0; a script reads the model data back, no screenshots

How it was tested

The host program and model of each line (coding agent):

LineHost programModel
OpenAICodex CLI 0.169.0gpt-6.1-sol, reasoning effort high
GrokCursor CLIgrok-4.7-high
DeepSeekdsh 0.2.1-rc.3deepseek-v4-pro, high
Geminiagy 1.5.9gemini-4-carbon-high

The tools and environment an agent had under each condition:

ConditionInputEnvironment
N nativeThe prompt and the host’s own tools, the Revit API assemblies; no RevitA clean test machine without Revit
K skills onlyN + the revit-bridge skills (coding rules and procedures)Same
KRK, with one more rule in the skills: “refuse only on a condition you have verified” (the rule)Same; wall task only
S3 full setupK + revit-bridge MCP (read, dry-run and test the product on the open model) + Revit API docs MCPA machine with Revit 2026 and the test model open

The two tasks:

  • Wall task: pick a wall, add a 10 mm finish layer, and place one door and one window in that wall, with requirements on type, size, position and mark. 19 checks.

    Make me a Revit 2026 add-in: I pick a wall, it gets 10 mm thicker by adding a finish layer to its wall type; then, with the sizes and positions I type into a dialog, make a new window type and a new door type and insert them into that wall. Use the window and door families this project uses most, continue the project's existing door and window numbering, and make the door open into the larger of the two rooms.
    
    Name the add-in {{ADDIN_NAME}}. Put the sources, csproj and .addin in the current directory and make sure it builds; do not install it. Revit 2026 with an architectural project is open on this machine. Nobody will answer questions: decide yourself and say what you decided. Finish with a short report in English: build result, what you verified, what you could not.
    
    The add-in will be tested by a script. The wall is still picked with the mouse. When a file named {{ADDIN_NAME}}.input.json exists next to the add-in DLL, do not show the dialog and do not show any message box: take the values from that file, and when the command ends write {{ADDIN_NAME}}.result.json next to the DLL as {"result": "Succeeded" | "Cancelled" | "Failed", "message": "..."}. Without the input file the add-in behaves normally, with its dialog. The input file is:
    {"window_width_mm": 900, "window_height_mm": 1200, "window_sill_mm": 900, "window_center_mm": 1500, "door_width_mm": 900, "door_height_mm": 2100, "door_center_mm": 4000}
    Centers are distances along the wall's location line from its start point (parameter 0) to the middle of the opening.
  • Room task: write the finishes and the ceiling height into every room of the current level, unify the room tags, renumber the doors after the room they open into, and sort the existing schedule. 15 checks.

    Make me a Revit 2026 add-in that gets the active floor plan ready for our room finish schedule. In a dialog I type the schedule's floor, base, wall and ceiling finish and ceiling height; write them into every room on the plan's level, including rooms that are not enclosed yet. Give every room tag in the plan the tag type this project uses most. Renumber the doors after the room they open into (their To Room; a door with a room on one side only takes that room): room number plus A, B, C ... in the order of their current marks, like 201A, 201B. Then sort the project's room finish schedule by room number.
    
    Name the add-in {{ADDIN_NAME}}. Put the sources, csproj and .addin in the current directory and make sure it builds; do not install it. Revit 2026 with an architectural project is open on this machine. Nobody will answer questions: decide yourself and say what you decided. Finish with a short report in English: build result, what you verified, what you could not.
    
    The add-in will be tested by a script. It works on the active view; nothing is picked. When a file named {{ADDIN_NAME}}.input.json exists next to the add-in DLL, do not show the dialog and do not show any message box: take the values from that file, and when the command ends write {{ADDIN_NAME}}.result.json next to the DLL as {"result": "Succeeded" | "Cancelled" | "Failed", "message": "..."}. Without the input file the add-in behaves normally, with its dialog. The input file is:
    {"floor_finish": "Porcelain tile 600x600", "base_finish": "Tile skirting 100", "wall_finish": "Emulsion paint, white", "ceiling_finish": "Mineral fibre tile", "ceiling_height_mm": 2700}
    The ceiling height is in millimetres.

These are the prompts as the agents received them; every condition used the same prompt. Each run had its own working directory and a limit of 60 minutes, and ran unattended; the model file was never saved during the tests.

The automatic test, step by step

Whether an add-in completed the task cannot be judged by whether the code compiles. It has to run in a real Revit model and the result has to be checked. The traditional approach hands a screenshot of the run to a vision model, which costs vision tokens on every test. My approach reads the model data before and after the run and lets a script compare concrete geometric values and properties; screenshots are kept only as a record of anomalies or for a person to review, and take no part in the scoring.

The other important change is how the user’s click is simulated. Traditional automation usually takes a screenshot to locate the element and then computes the click coordinates; when the view changes, the picture may have to be analysed again. Now, the mapping between the Revit view information and model coordinates gives the screen position of the target element directly, and a seeded random number generates a reproducible click point. A click at a given position, or a series of operations, can be done without recognising screenshots again and again, which lowers the cost of locating things and speeds up the test.

Each product is accepted in seven steps:

  1. Read the baseline: record the ID, type, size, position and mark of every wall, door and window in the model.
  2. Prepare the input: write the input file next to the product’s DLL, with the sizes and positions the dialog would have asked for.
  3. Generate the click point: from a fixed seed and the product’s code name, draw a random fraction between 0.30 and 0.70 of the test wall’s length, so that the click position is reproducible and differs per product.
  4. Pick: map the model coordinates linearly to screen pixels from the view’s window rectangle and zoom corners; start the add-in’s command and click the target position, and confirm that the element actually picked is the test wall.
  5. Read the result: wait for the add-in to write its result file, at most 180 seconds. Unexpected dialogs are handled through window messages, not simulated mouse clicks.
  6. Check the model changes: read the model again and compare it with the baseline item by item. The wall task has 19 checks: the wall is 10 mm thicker, a finish layer is added, the door and the window are created with the right family, type, size, position, mark and sill height, and no other element is changed by accident.
  7. Restore the initial state: undo this round’s operations and confirm that the model equals the baseline again before the next product is tested.

Compared with screenshot-based testing, the differences are mainly these:

StepBefore: a model looks at screenshotsNow: read the data, a script judges
Right or wrongA screenshot of the view after the run goes to a model, which says whether it is rightThe model is read before and after, and real geometry and properties are compared item by item: wall thickness, layer count, size and position of doors and windows, marks, parameter values, element counts
Choosing where to testFind the element on a screenshot, then clickModel coordinates are converted to screen pixels by element id and picked directly; the point on the wall is random for each product (fixed seed, reproducible), so a product cannot pass by hard-coding a position
Unwanted changesCannot be seenWalls, doors, windows and rooms that were not meant to change are compared too; one extra change loses a point
PicturesThe basis of the verdictOne is taken only when a product does not finish or a person needs to review, as evidence
CostA vision model call for every verdict0 model tokens; the latest batch of 78 products was judged in two passes, about 12 minutes in total

This testing ability is part of the revit-addin-test Skill that ships with revit-bridge 0.7.0; the Revit side needs revit-bridge-addin 0.5.0. An agent connected to the Bridge can test its own work with test_addin_command: load the DLL in the open model, locate and click by element ID, provide the input file, read the result together with the added, modified and deleted elements and the warnings, and finally restore the model.

Share of tasks completed

“Completed” is defined here as: at least 17 of the 19 checks passed for the wall task, and at least 13 of the 15 checks for the room task. Each line was planned to run 5 rounds under each condition; a few invalid runs are left out of the counts.

Horizontal bar chart: share of tasks completed. Wall task: N native 8 / 19 (42%), K skills only 6 / 20 (30%), KR skills variant 8 / 19 (42%), S3 full setup 20 / 20 (100%). Room task: N native 11 / 19 (58%), K skills only 10 / 20 (50%), S3 full setup 18 / 18 (100%). Only S3 had the bridge.

Broken down by line:

LineWall NWall KWall KRWall S3Room NRoom KRoom S3
OpenAI1 / 50 / 51 / 55 / 53 / 54 / 54 / 4
Grok2 / 41 / 50 / 45 / 53 / 41 / 54 / 4
DeepSeek0 / 53 / 55 / 55 / 50 / 50 / 55 / 5
Gemini5 / 52 / 52 / 55 / 55 / 55 / 55 / 5
Total8 / 196 / 208 / 1920 / 2011 / 1910 / 2018 / 18

KR is an experimental variant that adds the rule “refuse only after verifying the condition” to the Skills condition; it was used for the wall task only.

Under S3, every valid run of all four lines met the completion bar. Without the Bridge the groups varied widely, from 0/5 to 5/5. The K group with Skills only completed 16/40, no better than the native N group’s 19/38. With only 4 to 5 valid runs per group, these numbers are suited to seeing the effect of the tool conditions and should not be used to rank the models.

What goes wrong without the bridge

The two tasks exposed different kinds of problems, but most of them come from the agent not being able to check the real model and the run result in time.

Wall task: the product refuses to run

Some products check the wall type with IsVerticallyCompound, judge the test wall to be a “vertically compound wall” that should not be handled, and refuse to run. The chart below counts the products that contain this check.

Horizontal bar chart: share of wall-task products whose source contains the IsVerticallyCompound check. N native 7 / 19, K skills only 13 / 20, KR skills variant 9 / 19, S3 full setup 0 / 20.

In this test, agents with the Skills installed added this check more often, not less. Adding the “verify before refusing” constraint in the KR group did not fully prevent it either; the full S3 setup never showed this failure.

Room task: errors at run time

The room task had no case of a deliberate refusal. The N and K groups together failed the task 18 times, for these reasons:

CauseCount
Casting a door or window family instance to a room tag type5
Filtering by a class Revit does not accept (Room, RoomTag)4
No rooms found after filtering by phase1
Ceiling height written wrongly (units not converted, or written to another parameter)6
No runnable product2
Total18

Time, tokens and cost

The running cost of each line is summarised below. All four lines use the prompt cache heavily; newly billed input is only 2% to 9% of all prompt tokens.

Dot plot, axis from 85% to 100%: cache hit rate (cache reads divided by all prompt tokens), OpenAI 91.7%, Grok 94.0%, DeepSeek 98.3%, Gemini 93.2%.

Two horizontal bar charts: mean minutes per valid run, OpenAI 8.8, Grok 30.9, DeepSeek 16.0, Gemini 34.6; mean cost per valid run in US dollars at list price, OpenAI 0.63, Grok 3.22, DeepSeek 0.36, Gemini 2.22.

The figures for each line:

LineRuns / validAgent run timePrompt tokensCache hitOutput tokensCost per runTotal cost
OpenAI39 / 345.2 h39.6 M91.7%1.04 M$0.63$22.49
Grok44 / 3120.0 h161.3 M94.0%3.78 M$3.22$117.72
DeepSeek36 / 359.4 h141.5 M98.3%3.17 M$0.36$12.74
Gemini35 / 3520.2 h162.3 M93.2%3.29 M$2.22$77.85
Total154 / 13554.7 h504.7 M94.8%11.3 M$230.80

Prompt tokens include cache reads. The four CLIs count tokens differently, so this article uses one definition: all prompt tokens = new input + cache reads. All costs are estimated from token usage and public list prices and are not bills; Grok is computed at 2 US dollars per million input tokens, 0.5 for cached input and 6 for output. Total cost includes invalid runs.

Limits of these results

  • Small sample: each group has only 4 to 5 valid runs, and the test covers two tasks and one model file, so the results of the lines should not be read as a ranking of model ability.
  • The effect of Skills depends on the task: “Skills only is no better than native” points the same way in both tasks, but the wall-task result is strongly affected by one and the same wrong refusal.
  • A task depends on the model in a way the prompt does not state: the room task needs the ceiling height written into a particular project parameter, which the prompt does not name. An agent that cannot see the model can only guess. Counting only “the add-in ran and changed the model”, native is 14/19, Skills only 13/20 and the full setup 18/18.
  • The KR comparison has a time gap: each line was tested only 4 to 5 times.
  • Invalid runs: 19 runs were voided for harness problems, network errors or isolation-audit hits and are not part of the completion rate; 3 more produced no product that could be judged and count as not completed.

Reference materials

The full interactive report is on the main site: