An AI-powered code documentation generator that automatically analyzes repositories and creates comprehensive documentation using advanced language models. The system employs a multi-agent architecture to perform specialized code analysis and generate structured documentation.
Read the full story behind this project:
- 🇺🇸 English: Docs That Don’t Rot: How Multi-Agent AI Rewrote Our Workflow
- 🇮🇷 از دستیار کدنویس تا همکار هوشمند؛ گام اول: کابوس مستندسازی
- Multi-Agent Analysis: Specialized AI agents for code structure, data flow, dependency, request flow, and API analysis
- Automated Documentation: Generates comprehensive README files with configurable sections
- GitLab Integration: Automated analysis for GitLab projects with merge request creation
- Concurrent Processing: Parallel execution of analysis agents for improved performance
- Flexible Configuration: YAML-based configuration with environment variable overrides
- Multiple LLM Support: Works with any OpenAI-compatible API (OpenAI, OpenRouter, local models, etc.)
- Observability: Built-in monitoring with OpenTelemetry tracing and Langfuse integration
- Python 3.13
- Git
- API access to an OpenAI-compatible LLM provider
- Clone the repository:
- Install using uv (recommended):
- Or install with pip:
- Set up your environment and configuration:
- Run analysis and generate documentation:
Generated documentation will be saved to .ai/docs/ directory.
The tool automatically looks for configuration in .ai/config.yaml or .ai/config.yml in your repository.
- Exclude specific analyses: Skip code structure, data flow, dependencies, request flow, or API analysis
- Customize README sections: Control which sections appear in generated documentation
- Configure cronjob settings: Set working paths and commit recency filters
You can use CLI flags for quick configuration overrides. See config_example.yaml for all available options and .env.sample for environment variables.
The system uses a multi-agent architecture with specialized AI agents for different types of code analysis:
- CLI Layer: Entry point with command parsing
- Handler Layer: Command-specific business logic (analyze, document, cronjob)
- Agent Layer: AI-powered analysis and documentation generation
- Tool Layer: File system operations and utilities
- Python 3.13 with pydantic-ai for AI agent orchestration
- OpenAI-compatible APIs for LLM access (OpenAI, OpenRouter, etc.)
- GitPython & python-gitlab for repository operations
- OpenTelemetry & Langfuse for observability
- YAML + Pydantic for configuration management
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with pydantic-ai for AI agent orchestration
- Supports multiple LLM providers through OpenAI-compatible APIs (including OpenRouter)
- Uses Langfuse for LLM observability
.png)


