Why Markdown alone fails for RAG over old C# code
Turning a messy old C# codebase into clean Markdown for RAG is harder than simply extracting classes, methods, comments, and naming patterns. The important are often spread across many services and classes. Some rules only appear inside conditions, , quick fixes, or the full path a program follows while running.
Even well-organized Markdown can look complete but still miss the context between steps, the links between rules, important , and the real business reason behind the code. Splitting by class or method, grouping by feature, and adding clues from comments or names do not fully solve this. A useful answer separates code structure from business intent.
Code structure should stay as a graph of relationships, built from tools like AST analysis, Roslyn, or , so retrieval can bring in a method plus nearby callers and callees instead of one isolated chunk. Business intent often is not fully present in the code, so it needs to be connected from , , tickets, and people’s knowledge.
Key points
- Old C# systems often hide across services, classes, conditions, , and quick fixes.
- Markdown grouped by class or feature can miss execution flow and rule .
- A graph of code relationships is better suited than flat prose for showing what calls what.
- Retrieval should bring in the target method plus nearby callers and callees, not just one isolated chunk.
- Business intent should be linked from , , tickets, and team knowledge.