The industry is used to drowning AI hallucinations in terabytes of weights, but in the world of engineering software, this extensive path has hit a dead end. As the development of the KOMPAS Guard v0.6.2 stack demonstrates, even top-tier LLMs surrender when faced with the 19,000 pages of KOMPAS-3D documentation. When an agent tries to "guess" the correct API method, it inevitably begins to fantasize, generating non-existent code.

In this system, the protection mechanics were moved to the "digital hardware" level: the right to exist for any method is now confirmed by a type graph, signatures are verified by a C# compiler, and the final inspection is conducted by a live instance of the CAD system. With such a filter in place, the AI loses the physical possibility of lying.

The shift from guessing to discipline

Instead of feeding the agent data in hopes of "scale magic," the authors introduced discipline and taught a compact model to link engineering slang to specific code paths.

The main barrier for a long time was the gap between casual human language and a rigid API. To stop the agent from playing a guessing game, the developers scrapped heavy re-rankers, replacing them with the tiny USER2-small encoder featuring just 34 million parameters. The model was trained on 200,000 data pairs, including clever synthetic queries where the AI was forbidden from naming methods by name—it was required to describe the task itself.

Training took less than five hours on a single GPU, and the results put general-purpose models to shame. In live query tests, the Hit@5 accuracy skyrocketed from near-zero values to an impressive 80%.

Narrow specialization and rigid compiler oversight consistently outperform giant architectures. A base version without fine-tuning failed 90% of queries, proving that size does not guarantee reliability. The optimized "tiny" model transitioned the system from a conference demo to a production-ready tool.

Stripped of the marketing fluff, this is a classic case of why precision beats brute force. By enforcing architectural constraints and using a specialized encoder, the developers transformed a hallucinating bot into a reliable engineering assistant.

AI AgentsFine-tuningRAG and Vector SearchAutomationKOMPAS-3D