LLMs Technical Reviews

How are individual pages generated?

Per-page prompts; source-file citations; diagrams (Mermaid); parallelism; caching and regeneration.

Verdict

For pages that stay in step with the code, OpenDeepWiki and RepoAgent regenerate only what changed. For line-level source citations, deepwiki-open has the best repair step.

One call per page from prepared context. deepwiki-open writes each page from the top-20 retrieved chunks. It requires Mermaid diagrams and citations like [path:10-25](), which post_process_wiki_content() turns into host links with line anchors. Page concurrency defaults to 1. A cached wiki is never updated, only deleted and rebuilt. readmeX has one prompt method per page type. The architecture page gets a draw.io XML diagram (no Mermaid), and the changelog is built from git log --stat. There is no per-page cache.

Agents per page. OpenDeepWiki gives each page 6 source-tool calls and writes with WriteDoc plus up to 4 AppendDoc calls. It stores the files it read as SourceFiles. After one warm-up page, 5 pages run in parallel, and new commits trigger IncrementalUpdateAsync(). openDeepWiki (Go) chains document_generator, markdown_checker and document_checker. Pages run strictly one at a time, because the orchestrator starts with one worker. Rewrites create new versions. For updates, it runs git pull and an agent picks the chapters to rewrite from the diff.

Fixed slots filled by editors. deepwiki-rs runs one editor agent per page. The workflow and key-module editors can read files. Key-module pages run 3 in parallel. It needs the external mermaid-fixer binary and wipes the output folder on every run. A prompt-hash cache makes unchanged re-runs cheap. RepoWiki runs four JSON passes, with module passes 5 at a time. Its cache is per module, so editing one file re-runs that whole module. Bad JSON becomes a placeholder page with no retry.

One entry per symbol. RepoAgent documents callees before callers and puts their code and docs into each prompt. Its {project_structure} slot is never filled. A checkpoint diff regenerates only objects whose code or callers changed. There are no diagrams.

Pick: OpenDeepWiki for long, cited pages that update with commits. Pick: deepwiki-open for a quick wiki with line-anchored citations. Pick: RepoAgent for per-function docs in a pre-commit hook.

Per-project answers

AsyncFuncAI/deepwiki-open

answered

Individual wiki pages are generated by _generate_pages() in api/services/wiki/tasks.py (line 288). Each page from the WikiStructureModel is processed by _generate_page() (line 369), which builds a per-page prompt via build_page_prompt() in prompts.py (line 25). The prompt includes the page title and a pre-built Markdown list of relevant file links with host-specific URLs (GitHub blob/{branch}, GitLab -/blob/{branch}, Bitbucket src/{branch}). The prompt instructs the model to: start with a <details>" summary="Relevant source files" block citing >=5 files, use Mermaid diagrams extensively (flowcharts, sequence diagrams, class diagrams — all top-down via graph TD), create markdown tables, and cite sources using empty-parenthesis citations like Sources: [path/to/file.py:10-25]() (line 108-118).

Generation streams the LLM response through the research_chat() pipeline (same as RAG chat), then post-processes it in post_process_wiki_content() (api/services/wiki/content.py, line 84). This function: (1) rebuilds the <details> block with real hyperlinks from the known file list, (2) resolves all empty-parenthesis citations into proper GitHub/GitLab/Bitbucket URLs with line anchors (#L10-L25), (3) handles generic file-path citations and basename-only references, and (4) strips redundant empty parens.

Pages are generated with configurable concurrency: WIKI_PAGE_CONCURRENCY defaults to 1 (sequential) but each page gets up to WIKI_PAGE_RETRIES + 1 attempts before falling back to an error-placeholder page (line 268-285). Once all pages are done, the wiki is saved as a JSON cache file (deepwiki_cache_{type}_{owner}_{repo}_{lang}.json) in the wiki cache directory via save_wiki_cache() (io.py, line 52). Existing cache is detected at submission time to skip regeneration entirely (tasks.py line 176).

AIDotNet/OpenDeepWiki

answered

Per-page prompts. Each wiki page is generated by an LLM agent using the content-generator prompt (src/OpenDeepWiki/prompts/content-generator.md). WikiGenerator.GenerateDocumentsAsync() (src/OpenDeepWiki/Services/Wiki/WikiGenerator.cs:366) iterates over all leaf catalog items. For each item, GenerateDocumentContentAsync() (line 796) builds a user message with the catalog path/title, a git-based File Reference Base URL, and budget limits. The agent receives a GitTool (capped at MaxDocumentSourceToolCalls, default 6), a DocTool (for WriteDoc/AppendDoc/EditDoc), and a tool budget (MaxDocumentToolCalls, default 14; MaxDocumentAppendOperations, default 4).

Source-file citations. The agent is instructed to read 2-4 key source files, extract code snippets, and embed them with Markdown blockquote source links using the runtime File Reference Base URL (line 843–848). The DocTool automatically tracks which files were read; these are stored as a JSON array in DocFile.SourceFiles on the entity.

Mermaid diagrams. The prompt mandates at least one Mermaid diagram per page (architecture/flowchart/sequence/class/ER). Extensive Mermaid syntax rules are embedded in the prompt (line 850–900), including node ID naming, subgraph sg_ prefix requirements, and edge label quoting — reflecting real renderer constraints encountered in production.

Parallelism. GenerateDocumentsAsync() uses Parallel.ForEachAsync with MaxDegreeOfParallelism from WikiGeneratorOptions.ParallelCount (default 5, line 60). Before parallel execution, it "warms" the prompt cache by generating the first document sequentially (line 544–559), then processes the remaining items in parallel. Timed-out or failed documents are logged but don't stop the batch (line 497–542) unless ThrowOnPartialFailure is set. Each document has a timeout of DocumentGenerationTimeoutMinutes (default 60).

Caching and regeneration. Documents that already have persisted content via DocFileId are skipped (line 414–421). RegenerateDocumentAsync() (line 611) allows forced regeneration of a single path. Incremental updates (via IncrementalUpdateAsync, line 660) use the incremental-updater prompt with a restricted toolset (no WriteCatalog) to edit only affected documents based on git diff results between commits.

sopaco/deepwiki-rs

answered

Each page is generated by a dedicated editor agent implementing the StepForwardAgent trait. The six editors (OverviewEditor, ArchitectureEditor, WorkflowEditor, KeyModulesInsightEditor, BoundaryEditor, DatabaseEditor) each define their own PromptTemplate with system prompt, opening instruction, closing instruction, and LLMCallMode. Most editors use LLMCallMode::Prompt (plain text generation) — only KeyModuleInsightEditor uses PromptWithTools (ReAct mode with file_explorer and file_reader tools). Per the agent prompt guidelines in overview_editor.rs, editors are instructed to include Mermaid diagrams with restrictions: ASCII-only node IDs, no zero-width characters, standard diagram headers. After generation, MermaidFixer (src/generator/outlet/fixer.rs) runs mermaid-fixer as an external program on the output directory to auto-fix any syntax issues.

Parallelism is implemented in KeyModulesInsightEditor.execute(): it creates one KeyModuleInsightEditor per domain report and runs them concurrently using do_parallel_with_limit() from src/utils/threads.rs (a semaphore-bounded concurrent executor). The concurrency limit is config.llm.max_parallels (default 3).

Caching is performed at the LLM call level in agent_executor.rs (extract(), prompt(), prompt_with_tools() functions). Each function computes a cache key from the system+user prompt, checks the CacheManager, and stores results with token usage estimates. Cache scope is the agent type key, so re-running with identical prompts hits the cache. --force-regenerate clears the cache before starting. Output is written by DiskOutlet.save() which iterates the DocTree, retrieves each document from Memory by its scoped key, and writes it to output_path. Source file citations come from the research data fed into each editor's prompt.

Editor's note. Correction: WorkflowEditor also runs in PromptWithTools mode alongside the per-domain KeyModuleInsightEditor; the other editors (overview, architecture, boundary, database) use plain Prompt.

OpenBMB/RepoAgent

answered

Per-page generation is done by ChatEngine.generate_doc() in chat_engine.py:116-132. Each DocItem (representing a single function, class method, or sub-function) gets its own LLM call. Prompts are built by ChatEngine.build_prompt() (chat_engine.py:27-114), which assembles:

  • The object's source code
  • Its file path within the project
  • A hierarchical project structure with the current object marked (✳️)
  • Code and documentation of objects it calls (reference_who)
  • Code and documentation of objects that call it (who_reference_me)
  • Whether the function has a return value (to conditionally request an "Output Example" section)
  • A language parameter to control output language

The prompt follows a rigid template (prompt.py:5-32) requiring bold section headers (**function_name**, parameters_or_attribute, Code Description, Note) and forbidding the model from outputting markdown headings (so the output is a flat block that gets rendered at the correct heading level later).

Concurrency: Generation runs with max_thread_count threads (default 4). Tasks are dispatched by the TaskManager (multi_task_dispatch.py:103-125), which respects dependency ordering (callees before callers for reference content) while allowing independent objects to run in parallel. The worker loop grabs the next available task, calls generate_doc_for_a_single_item(), which calls ChatEngine.generate_doc(), then marks the task complete (runner.py:76-100, runner.py:119-155).

Caching and regeneration: The MetaInfo class persists to a checkpoint directory (.project_doc_record/) containing project_hierarchy.json and meta-info.json (doc_meta_info.py:393-439). On subsequent runs, Runner.__init__() loads this checkpoint and MetaInfo.load_doc_from_older_meta() (doc_meta_info.py:716-804) compares old vs new code content. Objects whose code_content changed get status code_changed; objects whose set of referencers changed get add_new_referencer or referencer_not_exist; unchanged objects remain doc_up_to_date and are skipped. Only objects requiring generation are dispatched as tasks.

Markdown rendering: After generation, Runner.markdown_refresh() (runner.py:157-231) iterates all file-node DocItem objects, serializes each child (class or function) as a markdown section with heading levels determined by nesting depth, and writes one .md file per original .py file. There are no Mermaid diagrams or any visual elements added — the output is pure text and markdown headings.

Diagrams: No diagram generation (Mermaid or otherwise) is implemented anywhere in the codebase.

Editor's note. Correction: the prompt template has a {project_structure} placeholder, but build_prompt never fills it, so no project hierarchy is sent; the prompt contains the object's code plus the code and latest docs of its callees and callers.

aibox22/readmeX

answered

Each page type has a dedicated prompt-builder method (website_core.py:1620-2170): _create_installation_prompt, _create_usage_prompt, _create_examples_prompt, _create_architecture_prompt, _create_contributing_prompt, _create_changelog_prompt. These methods receive the project_analysis dict (file tree, AST-extracted functions/classes, dependency lists, git info, commit history) and format it into a detailed markdown prompt. For the home page, _generate_readme_as_homepage() (website_core.py:869-952) reuses the full README-generation pipeline from readmex.core, creating a temporary readmex instance in silent mode. The architecture page generates a draw.io XML diagram via _generate_drawio_diagram() (website_core.py:1409-1515) with LLM retry logic (3 attempts, validation of XML completeness). The changelog page is especially rich: it runs git log --stat to get commit history with file-change counts, groups commits by type (feat/fix/docs/etc.), detects breaking changes, lists contributors, and feeds all of that into the prompt (website_core.py:2036-2171). Pages are generated in parallel using ThreadPoolExecutor (_generate_pages_in_parallel(), website_core.py:208-255) — six page tasks plus the API doc pages (which themselves use ThreadPoolExecutor for individual API pages). When RAG is enabled, the base prompt is augmented with code_rag.generate_enhanced_prompt() (website_core.py:672-687, code_rag.py:789-828) which appends the top-8 semantically related code blocks as context. Caching: CodeRAG caches extracted code_blocks.pkl, relations.pkl, embeddings.pkl, and faiss_index.bin under .rag_cache/ (code_rag.py:868-933). There is no per-page cache — the RAG cache is all-or-nothing. In debug mode, all LLM calls are skipped and placeholder content is returned instead (website_core.py:715-838). No Mermaid diagrams are generated (the project uses draw.io XML for architecture and MkDocs's drawio plugin for rendering).

he-yufeng/RepoWiki

answered

Each page type is generated by a dedicated method in WikiBuilder (src/repowiki/core/wiki_builder.py) that renders Pydantic model data into Markdown. The content originates from four distinct LLM passes orchestrated by Analyzer.analyze() (src/repowiki/core/analyzer.py:60-109):

Overview — prompt includes the file tree and key config/entrypoint files (prompts.py:26-56). The LLM returns JSON with name, one-liner, description, tech stack, setup instructions, and key features.

Module pages — one LLM call per module group. The prompt (prompts.py:59-97) includes the project summary and all files in that module (with full content for configs, preview/skeleton for others). The LLM returns JSON with purpose, description, per-file docs with key_symbols (name, kind, description), internal relationships, and key concepts. The builder renders this into file subsections with backtick symbol listings and relationship arrows (wiki_builder.py:237-268).

Architecture — the LLM generates Mermaid component/sequence diagrams (prompts.py:100-134). These are embedded in fenced ````mermaid blocks (wiki_builder.py:171-186). The self-contained HTML export ships the Mermaid.js CDN library and renders diagrams client-side (export/html.py:205-206`).

Module analysis runs in parallel — _analyze_modules() uses asyncio.as_completed() with a Semaphore(concurrency) (default 5) (analyzer.py:166-197). Concurrency is configurable via Config.concurrency (config.py:59).

Caching: every LLM result is stored in a SQLite cache at ~/.repowiki/cache.db, keyed by {model}:{language}:{pass_type}:{content_hash} (cache.py:27-73). On re-run, only files whose content changed (detected by content_hash()) trigger a new LLM call. The markdown export also maintains per-page fingerprints in .repowiki-state.json (state.py), so pages whose source and rendered content are unchanged are not rewritten. The --full flag forces regeneration. For oversized Python files, context_for_file() (skeleton.py:92-108) emits an AST-derived skeleton of top-level classes and functions instead of blind head-truncation.

Editor's note. Correction: caching is per module, not per file. One edited file re-runs its whole module prompt, and any added or removed file changes the tree hash and re-runs the overview, architecture and reading-guide passes.

weibaohui/openDeepWiki

answered

Individual pages are generated by specialized writer implementations, all implementing the Writer interface with Generate(ctx, localPath, title, taskID). Each writer builds a sequential agent pipeline from 2–3 sub-agents. For example, defaultWriter uses document_generator → markdown_checker → document_checker; dbModelWriter uses db_model_explorer → document_checker → markdown_checker; apiWriter uses api_explorer → document_checker → markdown_checker. The agent receives the local repo path, the document title, an outline (from the TOC stage), and context hints. Hints are searched by domain-specific keywords: the DB model writer searches hints for "sql", "ddl", "schema", "model" etc., while the API writer searches for "api", "route", "handler", "endpoint" etc. Each writer's prompt instructs Markdown output. Diagrams (Mermaid) are rendered client-side: the frontend's MermaidRender.tsx component renders Mermaid blocks in generated Markdown, with special handling for character escaping and dark/light theme support. Tasks run independently through an event bus and orchestrator, enabling parallelism — multiple pages can be generated concurrently. Document versions are tracked via a Version integer and IsLatest flag; regenerating a page creates a new version while preserving older ones.

Editor's note. Correction: pages are not generated concurrently. main.go initialises the global orchestrator with one worker (InitGlobalOrchestrator(1, ...)), so DocWrite tasks run strictly one after another.

← How is the wiki structure (table of contents) determined? · How are model providers configured? →