- Introduction
- Project Structure
- Key Features
- Namespaces
- Workflow
- Benefits
- Future Development
- Architecture and Technology Stack
The MDLabs Research Team
Project is an innovative AI application aimed at generating thorough documentation for the entire codebase of a C# solution. Utilizing sophisticated methods in code analysis and natural language processing, this project facilitates the analysis, documentation, and upkeep of complex C# codebases, thereby optimizing software development processes.
Project Analysis:
The project employs the MDLabs.ResearchTeam.ProjectAnalysis
namespace, which features:
- CSharpProjectAnalyzer: Conducts analysis of C# projects, retrieves class and method information, and uses
ICSharpCode.Decompiler
andReflection
for comprehensive project analysis. - SourceCodeDecompiler: Decompiles source code to support detailed analysis.
Documentation Generation:
Natural language processing and machine learning are utilized to convert analyzed data into markdown formatted documentation. The MDLabs.ResearchTeam.Mediation
namespace ensures efficient task handling with threading and mediation. Handlebars.Net is used to create dynamic and adaptable documentation templates.
Maintainability: A standout feature of this project is the lack of ongoing maintenance work. Apart from initial LLM configuration and occasional tweaking of outputs, the system requires no additional maintenance. This efficiency is achieved through sophisticated project analysis and automated documentation generation.
Fully Automated: Seamlessly connect any compile-ready C# project with minimal coding, adjust the LLM settings, and generate markdown formatted documentation. The application employs threading and mediation to conduct assembly analysis and documentation generation in parallel.
The project is organized into several key namespaces:
MDLabs.ResearchTeam.Agents
: Handles semantic agents for code analysis and documentation generation.MDLabs.ResearchTeam.Mediation
: Manages communication between different components using the Mediator pattern.MDLabs.ResearchTeam.ProjectAnalysis
: Provides tools for analyzing C# projects, including class and method information retrieval.
- Automated Code Analysis: Analyzes C# codebases to extract detailed information about classes, methods, and their relationships.
- Intelligent Documentation Generation: Uses advanced language models to generate comprehensive, well-structured documentation for C# projects.
- Customizable Templates: Uses customizable templates to guide the documentation process, ensuring consistency and clarity.
- Multi-threaded Processing: Designed to handle large-scale projects efficiently using multi-threaded processing.
- Extensible Architecture: Modular design allows for easy integration of new features and analysis techniques.
BaseSemanticAgent
: Foundation for creating specialized agents.CSharpAnalysisAgent
: Focused on C# code analysis.CSharpDocumentationAgent
: Generates documentation for C# code.
CSharpFileProcessingNotification
: Notifies about C# file processing events.CSharpProcessingMediatR
: Coordinates C# processing tasks across the application.
CSharpProjectAnalyzer
: Main class for analyzing C# projects.ProjectClassDefinitionInfo
andProjectMethodDefinitionInfo
: Store detailed information about classes and methods.SourceCodeDecompiler
: Extracts source code from compiled assemblies.
- System analyzes a C# project, extracting information about its structure, classes, and methods.
- Information is processed and organized using the classes in the ProjectAnalysis namespace.
- Agents namespace components use this structured data to generate documentation.
- Mediation namespace ensures smooth communication between different parts of the system during this process.
- System produces comprehensive, well-formatted documentation for the analyzed codebase.
- Time-saving: Automates the tedious process of code documentation.
- Consistency: Ensures uniform documentation style across large projects.
- Up-to-date Documentation: Easily regenerate documentation to reflect code changes.
- Improved Code Understanding: Provides clear, structured insights into complex codebases.
- Scalability: Designed to handle projects of various sizes efficiently.
We are excited to share our upcoming features and enhancements that will take our project to the next level. Stay tuned for the following improvements:
We will be implementing a mechanism to generate dependency trees, which will assist in generating all relevant functionality of a given dependency. This feature will analyze all C# source files related to a specific feature (e.g., feature xyz) prior to documentation generation, ensuring comprehensive and accurate documentation.
To boost performance and efficiency, we will introduce memory and caching mechanisms. This enhancement will store relevant information during processing, reducing redundant computations and speeding up overall operations.
We aim to provide greater flexibility in documentation generation by allowing users to build custom pipelines. This feature will enable you to tailor documentation inputs and outputs to your specific needs, including the integration of external data sources for more enriched documentation.
Description: Framework for building Large Language Model (LLM) applications using multiple agents.
Role in the Application:
- Powers
BaseSemanticAgent
,CSharpAnalysisAgent
, andCSharpDocumentationAgent
. - Enables intelligent code analysis by interpreting and reasoning about code structures.
- Facilitates generation of human-readable documentation from code analysis results.
- Allows for dynamic, context-aware interactions between system components.
Description: .NET decompiler library that converts compiled assemblies back into readable C# code.
Role in the Application:
- Used in
MDLabs.ResearchTeam.ProjectAnalysis
namespace, particularly inSourceCodeDecompiler
class. - Enables
CSharpProjectAnalyzer
to extract detailed information from compiled assemblies. - Retrieves source code for methods and classes, even when original source is unavailable.
- Crucial for generating accurate documentation for pre-compiled libraries or projects.
Description: Simple mediator implementation in .NET for reducing direct dependencies between objects.
Role in the Application:
- Central to
MDLabs.ResearchTeam.Mediation
namespace. - Implements Mediator pattern to decouple various system components.
- Used in
CSharpProcessingMediatR
to manage C# processing tasks flow. - Facilitates handling of
CSharpFileProcessingNotification
andProcessCSharpSourceFileCommand
. - Enables modular and maintainable architecture by reducing direct dependencies.
Description: .NET port of the Handlebars templating engine for creating semantic templates.
Role in the Application:
- Used in
CSharpDocumentationAgent
for generating structured documentation. CSharpClassInfo.hbs
template in ProjectAnalysis namespace defines class documentation format.- Separates documentation content and presentation for easier maintenance and updates.
- Enables dynamic generation of documentation adaptable to different code structures and requirements.
Description: SDK for building long-running background services in .NET.
Role in the Application:
- Provides foundational structure for the application as a background service.
- Enables continuous running, processing code analysis and documentation tasks as needed.
- Facilitates integration with dependency injection, logging, and configuration systems in .NET.
- Allows easy deployment and management in various environments, including containerized setups.
Description: Set of .NET libraries for common programming patterns and utilities.
Role in the Application:
- Dependency Injection: Manages object creation and lifetime, promoting loose coupling and modularity.
- Logging: Implemented via
ILogger
for consistent and configurable logging across components. - Configuration: Enables flexible configuration management for different environments or use cases.
- Options Pattern: Used for strongly-typed access to related settings, enhancing type safety and ease of use.