Local RAG for CAD API: How to Overcome Knowledge Shortage of Proprietary Interface
Hexagon
An engineer faced the need for automation in Smart3D, but API knowledge was a bottleneck. He built a local RAG pipeline: decompiled libraries, extracted facts, enriched them via LLM, created embedding indices, and implemented an agent with verification — so the model generates code relying only on actual API entities.
An author working with Hexagon's Smart3D (Intergraph Smart 3D) CAD system faced an automation challenge: knowledge of the proprietary API was expensive and hard to access, while public LLMs generated fictitious methods due to data scarcity. He decided to build a local RAG pipeline that extracts knowledge from the system's own libraries. First, he decompiled the compiled Smart3D assemblies and wrote a parser to extract signatures, XML documentation, and facts from method bodies (calls, exceptions, created objects). Then he used a language model to enrich this data: formulating usage scenarios and search hints, strictly limiting to only confirmed facts. For embeddings, he chose the multilingual model bge-m3, as engineers' queries are bilingual (Russian and English). Entity cards served as chunks, containing the signature, description, facts, and hints. The result was an agent that finds relevant entities via vector search, uses them as context for generating C# code, and verifies the result by referencing the source data. The system is already in use on a real project to accelerate automation.
Source: Habr — хаб NLP —
original
