How m-e-u-e/documentation-using-ai-agent works
Project Type and Purpose
• This is a Python‑based CLI tool + documentation pipeline that:
• Fetches Markdown source from GitHub or GitLab repos (or local folders)
• Parses & potentially “enhances” them via AI agents
• Assembles final Markdown files (e.g. final_github_md_file.py)
• Serves them via MkDocs as a static documentation site
• It is not a web‑app server or microservices architecture; rather it is a single “monolithic” data‑processing pipeline + static site generator.
File Structure
• Top‑level:
• .gitignore, mkdocs.yml, requirements.txt, README
• agentic_parser/ – all Python modules
• docs/ – sources and MkDocs content
• Within agentic_parser/:
• Entry‐point scripts: final_github_md_file.py, GitLabScrappper.py, localmd.py, EnahncedDocsSearchTool.py
• Core engine: baseWorking.py (base classes and orchestration)
• Agent definitions: agents.py (AI integration)
• Parsing helpers: rootmd.py, repositorymd.py
• The presence of API‑key env vars in README shows external dependencies: GitHub/GitLab REST APIs, Gemini AI.
Extract Architecture Insights from the README
• Three “modes” of operation:
1. Fetch & assemble GitHub docs
2. Fetch & assemble GitLab docs (token vs. scraper fallback)
3. Read local Markdown directory
• MkDocs is used to serve the final docs (mkdocs serve).
Main Components
a. CLI / User Interface
• User runs Python scripts with env vars.
b. Configuration Layer
• Environment variables for API keys, repo URLs, branch names.
c. Fetchers / API Clients
• GitHubClient (in final_github_md_file.py)
• GitLabClient & Scraper (in GitLabScrappper.py)
• LocalFileLoader (localmd.py)
d. Core Processing Pipeline
• BaseWorking orchestrator (baseWorking.py)
• RepositoryMD & RootMD parsers (repositorymd.py, rootmd.py)
• Agent‐driven enhancements (agents.py, EnahncedDocsSearchTool.py)
e. Output Generator
• Final Markdown composer (final_github_md_file.py or local equivalent)
• Writes to docs/ folder or another build folder
f. Documentation Server
• MkDocs → builds & serves static site from docs/
Relationships & Data Flows
• User → CLI entrypoint → Config
• Config → Fetcher → External API or FileSystem
• Fetched MD → Core Pipeline → Agents → Final MD
• Final MD → MkDocs build → Static HTML
• User ↔ Browser (view docs)
Architectural Patterns & Design Principles
• Pipeline / stages pattern: each stage focuses on one task (fetch, parse, enhance, render)
• Dependency injection via env vars for credentials & endpoints
• Single‐process orchestration – no microservices
• Separation of concerns: IO (fetch), logic (parse, AI), presentation (MkDocs)
Technologies & Frameworks to Label
• Python 3.x
• Requests or GitHub/GitLab API libraries
• Gemini AI (via GEMINI_API_KEY) in agents.py
• MkDocs for static site
• Virtualenv for environment isolation