Abstract:The high coupling of components and the concealed nature of cascading faults in spacecraft electromechanical devices impose stringent demands on the reasoning efficiency and interpretability of fault diagnosis systems. To address the challenges of high construction costs associated with traditional knowledge graphs (KG), the lack of domain-specific expertise in general-purpose large language models (LLM), and the insufficient associative reasoning capability of retrieval-augmented generation (RAG) in textual knowledge-driven intelligent fault diagnosis, this study proposes an ontology-constrained knowledge graph-RAG fault diagnosis method. Firstly, a four-layer fault diagnosis ontology framework is constructed. Utilizing ontology-injected prompt learning, the LLM achieves standardized extraction of multi-source diagnostic knowledge. A dynamic integration and updating mechanism for the knowledge graph, based on dual-layer similarity calibration involving character comparison and an embedding model, is implemented to autonomously build an integrated diagnostic knowledge graph base. Secondly, leveraging entity fuzzy retrieval that combines LLM and word embeddings, along with a power-encoding-based instant knowledge graph distillation method, the approach incorporates fault subgraph structural features and contextual knowledge while visualizing fault propagation paths via graph nodes. This significantly enhances the logical completeness of fault root cause analysis and maintenance strategy generation by the general-purpose LLM. Validation using diagnostic texts and FMEA tables of the solar array drive assembly (SADA) shows that, compared with traditional RAG methods, the proposed KG-RAG method combined with fault subgraphs improves the keyword F1-score by 70.88% and semantic similarity by 11.60% in intelligent diagnostic Q&A. The results show superior accuracy and interpretability over using LLM or RAG alone, providing substantial theoretical support and a technical pathway for intelligent fault diagnosis of spacecraft electromechanical equipment.