[Master’s Thesis] Structure-Aware Enhanced LLMs via Knowledge Graphs for Microservice Architecture Documentation

Mr. Qiao Lin, an M2 student in our research group, has submitted his master’s thesis.

Title:Structure-Aware Enhanced LLMs via Knowledge Graphs for Microservice Architecture Documentation
Abstract:

Microservice documentation is critical yet hard to maintain due to its complex and distributed architecture. Developers use Large Language Models (LLM) with Retrieval Augmented Generation (RAG) to automate the creation and update of Microservice documentations, however, this approach has limitations. Standard RAG using naive semantic retrieval is blind to the high level, global structural dependencies among services and relies solely on semantic similarity. As a result, LLMs suffer from missing key dependencies and information during generation and lead to hallucinated and inaccurate documentation.

In this thesis, we proposed a novel Graph enhanced structure-aware Retrieval Augmented Generation (RAG) framework that integrates Knowledge Graphs with Graph Neural Networks (GNN). We demonstrated the framework’s effectiveness by comparing its documentation generation result against those generated with zero context baseline approach and standard semantic RAG approach across ten diverse microservice repositories.
We proved that graph structure, when modeling the actual microservice architecture and provided to LLM as context, can improve the retrieval of structurally important dependencies that semantic search misses.

Furthermore, we showed that our GNN based ranking strategy optimizes the context window utilization by promoting architecturally critical context. Our proposed approach effectively reduces LLM hallucinations and improves the quality across all quality metrics of the generated microservice documentations, addressing current limitations in this field.

A list of other theses and dissertations from our research group can be found here.