Skip to content

Effortlessly document C# projects with MDLabs Research Team Project using AutoGen. This AI-powered tool analyzes your code and generates comprehensive markdown documentation, ensuring consistency and up-to-date records without ongoing maintenance.

License

Notifications You must be signed in to change notification settings

montraydavis/MDLabs-ResearchTeam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MDLabs Research Team Project - Technical Documentation

Table of Contents

  1. Introduction
  2. Project Structure
  3. Key Features
  4. Namespaces
  5. Workflow
  6. Benefits
  7. Future Development
  8. Architecture and Technology Stack

Introduction

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 and Reflection 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.

Project Structure

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.

Key Features

  1. Automated Code Analysis: Analyzes C# codebases to extract detailed information about classes, methods, and their relationships.
  2. Intelligent Documentation Generation: Uses advanced language models to generate comprehensive, well-structured documentation for C# projects.
  3. Customizable Templates: Uses customizable templates to guide the documentation process, ensuring consistency and clarity.
  4. Multi-threaded Processing: Designed to handle large-scale projects efficiently using multi-threaded processing.
  5. Extensible Architecture: Modular design allows for easy integration of new features and analysis techniques.

Namespaces

MDLabs.ResearchTeam.Agents

  • BaseSemanticAgent: Foundation for creating specialized agents.
  • CSharpAnalysisAgent: Focused on C# code analysis.
  • CSharpDocumentationAgent: Generates documentation for C# code.

MDLabs.ResearchTeam.Mediation

  • CSharpFileProcessingNotification: Notifies about C# file processing events.
  • CSharpProcessingMediatR: Coordinates C# processing tasks across the application.

MDLabs.ResearchTeam.ProjectAnalysis

  • CSharpProjectAnalyzer: Main class for analyzing C# projects.
  • ProjectClassDefinitionInfo and ProjectMethodDefinitionInfo: Store detailed information about classes and methods.
  • SourceCodeDecompiler: Extracts source code from compiled assemblies.

Workflow

  1. System analyzes a C# project, extracting information about its structure, classes, and methods.
  2. Information is processed and organized using the classes in the ProjectAnalysis namespace.
  3. Agents namespace components use this structured data to generate documentation.
  4. Mediation namespace ensures smooth communication between different parts of the system during this process.
  5. System produces comprehensive, well-formatted documentation for the analyzed codebase.

Benefits

  • 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.

Future Development

Next Steps

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:

Enhanced Assembly Analysis

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.

Memories

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.

Custom Documentation Pipelines

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.


Architecture and Technology Stack

1. AutoGen

Description: Framework for building Large Language Model (LLM) applications using multiple agents.

Role in the Application:

  • Powers BaseSemanticAgent, CSharpAnalysisAgent, and CSharpDocumentationAgent.
  • 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.

2. ICSharpCode.Decompiler

Description: .NET decompiler library that converts compiled assemblies back into readable C# code.

Role in the Application:

  • Used in MDLabs.ResearchTeam.ProjectAnalysis namespace, particularly in SourceCodeDecompiler 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.

3. MediatR

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 and ProcessCSharpSourceFileCommand.
  • Enables modular and maintainable architecture by reducing direct dependencies.

4. Handlebars.Net

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.

5. Microsoft.NET.Sdk.Worker

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.

6. Microsoft.Extensions

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.

About

Effortlessly document C# projects with MDLabs Research Team Project using AutoGen. This AI-powered tool analyzes your code and generates comprehensive markdown documentation, ensuring consistency and up-to-date records without ongoing maintenance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published