DocAgent  by facebookresearch

Automated Python docstring generation system

created 3 months ago
297 stars

Top 90.4% on sourcepulse

GitHubView on GitHub
Project Summary

DocAgent is a system designed to automate the generation of high-quality, context-aware docstrings for Python codebases. It targets developers and researchers seeking to improve code maintainability and understanding, particularly in large projects, by addressing the limitations of current LLM-based documentation tools.

How It Works

DocAgent employs a multi-agent system comprising Reader, Searcher, Writer, and Verifier agents, coordinated by an Orchestrator. This architecture allows for specialized tasks like context gathering and verification. It also utilizes a hierarchical traversal strategy, processing code components based on their dependencies, starting with less dependent files. This approach aims to build a documented foundation, enabling better contextual understanding for more complex code.

Quick Start & Requirements

  • Install via pip: pip install -e .
  • Requires Python 3.x.
  • Optional extras for development tools or web UI: pip install -e ".[dev,web]"
  • Configuration requires creating and editing config/agent_config.yaml with LLM endpoints and API keys.
  • CLI usage: python generate_docstrings.py --repo-path <path_to_repo>
  • Web UI: python run_web_ui.py (access at http://localhost:5000)
  • Evaluation UI: python src/web_eval/app.py (access at http://localhost:5001)
  • Supports local LLMs via an OpenAI-compatible API endpoint (e.g., using vllm).

Highlighted Details

  • Multi-agent system for specialized documentation tasks.
  • Hierarchical code processing based on dependencies.
  • Iterative docstring generation and verification.
  • Includes a web UI for configuration and monitoring.
  • Separate web-based evaluation system for docstring quality.

Maintenance & Community

The project is from Meta AI (facebookresearch). Further community or roadmap information is not detailed in the README.

Licensing & Compatibility

Licensed under the MIT License, permitting commercial use and integration with closed-source projects.

Limitations & Caveats

The README mentions that evaluation is run separately and provides instructions for its own README. Configuration requires manual setup of LLM endpoints and API keys.

Health Check
Last commit

3 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
137 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.