The Problem
Technical documentation for codebases typically falls out of sync with the actual implementation. Teams face a choice between stale wikis that mislead developers or manual documentation processes that consume excessive engineering time with every release cycle. For AI-assisted development, the absence of structured, machine-readable code context forces every agent to re-discover the same architectural patterns from raw source.
What This Does
deepwiki-rs (branded as Litho) automates repository documentation generation from source code. The Rust implementation (90 files) analyzes codebases and produces C4-model architecture documentation: container diagrams, component diagrams, and code-level documentation.
The preprocessing layer (src/generator/preprocess/) extracts structured information from 11 language processors: Rust, JavaScript, TypeScript, Python, Java, C#, PHP, Kotlin, Swift, Svelte, and Vue. Language-specific extractors live in src/generator/preprocess/extractors/language_processors/ and handle syntax parsing, dependency resolution, and API surface extraction. The research phase (src/generator/research/) employs seven specialized agents—architecture_researcher, boundary_analyzer, database_overview_analyzer, key_modules_insight, domain_modules_detector, system_context_researcher, and workflow_researcher—to build a comprehensive model before composition.
Composition (src/generator/compose/) renders the final output through six agents: architecture_editor, boundary_editor, database_editor, key_modules_insight_editor, overview_editor, and workflow_editor. The outlet layer (src/generator/outlet/) generates summary documents and reports. LLM integration (src/llm/client/) supports OpenAI-compatible providers and Ollama, with a summary reasoner and React-based execution pipeline.
The system stores intermediate state in src/cache/ (performance monitoring) and src/memory/, with a file explorer tool (src/llm/tools/file_explorer.rs) for navigating codebases during analysis.
How It Is Wired
Execution begins at src/main.rs, which initializes the generator and routes through src/generator/mod.rs. The typical flow is:
- Preprocessing (
src/generator/preprocess/mod.rs): Language processors extract structured artifacts from source files. The orchestrator scores directories (src/generator/preprocess/agents/directory_scoring.rs) and generates summaries via templated prompts (src/generator/preprocess/agents/prompts/).
- Research (
src/generator/research/mod.rs): The orchestrator (src/generator/research/orchestrator.rs) dispatches agents to analyze architecture boundaries, database schemas, key modules, and workflow patterns. Research memory (src/generator/research/memory.rs) persists intermediate findings.
- Composition (
src/generator/compose/mod.rs): Agents render the C4 model hierarchy—from system context through component diagrams—using the researched data.
- Output (
src/generator/outlet/mod.rs): Summary generators produce human-readable documentation and AI-ready context files.
The LLM client (src/llm/mod.rs) mediates model calls through providers defined in src/llm/client/providers.rs, with Ollama and OpenAI-compatible extractors (src/llm/client/ollama_extractor.rs, src/llm/client/openai_compatible_extractor.rs). The React executor (src/llm/client/react_executor.rs) handles tool use and multi-turn reasoning.
The cache (src/cache/mod.rs, src/cache/performance_monitor.rs) tracks analysis performance and can invalidate cached results when source changes. The project structure formatter (src/utils/project_structure_formatter.rs) and prompt compressor (src/utils/prompt_compressor.rs support token-efficient agent communication.
No test files were detected in the repository structure, and the heuristic analysis flags untested code paths repository-wide.
How To Use It
Setup:
# Clone the repository
git clone https://github.com/moses-y/deepwiki-rs
# Build with Cargo
cd deepwiki-rs
cargo build --release
Configuration: Edit Cargo.toml for dependency versions. The LLM provider is selected via src/llm/client/providers.rs; environment variables for API keys are referenced in .ai-context/meta/MAINTENANCE.md and .ai-context/references/ARCHITECTURE.md but are not explicitly defined in the root configuration files present.
Running it:
# Entry point
cargo run --release -- <path-to-codebase>
# Or invoke the binary directly after build
./target/release/deepwiki-rs <path-to-codebase>
The CLI (src/cli.rs) accepts a target repository path and optional flags for output format and LLM provider selection.
Real-World Use
In a typical engagement, a team running deepwiki-rs against a 50,000-line Rust codebase would invoke the CLI from src/main.rs. The generator preprocesses source files through the Rust language processor (src/generator/preprocess/extractors/language_processors/rust.rs), researches architectural boundaries and database interactions via the research orchestrator, and composes a C4 model stored in docs/en/1.Overview.md, docs/en/2.Architecture.md, and docs/en/3.Workflow.md. The resulting documentation includes component diagrams, dependency graphs, and API surface summaries—structured for both human readers and AI agents consuming ACP-formatted context.
The system also supports incremental updates: re-running against a modified codebase re-processes only changed files, leveraging the cache in src/cache/.
Code Health & Issues
- Medium/SDLC - No test files detected repository-wide: untested code paths. The absence of tests means mutation testing, integration validation, and regression guards are not currently exercised. (
repository-wide, heuristic analysis) - Configuration: LLM API keys and connection details are referenced in
.ai-context/files but not pinned to a single environment file within the root. Teams must manage secrets externally or via their CI system. - CI: GitHub Actions workflow at
.github/workflows/rust.ymlruns on push and pull requests, but the specific test commands and coverage targets are not visible in the repository structure provided.
The Bottom Line
deepwiki-rs delivers a functional, Rust-generated documentation pipeline that transforms source code into structured C4 architecture diagrams and code-level context. The modular agent architecture—preprocessing, research, composition, and outlet—is well-partitioned and the language processor extensibility supports diverse codebases. The primary trade-off is the absence of a test suite and the manual configuration required for LLM provider credentials. Teams prioritizing up-to-date architectural documentation without maintaining wikis manually, and who have LLM access available, will find this the most practical option; teams requiring zero-configuration onboarding or comprehensive test coverage will need to add those layers independently.