When CNC 'Speaks' — Intelligent Process Planning Driven by Large Models and Knowledge Graphs
Abstract
CNC machining process planning—including tool selection, cutting parameter determination, operation sequencing, and fixture design—has long relied on engineers' personal experience and scattered paper manuals, making it the most difficult to standardize and pass down in the manufacturing chain. The emergence of large language models (LLMs) has raised hopes for "letting machines automatically write process plans." However, LLMs' "hallucination" issues in precision machining numerical decisions render them nearly unusable in ±5μm tolerance scenarios. This paper systematically analyzes the technical route of integrating knowledge graphs with LLMs—using a retrieval-augmented generation (RAG) architecture, where the structured machining knowledge graph serves as "external memory," the LLM is only responsible for understanding user intent and generating traceable answers, and all specific values (tool diameter, cutting speed, feed rate) are precisely retrieved from the graph. Using tool selection and feed speed optimization as examples, it demonstrates how a knowledge graph-LLM integrated system handles real process inquiries like "machining an Inconel 718 ring groove, which tool and cutting parameters to use" and provides verifiable answer sources. It further explores feasible paths for deploying such systems within enterprises—converting thousands of accumulated process cards, tool test reports, and quality anomaly analyses into proprietary enterprise knowledge graphs, allowing "process experience" to "overflow" from technicians' minds into queryable, inferable, and updatable digital assets, offering CNC workshops a low-cost path from "experience-driven" to "knowledge-driven."
I. The Knowledge Dilemma of Process Planning
CNC machining process planning is essentially a decision-making process seeking optimal solutions under constraints. Engineers must simultaneously consider: workpiece material (hardness, toughness, thermal conductivity), available tools in the tool library (coating, diameter, flute length), machine performance (spindle power, speed range, rigidity), machining accuracy requirements (dimensional tolerance, geometric tolerance, surface roughness), and production efficiency goals (cycle time per part). A typical process decision tree can have hundreds of branches, yet most small and medium-sized manufacturers' process capabilities rely heavily on the "personal database" of one or two senior engineers.
This "human brain as process library" model faces three crises: first, the retirement or departure of senior technicians takes away the company's core process knowledge; second, new materials and tools emerge constantly, and personal experience updates cannot keep pace with technological iterations; third, the trend of high-mix, low-volume production requires each new part to start process planning "from scratch," resulting in extremely high time costs.
Traditional computer-aided process planning (CAPP) systems attempt to solidify process knowledge using rule bases and decision tables, but their "hard-coded" nature makes them helpless when faced with unseen part geometries or new material states.
II. Knowledge Graphs: Making Process Knowledge from "Tacit" to "Explicit"
A knowledge graph is a structured database representing knowledge using "entity-relation-entity" triples. In the CNC machining domain, process knowledge can be modeled as follows:
(Entity) Inconel 718 [Material Property] (Entity) Hardness HRC45, Thermal Conductivity 11.4 W/m·K
(Entity) Ring Groove Feature [Recommended Tool Type] (Entity) Solid Carbide Ball Nose End Mill
(Solid) Solid Carbide Ball Nose End Mill + AlTiN Coating [Recommended Cutting Speed] (Solid) 25-35 m/min
(Solid) Cutting Speed 30 m/min + Tool Diameter 12mm [Calculated Spindle Speed] (Solid) 796 rpm
The advantage of this structured representation is that data is precise and traceable, with each recommended value linked to a specific technical source (e.g., a tool test report or a cutting handbook); the reasoning chain is clear, allowing users to see the complete logic of 'because A, therefore B'; and it is easy to update, as new process test results can be added to the knowledge graph at any time, keeping the knowledge base 'alive'.
3. Large Language Model + Knowledge Graph: Combining Precision and Flexibility
The strength of large language models (such as GPT-4, Llama-3, etc.) lies in natural language understanding and generation—engineers can ask questions in everyday language like 'What tool should I use to machine this part?' without needing to learn structured query languages. However, a persistent issue with LLMs is that they are prone to 'hallucinations' in precise numerical decisions—for example, suggesting a non-existent tool diameter or recommending a cutting speed beyond the tool's allowable range, making it difficult for process engineers to verify the answer's accuracy due to a lack of confidence in its correctness.
Retrieval-Augmented Generation (RAG) architecture offers a solution. Its workflow is:
Engineers ask process consultation questions in natural language (e.g., 'Recommend tools and parameters for machining deep grooves in Ti6Al4V material, diameter 10mm, depth 25mm')
The system vectorizes the question and retrieves the most relevant entities and relationship subgraphs from the knowledge graph
The retrieved structured triples are 'embedded' into the LLM's context window as the 'evidence base' for generating answers
The LLM is only responsible for organizing the precise data from the graph into natural language responses, along with data source citations
This approach strictly constrains the LLM's 'creative generation' capability within the available data range, ensuring every output value can be traced back to a specific source stored in the graph
Experimental studies show that the knowledge graph-enhanced LLM process planning system improves multiple-choice accuracy by 16.6 percentage points and F1 score by 16.5 percentage points across 280 industrial process test questions, including tool selection, feed rate optimization, and tolerance diagnosis. More importantly, this architecture allows enterprises to deploy smaller-parameter large models locally (rather than relying on cloud-based giant models), achieving answer accuracy comparable to super-large models while protecting process data security
IV. Enterprise Internal Deployment: From 'Process Card Library' to 'Process Knowledge Graph'
For most CNC machining enterprises, building a knowledge graph does not start from scratch. Companies typically have accumulated a large amount of structured or semi-structured process materials:
Process cards: Record the process flow, equipment selection, and cutting parameters for each typical part
Tool test reports: Record the life test data for different tool-material combinations
Quality Anomaly Analysis: Records root cause analysis and corrective actions for processing defects
CAM Program Library: Verified toolpath strategies and parameter combinations
The core tasks of converting these materials into a knowledge graph include: defining entity types (materials, tools, machine tools, processing features, process parameters, quality indicators) and relationship types ("applicable", "recommended", "constrained", "causes"); using automated information extraction tools (LLM can be used for initial screening, followed by process experts reviewing key triples) to extract structured knowledge from unstructured text.
Once the graph is built, its application scenarios go far beyond a "Q&A system":
New Employee Training: New process engineers can quickly learn about typical enterprise process solutions through queries
Process Review: The system can automatically check whether new process procedures are consistent with the "best practices" in the knowledge graph and flag anomalies
Continuous Optimization: Each successful process improvement trial result enters the knowledge graph, enabling the knowledge base to evolve synchronously with production practice
V. Limitations and Outlook
The Knowledge Graph-LLM fusion system is not a panacea. The quality of its responses is strictly limited by the coverage of the graph—for new materials or entirely new geometric features that the enterprise has never processed, the system cannot provide answers and still relies on engineers' design experiments. Additionally, the construction and maintenance of the graph require continuous human investment. However, from the long-term perspective of manufacturing knowledge management, transforming 'human brain experience' into an 'enterprise-queryable digital knowledge base' is an inevitable choice to cope with the retirement wave of aging skilled workers. The combination of large language models and knowledge graphs provides the CNC machining industry, for the first time, with an engineering path to systematize, verify, and sustainably evolve 'tacit experience'—not to replace process engineers with AI, but to make AI an 'ever-tireless process assistant' for engineers.
BQUQ is a professional CNC production expert. Please send us the drawings, and we will provide you with a quotation within 12 hours.
Frequently Asked Questions
How does the knowledge graph-LLM system prevent errors in precision machining decisions?
The system uses a retrieval-augmented generation (RAG) architecture where the structured machining knowledge graph acts as 'external memory.' The LLM only understands user intent and generates traceable answers, while all specific values like tool diameter, cutting speed, and feed rate are precisely retrieved from the graph, avoiding hallucination in ±5μm tolerance scenarios.
Can the system handle complex material-specific queries like Inconel 718?
Yes, the article demonstrates the system handling real process inquiries such as 'machining an Inconel 718 ring groove, which tool and cutting parameters to use.' It retrieves precise tool and cutting data from the knowledge graph and provides verifiable answer sources, ensuring accuracy for demanding materials.
What types of enterprise data can be converted into the knowledge graph?
The system can convert thousands of accumulated process cards, tool test reports, and quality anomaly analyses into proprietary enterprise knowledge graphs. This transforms scattered process experience into queryable, inferable, and updatable digital assets, enabling a low-cost shift from 'experience-driven' to 'knowledge-driven' CNC workshops.
How does this system address the risk of losing process knowledge when senior engineers leave?
By digitizing process experience into a knowledge graph, the system ensures core knowledge remains within the company even after senior technicians retire or depart. It also keeps pace with new materials and tools, and supports high-mix, low-volume production by reducing the need to start process planning from scratch for each new part.

