Graph-Powered Codebase Assistant
M.Sc. thesis at Siemens Mobility: GraphRAG for safety-critical code. Final grade 1.3 (sehr gut). The closed-source predecessor of codescope.
Summary
M.Sc. thesis at TU Berlin, hosted at Siemens Mobility. A two-stage retrieval system that combines a Knowledge Graph of source code with vector embeddings to answer questions about safety-critical codebases. Reduced developer onboarding time by ~30%. Final grade: 1.3 (sehr gut). Tested on repositories with 30,000+ files.
The problem
LLMs answer code questions confidently and frequently wrongly — they lack structural awareness of imports, calls, inheritance, and cross-file dependencies. In safety-critical codebases like Siemens Mobility's, that gap costs weeks of developer onboarding time before anyone can contribute.
Approach
- 01Parse the repo with Tree-sitter into typed nodes (File, Class, Function) and edges (CONTAINS, IMPORTS, CALLS, EXTENDS).
- 02Persist the graph in Neo4j; embed every node with OpenAI and index in FAISS.
- 03At query time: vector-recall candidate nodes, then traverse the graph N hops to assemble structural context.
- 04Feed the structured context window to an LLM with citation-style references back to graph nodes.
Results
- →~30% reduction in developer onboarding time on Siemens Mobility codebases
- →Final M.Sc. grade 1.3 (sehr gut)
- →Answers cite specific functions/files instead of hallucinating
- →Works on 30k+ file repos with checkpoint-resumable indexing
- →Companion visualizer makes every retrieval step inspectable
Highlights
- ·~30% onboarding time reduction (Siemens Mobility user studies)
- ·Final grade 1.3 (sehr gut)
- ·Two-stage RAG: vector search + graph traversal
- ·Multi-language parsing (Python, C, C++) via Tree-sitter
- ·Resumable enrichment that survives API rate limits
- ·Scales to 30k+ file repositories